Cereal2nd / velbus-aio

Velbus Asyncio
Apache License 2.0
15 stars 10 forks source link

VMBPIRC light sensor value 0 #39

Closed darkpainy closed 2 years ago

darkpainy commented 2 years ago

Hi,

I noticed that the light sensor value of the VMBPIRC allways remains at 0 in HA. On the VMBPIRO (outdoor sensor) this value is updated correctly.

Kind regards, Jeroen

Cereal2nd commented 2 years ago

can we plan a debug session? i do not own this module so i can test this locally (same for #41)

darkpainy commented 2 years ago

Yes, we can. Let me know when you are available

Verstuurd vanaf mijn iPhone

Op 6 jun. 2022 om 13:04 heeft Maikel Punie @.***> het volgende geschreven:

 can we plan a debug session? i do not own this module so i can test this locally

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

Cereal2nd commented 2 years ago

with the debug info i gave you on the hass forum, can you identfy if the module sends a pirstatusmessage every time it changes or every x seconds?

darkpainy commented 2 years ago

I think there is a misunderstanding, the "pirstatusmessage" i posted on the hass forum is only send by the "VMBPIRO (outdoor motion sensor). the VMBPIRC (indoor motion sensor) for this bug here does not send the same message type, but usses a ModuleStatusMessage for the light value.

these are all the messages I'm getting for the VMBPIRC (indoor motion sensor):

when I open up the PIRC motion sensor configuration in VelbusLink, the VelbusLink software actively polls the module for light values: 2022-06-08 14:02:17 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=170, data=b'aa 05') 2022-06-08 14:02:17 DEBUG (MainThread) [velbus-packet] Received {"name": "LightValueRequest", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:17 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 6b 04 00 d5 05') 2022-06-08 14:02:17 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:21 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=170, data=b'aa 05') 2022-06-08 14:02:21 DEBUG (MainThread) [velbus-packet] Received {"name": "LightValueRequest", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:21 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 6b 04 00 d5 05') 2022-06-08 14:02:21 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:23 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=170, data=b'aa 05') 2022-06-08 14:02:23 DEBUG (MainThread) [velbus-packet] Received {"name": "LightValueRequest", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:23 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 6b 04 00 d5 05') 2022-06-08 14:02:23 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:26 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=170, data=b'aa 05') 2022-06-08 14:02:26 DEBUG (MainThread) [velbus-packet] Received {"name": "LightValueRequest", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:02:26 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 6b 04 00 d5 05') 2022-06-08 14:02:26 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false}

whenever light value changes the module auto announces its light value "modulestatusmessage" command 237 But, when the light value changes it also seems to toggle a led status, but I don't know what that does or why it happens. (command 245 or 246 depending on Clear or Set led status) below i toggled the lights in my attic, first off, then back on. resulting in a 2x light value update: ModuleStatusMessage, and 2x Led status update, once clear for when i turned off the lights and once set for when i turned the lights back on. Probably it has something to do with the overwrite setting i have on the motionsensor for the light in that room, when it is turned on manually the sensor cannot turn it back off... (just a guess) 2022-06-08 14:04:53 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=245, data=b'f5 04') 2022-06-08 14:04:53 DEBUG (MainThread) [velbus-packet] Received {"name": "ClearLedMessage", "priority": 251, "address": "21", "rtr": false, "leds_off": [3]} 2022-06-08 14:04:56 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 91 04 00 d5 05') 2022-06-08 14:04:56 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:05:35 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=246, data=b'f6 04') 2022-06-08 14:05:35 DEBUG (MainThread) [velbus-packet] Received {"name": "SetLedMessage", "priority": 251, "address": "21", "rtr": false, "leds_on": [3]} 2022-06-08 14:05:36 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 82 04 00 d5 05') 2022-06-08 14:05:36 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false} 2022-06-08 14:05:40 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=237, data=b'ed 01 02 6a 04 00 d5 05') 2022-06-08 14:05:40 DEBUG (MainThread) [velbus-packet] Received {"name": "ModuleStatusMessage", "priority": 251, "address": "21", "rtr": false}

When motion occurs: here, the pushbuttonstatus message is set, for in this case 2 of the motion sensors (Motion1(LD) and Motion2) the Motion1 sensor is currently locked and the motion2(LD) has a high light value (darker) in order to be triggered. Here again is also see at the same time the SetLedMessage popping up. 2022-06-08 14:11:02 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=f8, address=21, rtr=False, command=0, data=b'00 18 00 00') 2022-06-08 14:11:02 DEBUG (MainThread) [velbus-packet] Received {"name": "PushButtonStatusMessage", "priority": 248, "address": "21", "rtr": false, "closed_channels": [4, 5], "opened_channels": [], "closed_long_channels": []} 2022-06-08 14:11:02 DEBUG (MainThread) [velbus-protocol] RX: RawMessage(priority=fb, address=21, rtr=False, command=246, data=b'f6 10') 2022-06-08 14:11:02 DEBUG (MainThread) [velbus-packet] Received {"name": "SetLedMessage", "priority": 251, "address": "21", "rtr": false, "leds_on": [5]}

Right now, in my HA for some reason, even though the debug messages are comming instantly for the "ButtonPushStatusMessage" the sensor does not update. The strangest thing is that the HA sensor does show some history, so it seems it is just missing most of the status updates but not all... The light value in HA is never updated and remains on 0.

Picture of light value setting on the VMBPIRC, it is set to send when it changes: image

Cereal2nd commented 2 years ago

the pushButtongstatus message will only trigegr a channel change, so it will give you the motion updates. This i fixed yesterday, so the motion updates should be ok with the dev version of velbusaio.

the light value seems to be a problem that velbusaio does not see the message as a pirstatusmessage but as a normal modulestatus message. thanks for debugging.

Cereal2nd commented 2 years ago

https://github.com/Cereal2nd/velbus-aio/commit/477ed624445320200a2a29594239392df32feb5b

darkpainy commented 2 years ago

Great! can you also explain why it did update sometimes, with delay or at random? was that from a different message that is send periodically or something?

Cereal2nd commented 2 years ago

no idea why this would happen sometimes and sometimes not

darkpainy commented 2 years ago

Champion!

updated the code in the HA docker and can confirm that motion triggers correctly now ! And as cherry on top of the cake, light value is now working.

Thanks man, you are amazing! image

Cereal2nd commented 2 years ago

the same thing should wrk for the iro sensors