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. Hardware
  3. MQTT Gateway and Relay Status

MQTT Gateway and Relay Status

Scheduled Pinned Locked Moved Hardware
6 Posts 4 Posters 2.9k 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.
  • X Offline
    X Offline
    xefil
    wrote on last edited by
    #1

    Hello to all,

    Following your guide I was able to setup a Controller (OpenHab), a MQTT Gateway and some nodes.
    Until here all works. If I send a command from OpenHab to turn on a relay, it works.
    Sometimes it happens that the relay message is lost. I'll try to gain range, but menawhie the result is that:

    • OpenHab thinks the relay is on
    • the remote node doesn't receive the message and leaves the relay off

    How could I manage this situation to maintain OpenHab updated with the right status?
    Actually I'm sending out (from the node to the GW) the relay status every 10 minutes.
    Could this be enough or is there a better way to do that?
    I've seen there is the ACK option, but this would only confirm that a message is sent succesfully from the node to the GW. This would not confirm that the relay is actually ON or OFF on the controller side.
    I.e. if I don't receive an ACK from the GW I only be sure that the GW is not updated.

    Any ideas?

    Thanks

    Simon

    1 Reply Last reply
    0
    • gaduG Offline
      gaduG Offline
      gadu
      wrote on last edited by
      #2

      I have exactly the same question after playing around with a relay and MQTT today.
      Following this thread... :)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gambituk
        wrote on last edited by
        #3

        +1 for me too, it just seems to naturally occur that this should be a feature in this workflow, i guess there could be long ways of going about this with led's and light sensors to actually check and report back the actual situation via mqtt and even a retry rule in openhab, but i would hope there would be a software only way of doing this.

        1 Reply Last reply
        0
        • gaduG Offline
          gaduG Offline
          gadu
          wrote on last edited by gadu
          #4

          I'm thinking outside the box (shouldn't do that) so here goes...

          This would require another type of relay with dual connections.
          If you combine the doorsensor with the relay sketch the arduino if "forced" to send activity (V_TRIPPED) from the relay.

          Here's a poor painted sketch...
          CaptureMyS.JPG

          Or something similar... :)

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by hek
            #5

            In the vera plugin it works like this:

            1. User clicks on GUI button on controller to turn off relay (but no status is changed right now).
            2. Plugin sends a message to turn off relay (with ack enabled)
            3. Message reaches node and relay is turned off. The library automaticially sends ack-message back to gw/controller.. Message is identical to the original message (exceptp for some bits in header).
            4. Vera receives message to turn off relay button.
            5. Button in GUI is switched off.

            So if the MQTT gateway would ask for an ack from actuators and send this back to the OpenHAB MQTT subscriber something similar should be archivable.

            1 Reply Last reply
            0
            • X Offline
              X Offline
              xefil
              wrote on last edited by
              #6

              @hek
              It works to have a feedback from the sensor, but this doesn't give a status if someone acts on the relay manually.
              BTW I've tested a similar approach. I send from the sensor a custom variable with the status of the relay.
              @gadu
              This is the best approach. This could handle the status of the relay even if manual activated. The return of the signal always give us the relay position. But it needs a different dual stepper relay. I'll try this as well soon.

              Thanks a lot to all!

              Simon

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


              10

              Online

              11.7k

              Users

              11.2k

              Topics

              113.0k

              Posts


              Copyright 2019 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