npm package: @seveno/node-red-contrib-seveno
Description: Gateway for communication with SEVEN|O instance. Receiving command updates and request command execution. BusJournal node allows to select history data from the bus journal.
Author: Tobias Lehmann | seveno.org | SEVEN|O
Latest version: 1.1.0

# SEVEN|O node

## Description

_SEVEN|O_ node is a gateway to connect a [_SEVEN|O_](www.seveno.org) instance to Node-RED. This gateway allows to subscribe command status updates provided by [_SEVEN|O_](www.seveno.org). Additional it is possible to use this node to send a command execution request to the [_SEVEN|O_](www.seveno.org) instance which executes the command on the connected system.  
Summarized, this means it is possible to control all IoT devices connected to [_SEVEN|O_](www.seveno.org).  
Some examples are *KNX, DALI, MQTT, OpenWeather, Sonos, FroniusConverter, Gardena SmartHome, Luxtronik, Balboa Spa* and many more.

<img src="https://www.seveno.org/wp-content/uploads/2021/02/overview-1.png" alt="Overview of SEVEN|O node usage as input and output" width="1400" >

## Configuration

At first the following properties must be configured on the Gateway

<img src="https://www.seveno.org/wp-content/uploads/2021/02/configuration_gateway.png" alt="Gateway configuration" width="400" >

#### WebSocked Endpoint

The communication between this [_SEVEN|O_](www.seveno.org) Node-RED node and the [_SEVEN|O_](www.seveno.org) instance is established by a WebSocket connection.  
Here the WebSocket endpoint of the [_SEVEN|O_](www.seveno.org) Node-RED plugin must be defined.

> Example: http://localhost:8080/ws

#### Topic Command Listing

This topic is used by [_SEVEN|O_](www.seveno.org) plugin to publish a list of all available commands. 

> Example: /nodered/command/listing

#### Topic Command Updates

This topic is used by [_SEVEN|O_](www.seveno.org) plugin to publish all command status updates. 

> Example: /nodered/command/update

#### Request Command Listing Endpoint

This endpoint can be used to send a request for command listing published by [_SEVEN|O_](www.seveno.org). Command listing are usually published periodically. With this endpoint it is possible to trigger the publishing of command listing.

> Example: /app/nodered/request/command/listing

#### Request Command Execution Endpoint

This endpoint can be used to send a command execution request from Node-RED to [_SEVEN|O_](www.seveno.org). 

> Example: /app/nodered/request/command/execution

## WebSocket connection

As soon as the gateway is configured it will estimate a connection.  
In case of connection was successfully created, the node will be marked as **Connected**, else as **Disconnected**.

## Command configuration / selection

As soon as the node is connected the drop down list is filled with all available commands.  
As soon as a command is selected the Value type is filled with available types. If no special type is available, default is set. Value key defines different available types of the selected command.  
For example if a light is selected, the value types *SWITCH* and *DIMMER* are available to select if the light should be turned *on/off* or if only the *brightness* should be changed.

<img src="https://www.seveno.org/wp-content/uploads/2021/02/configuration_command.png" alt="Command configuration" width="400" >

## Technology

The _SEVEN|O_ node communicates using a WebSocket connection with the [_SEVEN|O_](www.seveno.org) instance. The Node-RED backend creates one WebSocket connection which is used by all [_SEVEN|O_](www.seveno.org) nodes.

## License
MIT Licence Copyright (c) [SEVEN|O](www.seveno.org) - Tobias Lehmann (tobi@seveno.org)

## Contact
Tobias Lehmann (tobi@seveno.org)  
[_SEVEN|O_](www.seveno.org)  
www.seveno.org