Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. Adding a light switch to Openhab/MQTT gateway

Adding a light switch to Openhab/MQTT gateway

Scheduled Pinned Locked Moved OpenHAB
5 Posts 3 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jmmorgan
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • XanderX Offline
      XanderX Offline
      Xander
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jmmorgan
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ruslan
          wrote on last edited by
          #4
          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.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            ruslan
            wrote on last edited by
            #5

            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)]"}
            
            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            27

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular