RealTimeClockDisplaySensor.ino - no fetch time from controller



  • Hi, I'm not a software men.
    I have working well MQTT Gateway with Openhab

    The sketch RealTimeClockDisplaySensor.ino compile in Arduino 1.0.6 with a lot of red lines "avrdude" but finish anyway.
    This is that monitor shows:

    sensor started, id 22
    send: 22-22-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1
    send: 22-22-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
    read: 0-0-22 s=255,c=3,t=6,pt=0,l=1:M
    send: 22-22-0-0 s=255,c=3,t=11,pt=0,l=9,st=ok:RTC Clock
    send: 22-22-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
    RTC has set the system time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:
    requesting time
    send: 22-22-0-0 s=255,c=3,t=1,pt=0,l=0,st=ok:

    So it did not get time from controller. Is it neccesary add something in openhab?



  • @osalval
    By the way I find, THE ONLY one library: LiquidCrystal, that Works with Arduino V1.5.8:

    https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
    LiquidCrystal_V1.2.1.zip
    https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/LiquidCrystal_V1.2.1.zip

    I still can not fetching time from controller. What i shoul do with openHAB and MQTTGateway?



  • Hi, did you find a solution for this. same conditions as you.
    OpenHab + MQTT gw

    I can´t get time from the controller.



  • I have not observed that Openhab can answer any controller-type messages. For any such messages I have had to build my own logic to fix it.

    In this case the message is of type 3 (= internal message) with a subtype of 1 (= I_TIME) and Openhab does not have a clue what this is until you define an item and use rules to respond correctly.

    In other cases I have found that the easiest route around it is to define an own message using for example a V_VAR type and then pick this one up in Openhab.

    Good Luck!


  • Hero Member

    @mbj Could you please elaborate on how you allow a sensor/actuator to query OH for a V_VAR ? I know i need to do this for one of my devices when i move it from Vera, so any examples would be a terrific help!



  • @gregl I have used this procedure a few times:

    • Define for example a V_VAR1 message for the query (or use any other suitable message type depending on purpose),
    • Make a MQTT binding for this message i Openhab (for example bind it to a switch, a number or whatever fits the purpose)
    • Make a rule in Openhab that reacts on this incoming message ("When Item xxxxx received update then ......)
    • Fix whatever logic is needed in this rule so you can send the queried info back to the sensor. If no existing binding is suitable you can of course define a V_VAR2 message (or use other type which fits) for the return message.
    • In the "Incomingmessage" function use whatever logic is needed to decode the returned message.

    Reason for choosing a custom type of message (like a V_VAR2) for sending the info back is of course that it is easy to sort it out from the stream entering the incoming messages function. If you have no other incoming messages or the logic for the queried info already is in place then you do not have to think about this.

    Hope the explanation is understandable, if not please revert.



Suggested Topics

  • 4
  • 18
  • 5
  • 1
  • 3
  • 3
  • 3

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts