Requesting time from MQTT/Openhab - How?


  • Hero Member

    Im currently scratching my head trying to work out the best way to provide a sensor the current time, via MQTTClientGateway and Openhab.

    I don't have access to my hardware here ( im at work ) so cant test a lot of this, but I thought id put it out here now in case anyone has some ideas/thoughts..or solution 😉

    Q: What message is sent to MQTT when a sensor node requests the time?

    Q: What does the Openhab "item" look like to watch for the request. This would then run a rule to return the epoch time back to the sensor node.

    Q: What MQTT message needs to be returned to the node?


  • Hero Member

    To answer myself, the mqtt message sent is onto topic
    mygateway1-out/x/255/3/0/1

    (where x is the node id )

    and the reply is likewise sent back to

    mygateway1-in/4/255/3/0/1 - with a payload being the epoch time

    So now to work out the plumbing within Openhab. I already have a Number item with the epoch time (albeit in UTC)...so just need to work on the rules.


  • Hero Member


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 8
  • 18
  • 6
  • 1

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts