Adding a light switch to Openhab/MQTT gateway
-
I am currently running Openhab with Mysensor MQTT gateway and it reads the sensors fine. I have added a light switch to a node and Openhab. When I switch the light on, I see in the Openhab log state "received command on", but nothing shows up in the MQTT output, which I monitor with MQTT-spy. The item line in Openhab is :Switch node2_sw2 "sw2" {mqtt=">[mysensor:MyMQTT/2/5/V_LIGHT:command:ON:1],>[mysensor:MyMQTT/2/5/V_LIGHT:command:OFF:0]"}, where the node is 2 and the child_ID is 5. I do not know what to check next. Any help will be appreciated.
John
-
Hello,
I'm using exact the same statement. In addition I have a mapping statement. Don't ask if this is necessary.
My line:
{mqtt=">[mysensor:MyMQTT/1/1/V_LIGHT:command:ON:1],>[mysensor:MyMQTT/1/1/V_LIGHT:command:OFF:0],<[mysensor:MyMQTT/1/1/V_LIGHT:command:MAP(1on0off.map)]"}The content of file 1on0off.map in folder /configurations/transform:
1=ON
0=OFF
-
I had also tried adding the mapping statement, but it had no effect. I have no idea what to try next.? Do you think it could be a problem with the node sketch up?
Thanks
-
-
I noticed that MQTT server can only accept 1 client connection at a time. So when testing - do not use another client to "listen" when Openhab talks to Mysensors.
-
Try testing Openhab and MQTT Mysensors gateways separately, by connecting to them with outside clients and checking if the right commands come out and if these command cause right kind of reaction at MQTT Mysensors gateway.
-
-
The statements from jmmorgan and Xander both look OK to me.
mine is:Switch node1_sw1 "sw1" {mqtt=">[mysensors:MyMQTT/1/1/V_LIGHT:command:ON:1],>[mysensors:MyMQTT/1/1/V_LIGHT:command:OFF:0],<[mysensors:MyMQTT/1/1/V_LIGHT:command:MAP(1on0off.map)]"}
Suggested Topics
-
Boxes and Enclosures
Enclosures / 3D Printing • 29 Mar 2014, 21:02 • PITP2 31 Aug 2014, 19:27 -
OH2.5.9 / ethernet gateway / autodiscovery?
OpenHAB • 20 Oct 2020, 15:31 • Stefferd 22 Oct 2020, 13:38 -
OH3, RPi3, GPIO-NRF24 gateway. MySensors binding (ETH or MQTT?)
OpenHAB • 30 Sept 2021, 10:24 • perIpI 1 Oct 2021, 09:19 -
openhab binding mysensors
OpenHAB • 14 Mar 2021, 18:44 • MDS 15 Mar 2021, 21:56 -
openHAB 2.5 binding and V_VARx
OpenHAB • 25 May 2020, 15:49 • syntacrsc 4 May 2022, 20:47 -
voltage sensor via esp and mqtt
OpenHAB • 7 Nov 2020, 09:49 • muhammed 7 Nov 2020, 09:49