openhab binding mysensors



  • I have a problem with lost message when openhab change two relay at the same time.
    The relay are on the same node (arduino Pro Mini with nRF24L01+) and openhab is connect via WiFi Gateway using ESP32.
    I am investigate to see if the problem is a buffer messages because the node receive multiple message (for the same child/relay).
    In effect seem that mysensors binding on openhab duble the message:

    2021-03-14 18:57:02.898 [ome.event.ItemCommandEvent] - Item 'LuceEsternaAia_Status' received command OFF
    
    2021-03-14 18:57:02.903 [nt.ItemStatePredictedEvent] - LuceEsternaAia_Status predicted to become OFF
    
    ==> /var/log/openhab2/openhab.log <==
    
    2021-03-14 18:57:02.954 [DEBUG] [ensors.handler.MySensorsThingHandler] - Adapter: class org.openhab.binding.mysensors.converter.MySensorsOnOffTypeConverter loaded
    
    2021-03-14 18:57:02.965 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 3 found in gateway
    
    2021-03-14 18:57:02.969 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 3 found in node 3
    
    2021-03-14 18:57:02.974 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 3;3;1;1;2;0
    
    ==> /var/log/openhab2/events.log <==
    
    2021-03-14 18:57:03.027 [vent.ItemStateChangedEvent] - LuceEsternaAia_Status changed from ON to OFF
    
    ==> /var/log/openhab2/openhab.log <==
    
    2021-03-14 18:57:03.081 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 3;3;1;1;2;0
    
    2021-03-14 18:57:03.140 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 3;3;1;1;2;0
    
    2021-03-14 18:57:03.146 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 3 found in gateway
    
    2021-03-14 18:57:03.149 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 3 found in node 3
    
    2021-03-14 18:57:03.151 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: status(V_STATUS) value to: OFF
    
    2021-03-14 18:57:03.159 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 3/3 to 2021-03-14T18:57:03.000+0100
    
    2021-03-14 18:57:03.172 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 3;3;1;1;2;0
    
    2021-03-14 18:57:03.174 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 3 found in gateway
    
    2021-03-14 18:57:03.176 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 3 found in node 3
    
    2021-03-14 18:57:03.179 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: status(V_STATUS) value to: OFF
    
    2021-03-14 18:57:03.184 [INFO ] [rsAbstractConnection$MySensorsWriter] - ACK received for message: 3;3;1;1;2;0
    
    2021-03-14 18:57:03.187 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 3/3 to 2021-03-14T18:57:03.000+0100
    

    It's correct ?
    If yes, on the node I can use:

    #define MY_RX_MESSAGE_BUFFER_FEATURE
    #define MY_RX_MESSAGE_BUFFER_SIZE (6)
    

    but on ESP32 gateway what I can do?

    Thanks in advance for the help.

    Massimo



  • @MDS I looked into this a bit after seeing the same double message in the log. You have ACK setup for these nodes? In the mysensors binding code, it looks like the bridge sends a message then waits for an ACK, and resends if it doesn't get the ACK within a specific amount of time. Unfortunately, it looks like it waits 0ms for the first ACK (doesn't wait) and automatically retransmits = guaranteed duplicate sent. It hasn't really caused any problems for me.

    As for the dropped messages, do you have a delay set up on your bridge config [sendDelay=200]? 1416af8a-28bf-42e8-8c20-9718545523c3-image.png

    Can you post your arduino code?



  • @ncollins Great! Seem the problem is the delay. With 1 ms or 100 ms I have double message, but with 200 ms I only one message. Thanks a lot.


Log in to reply
 

Suggested Topics

  • 22
  • 1
  • 135
  • 2
  • 10
  • 132

66
Online

11.4k
Users

11.1k
Topics

112.7k
Posts