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.

  • Hello,
    I'm using exact the same statement. In addition I have a mapping statement. Don't ask if this is necessary.
    My line:

    The content of file in folder /configurations/transform:

  • 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?

    1. 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.

    2. 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(]"}

Log in to reply

Suggested Topics

  • 22
  • 1
  • 23
  • 15
  • 2
  • 3
  • 2
  • 3