Ampio allows the possibility of integrations via the Node-RED platform and makes a library of nodes available that make such integrations easier. We cannot, however, be held responsible for any problems arising from using e.g., libraries of other companies.
In order to use the functionality of integration between the Ampio system and Node-RED, you have to launch the interface in your browser and provide the server IP address, as well as the admin’s password.
The Node-RED interface can be accessed on M-SERV via port 1880 by entering IP:1880 (e.g. 192.168.1.2:1880) into the browser.
A selection of Node-RED nodes is on the left side of the interface, where you can also find Ampio’s predefined nodes that will facilitate creating dependencies.
Each of the nodes has its own guideline in the Help tab.
In order to ensure that the node-red-contrib-ampio library is up to date, enter Menu → Manage palette and check whether an update is available, or not. If an update is performed, you must reset the server.
After using the first node from the Ampio library, it is worth it to perform a Deploy in order to check whether the node changed its status to connected, or not. Then, the node’s menu should be open, the magnifying glass icon selected and within 15 seconds a list of your devices should be displayed.
If the node does not have a connected status, it might be necessary to configure it. Select the edit option right next to the Server field (the pencil icon). In the Connection tab in the Server field, enter the localhost, leave the port at 1883. In the Credentials tab, enter the login details from your Ampio www server.
Once that is complete, click on Update, then Done and perform a Deploy.
Node-RED enables code debugging and displaying information (data) on the right side of the interface. Examples are provided below:
If the Ampio IN node is configured correctly, you will see “connected” under the node.
If the Ampio OUT node is configured correctly, you will see “connected” under the node.
The starting point is the top left corner of the screen. Its coordinates are LCD X=00 and LCD Y=00. Increasing the LCD X value will move the text towards the right side. Increasing the LCD Y value will lower the text, as shown below.
Here, we present an example of how to obtain the temperature from an Ampio module and display it, together with a description, on an M-DOT panel.
In the Ampio IN node, select, from which module you would like to get the temperature values, set the value type and the sensor’s ID.
In the Ampio LCD node, select the M-DOT module and set up the position of text, the font size and colour, as well as the background colour.
Connect the nodes and click deploy.
The settings presented above will give you a white text ” TEMP: temperature value” in the middle of the screen on black background.
There is a possibility of integrating the Node-RED platform with the Ampio system without using predefined nodes. An MQTT broker will let you do that. With MQTT you can also track more events in the CAN network and control more advanced functions.
In order to do that, use nodes mqtt in and mqtt out.
If you are using Node-RED installed on the M-SERV module, enter localhost in server properties. In other cases, credentials for login are the same as the ones used for the Smart Home Manager application and the server is provided with the use of an IP address. Once you are done, click on Add, Done and Deploy.
Communication with the MQTT broker is mostly two-directional (from and to). A topic that begins with ampio/from allows for checking the status of devices. A topic that begins with ampio/to is used to control devices.
Examples of ampio/to usage:
ampio/to/<mac>/cmd – run the command
ampio/to/<mac>/raw – raw data frame
ampio/to/can/dev/list – a list of devices in the CAN network
ampio/to/event – broadcast the event
A list of commands:
|set a single output||
||off; 0..255,0..255,0..255 (on – jak ma działać)|
||0 – STOP; 1 – DOWN; 2 – UP|
||temperatura_dzień, temperatora_noc (przykład: 19,20)|
|MRT- operating mode||
||0 – kalendarz; 1 – MANUAL; 2 – MANUAL2; 3 – wakacje; 4 – blokada|
Examples of the
|Type||Topic||Payload string||Przykładowy payload|
||-99.9 do 1000.0 (nawet więcej)||21.5|
||0 lub 1||1|
||0 lub 1||1|
||0 do 255||0|
|binary input extended||
||0 lub 1||0|
|binary output extended||
||0 lub 1||0|
|line flags u8||
|MRT – temperature||
|8-bit analogue values (DALI, LED)||
|16-bit analogue values (signed)||
|16-bit reduced by 10K||
|32-bit values, e.g MODBUS||
||0…4 294 967 296||1234|
If you want to check all the available information in the system, use the mqtt in node, set the topic to
ampio/# and connect debug. Then, click Done and Deploy. The data should appear in the debug window.
If you would like to check the data from one, selected module, set the topic to
MAC address should always be entered without leading zeros.
Always use the local MAC address to control modules.
If you want to check the status of a field in an M-DOT module, set the topic to:
In order to activate the first output in a device with the MAC address ABCD, set the topic to: ampio/to/ABCD/o/1/cmd , and payload to: on.
Both options presented below will bring the same result:
Apart from controlling outputs with commands, there is also a possibility to create own texts on the M-DOT display with the use of API commands. In order to use them, select the topic
RAW. It might be necessary to update the software of the M-DOT module.
Control via API can be divided according to different LCD displays’ dimensions, as follows:
Commands to be displayed (for multi-screen displays):
Functions not related to screens, always overwriting the current screen:
For example, sending:
msg.topic = ampio/to/ABAB/raw msg.payload = “1E03003031303130313031”;
changes the big row to 1 and 0 (in accordance with the ASCII code) on M-DOT with the MAC address ABAB.
Sending msg.payload = “2918000000003344AABB30313233” will return 0123 on the screen in specified colours.
Note: please mind the bit significance – LSB/MSB.
Sending 291251000001… will start writing from 81 on the X-axis and 256 on the Y-axis. It is worth using a Windows calculator in a programmer mode for the calculations (hex 51 gives decimal 81, hex 100 gives decimal 256).
Sending 290C0000EF006A00D300000000 will draw a black rectangle extending over the whole width of the screen, between 1/3 and 2/3 of its height (it is the second row for the option 3 text rows).
2-byte colours are saved in an RGB565 format.
Data that can be read from multisensor M-SENS:
Some of the control functions in Node-RED are made available through the RAW function.
The control topic is as follows: ampio/to/mac_adress/raw.
Below, you will find a list of examples of the functions that can be managed with the RAW topic:
Example: turns on flag 1 for 2 seconds in a device with the MAC=30EE
Example: set a specific colour
set: mac=33CD, colour R=255, G=255, B=0, W=0;
Example: Ustaw flagę 0 na wartość 128.
payload: 7AF98000 (string)
Example: Set the 0 flag to the value 4660.
payload: 79F2342100 (string)
Payload description: 31 - controlling the roller blind F9 - set a number to value 02 - open (00 - stop, 01 - close, 02 - open) 00 - the roller blind’s number from 0
Example: Open the first roller blind.
topic: ampio/to/1907/raw payload: 31F90200 (string)
The function works in the MQTT broker version 4.25.1.
Example: Broadcast the temperature of 22 degrees as 11001055 address into the bus.
topic: ampio/to/broadcast/55/t payload: 22 (number)
Please, bear in mind that not all modules support the above-mentioned functionalities. We recommend checking in the Ampio Smart Home Configurator whether a given module supports, for example, 16-bit flags, or not.