Requesting time from MQTT/Openhab - How?
-
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?
-
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.
-
My memory is sh*t.... i even replied to this relevant post!
http://forum.mysensors.org/topic/812/realtimeclockdisplaysensor-ino-no-fetch-time-from-controller/6
Suggested Topics
-
Is MQTT Necessary? or, Use Case for MQTT?
Controllers • 28 Mar 2016, 01:12 • TRS-80 9 Jan 2020, 09:01 -
Help needed - MQTT Ethernet gateway to Openhab
OpenHAB • 1 Jan 2015, 19:16 • brad.s 22 Nov 2015, 10:17 -
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Anyone Using Rpi as MQTT gateway ?
Controllers • 11 Feb 2015, 15:05 • mainali 11 Feb 2015, 15:05 -
MQTT/OpenHab gw.request reply
OpenHAB • 5 Dec 2014, 11:50 • adi32k 10 Dec 2014, 18:32 -
RealTimeClockDisplaySensor.ino - no fetch time from controller
OpenHAB • 11 Jan 2015, 22:18 • osalval 9 Feb 2016, 15:08