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 -
voltage sensor via esp and mqtt
OpenHAB • 7 Nov 2020, 09:49 • muhammed 7 Nov 2020, 09:49 -
openHAB 2.2 binding
OpenHAB • 18 Jul 2017, 12:49 • TimO 23 Dec 2020, 14:32 -
MQTT losing messages...
OpenHAB • 8 Jul 2022, 11:27 • ben999 17 Jul 2022, 18:00 -
OH3 Serial Gateway Problem
OpenHAB • 15 Feb 2022, 09:48 • seppi9 22 Feb 2022, 13:44 -
openHAB 2.5 binding and V_VARx
OpenHAB • 25 May 2020, 15:49 • syntacrsc 4 May 2022, 20:47