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. Troubleshooting
  3. [Solved] Noob question: How to set value to actuator via mqtt

[Solved] Noob question: How to set value to actuator via mqtt

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 1.4k Views 3 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.
  • Harry van der WolfH Offline
    Harry van der WolfH Offline
    Harry van der Wolf
    wrote on last edited by Harry van der Wolf
    #1

    I'm using the Gatewayesp8266MQTTClient from the Development repository.
    I'm reading 3 temperature sensors without problem.
    I have now positioned a relay in my network using the default RelayActuator. I only set the node id manually to 15.
    I'm using mosquitto on my RaspberryPi and view the messages with mosquitto_sub -v -t 'mygateway1-out/#'
    When I start the node (on a arduino mini pro) I see the following in mosquitto

    mygateway1-out/15/255/0/0/18 1.5.4
    mygateway1-out/15/255/3/0/6 0
    mygateway1-out/15/255/3/0/11 My Relay
    mygateway1-out/15/255/3/0/12 1.0
    mygateway1-out/15/1/0/0/3 (null)
    mygateway1-out/15/255/0/0/18 1.5.4
    mygateway1-out/15/255/3/0/6 0
    mygateway1-out/15/255/3/0/11 My Relay
    mygateway1-out/15/255/3/0/12 1.0
    mygateway1-out/15/1/0/0/3 (null)
    

    Edit (sorry, forgotten)
    The serial output is:

    read: 0-0-15 s=255,c=3,t=15,pt=0,l=2,sg=0:
    repeater started, id=15, parent=0, distance=1
    send: 15-15-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:My Relay
    send: 15-15-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
    send: 15-15-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok:
    

    From mosquitto I can give commands as well with mosquitto_pub. Based on the example in https://www.mysensors.org/download/serial_api_15 (last line actually) I used the following commands to switch off/on
    mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 0 and mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 1
    This doesn't work. Unfortunately, not one single combination I try works. sensor=1? sensor=255?

    What am I doing wrong?

    martinhjelmareM 1 Reply Last reply
    0
    • Harry van der WolfH Harry van der Wolf

      I'm using the Gatewayesp8266MQTTClient from the Development repository.
      I'm reading 3 temperature sensors without problem.
      I have now positioned a relay in my network using the default RelayActuator. I only set the node id manually to 15.
      I'm using mosquitto on my RaspberryPi and view the messages with mosquitto_sub -v -t 'mygateway1-out/#'
      When I start the node (on a arduino mini pro) I see the following in mosquitto

      mygateway1-out/15/255/0/0/18 1.5.4
      mygateway1-out/15/255/3/0/6 0
      mygateway1-out/15/255/3/0/11 My Relay
      mygateway1-out/15/255/3/0/12 1.0
      mygateway1-out/15/1/0/0/3 (null)
      mygateway1-out/15/255/0/0/18 1.5.4
      mygateway1-out/15/255/3/0/6 0
      mygateway1-out/15/255/3/0/11 My Relay
      mygateway1-out/15/255/3/0/12 1.0
      mygateway1-out/15/1/0/0/3 (null)
      

      Edit (sorry, forgotten)
      The serial output is:

      read: 0-0-15 s=255,c=3,t=15,pt=0,l=2,sg=0:
      repeater started, id=15, parent=0, distance=1
      send: 15-15-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:My Relay
      send: 15-15-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
      send: 15-15-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok:
      

      From mosquitto I can give commands as well with mosquitto_pub. Based on the example in https://www.mysensors.org/download/serial_api_15 (last line actually) I used the following commands to switch off/on
      mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 0 and mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 1
      This doesn't work. Unfortunately, not one single combination I try works. sensor=1? sensor=255?

      What am I doing wrong?

      martinhjelmareM Offline
      martinhjelmareM Offline
      martinhjelmare
      Plugin Developer
      wrote on last edited by martinhjelmare
      #2

      @Harry-van-der-Wolf

      Hi!

      There should be two different topic prefixes in the client sketch. One for outgoing messages to which the gateway publishes, and one for incoming messages to which the client gateway subscribes. The last topic prefix is the one you should use to publish updates to the gateway.

      The prefix is called mygateway1-in or similar as default.

      Harry van der WolfH 1 Reply Last reply
      0
      • rollercontainerR Offline
        rollercontainerR Offline
        rollercontainer
        wrote on last edited by
        #3

        Maybe that helps a bit:
        https://forum.mysensors.org/topic/1467/how-to-deal-with-a-request-for-information-from-controller/19

        1 Reply Last reply
        0
        • martinhjelmareM martinhjelmare

          @Harry-van-der-Wolf

          Hi!

          There should be two different topic prefixes in the client sketch. One for outgoing messages to which the gateway publishes, and one for incoming messages to which the client gateway subscribes. The last topic prefix is the one you should use to publish updates to the gateway.

          The prefix is called mygateway1-in or similar as default.

          Harry van der WolfH Offline
          Harry van der WolfH Offline
          Harry van der Wolf
          wrote on last edited by Harry van der Wolf
          #4

          @martinhjelmare and @rollercontainer

          There are days that I feel less intelligent. ;)
          That mygateway1-in is indeed the reason and exactly as specified in the GatewayESP8266MQTTClient.ino sketch for incoming subscribe messages.

          mosquitto_pub -t 'mygateway1-in/15/1/2/0/2' -m 0 and mosquitto_pub -t 'mygateway1-in/15/1/2/0/2' -m 1 does switch the relay off and on.

          Thanks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          19

          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