Lights on after gateway reboot



  • I have made myself a new standalone mqtt gateway (before I was only using RPi gateways). Now I see strange behavior with 2 of 3 light nodes I have.
    After gateway boots, it sends discovery requests:

    1296965 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
    1296973 TSF:MSG:BC
    1297567 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
    1299177 TSF:MSG:READ,0-0-255,s=43,c=3,t=4,pt=0,l=1,sg=0:1
    1299183 TSF:MSG:BC
    1299316 TSF:MSG:READ,0-0-255,s=63,c=3,t=4,pt=0,l=1,sg=0:2
    1299322 TSF:MSG:BC
    1299456 TSF:MSG:READ,0-0-255,s=16,c=3,t=4,pt=0,l=1,sg=0:3
    1299462 TSF:MSG:BC
    1299595 TSF:MSG:READ,0-0-255,s=30,c=3,t=4,pt=0,l=1,sg=0:4
    1299601 TSF:MSG:BC
    1299736 TSF:MSG:READ,0-0-255,s=239,c=3,t=4,pt=0,l=1,sg=0:5
    1299742 TSF:MSG:BC
    1299877 TSF:MSG:READ,0-0-255,s=192,c=3,t=4,pt=0,l=1,sg=0:6
    1299884 TSF:MSG:BC
    1300019 TSF:MSG:READ,0-0-255,s=145,c=3,t=4,pt=0,l=1,sg=0:7
    1300025 TSF:MSG:BC
    1300301 TSF:MSG:READ,0-0-255,s=112,c=3,t=4,pt=0,l=1,sg=0:9
    1300307 TSF:MSG:BC
    1300441 TSF:MSG:READ,0-0-255,s=18,c=3,t=4,pt=0,l=2,sg=0:10
    1300447 TSF:MSG:BC
    1305182 TSF:MSG:READ,0-0-3,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    1305313 TSF:MSG:READ,0-0-3,s=0,c=1,t=2,pt=0,l=1,sg=0:0
    1305319 TSF:MSG:ECHO REQ
    

    After this my nodes for some reason send current states:

    1305323 TSF:MSG:SEND,3-3-0-0,s=0,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:0
    1305333 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=3,pt=1,l=1,sg=0,ft=0,st=OK:21
    1305344 TSF:MSG:SEND,3-3-0-0,s=2,c=1,t=3,pt=1,l=1,sg=0,ft=0,st=OK:100
    1305401 TSF:MSG:SEND,3-3-0-0,s=1,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:0
    1305446 !TSF:MSG:SEND,3-3-0-0,s=2,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=NACK:0
    

    And after that they recieve it back from gateway, and act as if it was a command to change their state.

    Gateway is 2.4 alpha, all 3 nodes are 2.3.2, and only two of them acts like this. I guess I am missing something, but can't grasp what exactly.

    Any ideas?



  • Switching the gateway to 2.3.2 haven't change anything, as expected.



  • I figured this out. After discovery, gateway sends states found in HA (or MQTT I'm not sure). It sends first - state, second - level. My code was turning light state on on every level change greater than 0, so because the state is sent first and the level second, my nodes got confused and turned lights on.
    The question is why this behavior is different from TCP gateway I used before.
    It was pretty dumb problem, but at least there is now this thread for someone who might have same problem in the future 🙂



  • Could it be the MQTT message is retained? You can use a tool like MQTT explorer to see this



  • @electrik I am using MQTT explorer, but I don't see where is an option to see if message that was sent is retained. There is only box "retain" for a message to be sent from the program.



  • If the message is retained, it will show up already when you connect MQTT explorer to the broker, without HA sending a message yet


Log in to reply
 

Suggested Topics

52
Online

11.4k
Users

11.1k
Topics

112.6k
Posts