FlyingDiver / Indigo-ratgdo

Plugin for the Indigo Home Automation system to communicate with the ratgdo controller via MQTT
MIT License
0 stars 2 forks source link

ratgdo hardware 2.53i using software v2.57 is sending new 'motion' status msg which the indigo device doesn't know about #3

Open anitchalk opened 9 months ago

anitchalk commented 9 months ago

Currently, the Devices.xml for this plugin doesn't define the new 'motion' state that the ratgdo software is sending. This causes errors to hit the indigo log when the plugin tries to update an unknown device state:

Error device "GarageController" state key motion not defined (ignoring update request)

It would be nice if we could just ignore unknown states to get rid of the error msgs in the log.

FlyingDiver commented 9 months ago

So two things here - add motion as a valid state (for at least some firmware versions), and also prevent the error message from an unknown state.

FlyingDiver commented 9 months ago

Can you post an example of that new message? Topic and payload? Thx.

anitchalk commented 9 months ago

Ah, sure :-), I was just doing the bare minimum. So one thing I noticed from the debug logs is that quite a few motion events stream through as you move around the garage. So I think to do it correctly, the plugin should throttle the events locally instead of say updating once a second. Maybe instead the plugin only updates once ever say 20s (maybe even configure it). But!, as a bit of a newbie plugin developer, I'd need a bit of time to figure that out so I didn't have the time to do it right now.

Also, I meant to throw you a thank you on the dev forums for doing this after finishing this update so here you go. Thanks for writing this thing. I've been so annoyed by how closed off the myq system is (and how it seems that there have been pointed efforts to stymie home automation folks). So much appreciated that you brought it into the indigo ecosystem.

Here is a snippet from my log for the streaming events for motion with detailed debugging on:

2024-02-14 11:29:58.581 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer) 2024-02-14 11:29:58.582 Error device "GarageController" state key motion not defined (ignoring update request) 2024-02-14 11:29:58.583 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : clear (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : obstruction (string) version : 0 (integer) 2024-02-14 11:29:58.585 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : on (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : light (string) version : 0 (integer) 2024-02-14 11:29:58.587 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer) 2024-02-14 11:29:58.588 Error device "GarageController" state key motion not defined (ignoring update request) 2024-02-14 11:29:58.589 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer) 2024-02-14 11:29:58.589 Error device "GarageController" state key motion not defined (ignoring update request) 2024-02-14 11:29:58.591 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer) 2024-02-14 11:29:58.591 Error device "GarageController" state key motion not defined (ignoring update request) 2024-02-14 11:29:58.592 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer) 2024-02-14 11:29:58.593 Error device "GarageController" state key motion not defined (ignoring update request) 2024-02-14 11:29:58.594 ratgdo GDO Controller Debug processMessage: Data : (dict) message_type : ##ratgdo## (string) payload : detected (string) topic_parts : (list) Item : ratgdo (string) Item : ratgdo (string) Item : status (string) Item : motion (string) version : 0 (integer)

FlyingDiver commented 9 months ago

Ugh. It sends a motion detected MQTT message whenever it detects motion, but never sends any other motion payload. So it's pretty much worthless as a state value.

And, as you said, it sends a lot of them.

The plugin updates the states every message, it's not throttled or anything. Trying to do that would be really complicated.

I need to think on this a bit.

anitchalk commented 9 months ago

Yeah, exactly. It could be a state in the same way z-wave motion detectors do state. But those throttle themselves in hardware on the device. From a home automation perspective, I just keyed off the light being on or off which is basically the same thing as the z-wave devices (just slightly longer window).

Another thing I was thinking was if the plugin did something like the Cynical Security Spy plugin does with motion. It actually sends out events that one can trigger on, but you have the same problem with throttling. Really it is basically the same issue.

FlyingDiver commented 9 months ago

Yeah, I might make that an event, then it's easy to do your own throttling in the trigger.