Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySensors Entities are not properly set when activating scenes #59388

Closed
anp369 opened this issue Nov 8, 2021 · 9 comments
Closed

MySensors Entities are not properly set when activating scenes #59388

anp369 opened this issue Nov 8, 2021 · 9 comments

Comments

@anp369
Copy link

anp369 commented Nov 8, 2021

The problem

I have a setup with multiple mySensors lights. Some of them are single channel dimmers, some of them are RGBW dimmers. If I set the values for those lights by hand the function like expected. Once I use them in a scene, at most one of the lights gets set as in defined in the scene. Sometimes even none o them reacts. When using a script to set the values one after another that works flawlessly if I put a delay of around 400 ms between each action.

I'm using MySensors 2.3.2 and Homeassistant connects via serial to the gateway. It's an Arduino Nano with it's serial port exposed via USB running at 115200 baud. The light nodes have the software signing component of mysensors enabled.
The sketch I wrote for this works perfectly when setting single values so I suspect something in the communication between HA and the gateway is messed up. There are a lot of RC=1 messages in the logs which hint, that the gateway is stuck in some kind of loop.

I could provide more sketches and logs if required.

Do you guys have any hints what I could try? I also searched the other issues and forums (HA aswell as the mysensors forums) but I couldn't find anything useful.

What version of Home Assistant Core has the issue?

2021.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

MySensors

Link to integration documentation on our website

https://www.home-assistant.io/integrations/light.mysensors/

Example YAML snippet

# this is one of the scenes I'm trying to activate
# It enables two mysensors nodes and one tasmota device
# the tasmota device works as expected
name: Light bright
  entities:
    light.rgbw01_0:
      supported_color_modes:
      - rgbw
      color_mode: rgbw
      brightness: 209
      hs_color:
      - 60
      - 36.078
      rgb_color:
      - 255
      - 255
      - 163
      rgbw_color:
      - 255
      - 255
      - 96
      - 184
      xy_color:
      - 0.385
      - 0.425
      battery_level: 0
      heartbeat: 0
      child_id: 0
      description: RGBW01
      node_id: 6
      V_STATUS: 'on'
      V_RGBW: ffff60b8
      V_PERCENTAGE: 82
      device: /dev/ttyUSB0
      friendly_name: RGBW01
      supported_features: 0
      state: 'on'
   light.rgbw02_0:
      supported_color_modes:
      - rgbw
      color_mode: rgbw
      brightness: 227
      hs_color:
      - 60
      - 54.51
      rgb_color:
      - 255
      - 255
      - 116
      rgbw_color:
      - 255
      - 255
      - 0
      - 214
      xy_color:
      - 0.413
      - 0.468
      battery_level: 0
      heartbeat: 0
      child_id: 0
      description: RGBW02
      node_id: 7
      V_STATUS: 'on'
      V_RGBW: ffff00d6
      V_PERCENTAGE: 89
      device: /dev/ttyUSB0
      friendly_name: RGBW02
      supported_features: 0
      state: 'on'
    switch.tasmota:
      friendly_name: Socket 01
      state: 'on'

Anything in the logs that might be useful for us?

2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Sending 6;0;1;1;41;ffff60b8                                                                                                                           
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Sending 7;0;1;1;2;1                                                                                                                                   
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Sending 7;0;1;1;3;89
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Sending 7;0;1;1;41;ffff00d6
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736274 TSF:MSG:SEND,0-0-6-6,s=0,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK:
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736274 TSF:MSG:SEND,0-0-6-6,s=0,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK:
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736282 !MCO:PRO:RC=1
2021-11-08 18:56:31 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736282 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736321 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736321 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736328 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736328 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736332 TSF:MSG:READ,6-6-0,s=255,c=3,t=17,pt=6,l=25,sg=0:<NONCE>
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736332 TSF:MSG:READ,6-6-0,s=255,c=3,t=17,pt=6,l=25,sg=0:<NONCE>
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736339 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736339 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736378 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736378 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736385 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736385 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736389 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736389 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736428 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736428 !TSF:MSG:SEND,0-0-7-7,s=0,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736435 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736435 !TSF:MSG:SIGN FAIL
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736439 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107736439 !MCO:PRO:RC=1
2021-11-08 18:56:32 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107736442 !MCO:PRO:RC=1

...
2021-11-08 18:56:36 DEBUG (MainThread) [mysensors.transport] Receiving 0;255;3;0;9;1107741282 !TSF:MSG:SIGN FAIL                                                                                                  
2021-11-08 18:56:36 DEBUG (MainThread) [mysensors.handler] n:0 c:255 t:3 s:9 p:1107741282 !TSF:MSG:SIGN FAIL

Additional information

MySensors Software Signing is enabled. It sometimes causes Errors as seen in the logs but only when setting scenes. The errors don't appear in manual operation.

@probot-home-assistant
Copy link

mysensors documentation
mysensors source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @MartinHjelmare, @functionpointer, mind taking a look at this issue as it has been labeled with an integration (mysensors) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@MartinHjelmare
Copy link
Member

There's nothing the integration can do about NACKs. If the communication between the gateway and device fails, it's a problem with the gateway or device. The integration only handles the communication between the gateway and Home Assistant.

@MartinHjelmare
Copy link
Member

Regarding your scene it seems to include attributes that are not relevant for setting the light in the correct mode. I'd advice to only include the attributes that are relevant to adjust the light setting, like color, brightness etc, ie not child_id, heartbeat etc. Check the light turn on service for relevant parameters.

@anp369
Copy link
Author

anp369 commented Nov 9, 2021

hey Martin, thanks for your reply.

Regarding your scene it seems to include attributes that are not relevant for setting the light in the correct mode. I'd advice to only include the attributes that are relevant to adjust the light setting, like color, brightness etc, ie not child_id, heartbeat etc. Check the light turn on service for relevant parameters.

I configured the scene using the gui scene editor, so I didn't choose which values are stored and which not.
Is this a thing that is handled by the integration? I try to setup some manual ones later

There's nothing the integration can do about NACKs. If the communication between the gateway and device fails, it's a problem with the gateway or device. The integration only handles the communication between the gateway and Home Assistant.

I was thinking that it might be a timing issue, since when sending single values everything works as expected and HA is sending out updates too fast to the gateway?

@MartinHjelmare
Copy link
Member

Gateways that don't have adequate clean power supply may experience problems with frequent messages.

@anp369
Copy link
Author

anp369 commented Nov 10, 2021

I'll try with another power supply, but I doubt that that is a problem in my case. I have enough buffering caps in place and the power the USB port provides should be sufficient

@anp369
Copy link
Author

anp369 commented Nov 10, 2021

I just tried it with my big lab PSU. This doesn't save the problem unfortunately

@anp369
Copy link
Author

anp369 commented Nov 30, 2021

After some writing with the mysensors devs it seems that it is a problem on their side, but they don't have time to fix it unfortunately

@anp369 anp369 closed this as completed Nov 30, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants