I use homematic motion sensors and appdaemon to control my light per one of this motion sensors.
The main issue I have is, that only the first motion trigger is provided (“True”) to home-assistant - if there are several motion events before “False” is communicated, then these events seem to be suppressed. Specially in my case this is not very useful, because with another motion event I would reset my light timer.
In my homematic web-frontend all motion events are listed - so the events are recognized by the system and only home-assistant seem to suppress these events.
I walked through the code of file “homematic.py” and found in the function “_hm_event_callback” some code that suppress events if the data stays the same, but also a remove of this check seems not to work.
The problem is that HomeMatic motion sensors (at least the ones that I know) don’t work by pushing events. Instead they set the entity to true for a configurable amount of time. This can be set up in the CCU where it says “Wahl des Sendeabstandes”.
The reason why the state-update is filtered is that the state doesn’t really change. If motion is detected while the state is true, setting it to true again is redundant and would restart automations. Even though that is what you want in your case, this usually is not wanted by the other devices that work with such states.
The proper way to use these sensors is to simply automate with the state. With the default settings my motion detector stays true for 5 minutes without any further motion. When new motion is detected, it stays true for 5 another minutes. Hence I just say: turn the light on when the sensor is true, and turn it back off again when it is false.
If you want shorter intervalls, then you can reconfigure the sensor to use the dynamic Sendeabstand.
So essentially: this is by design. I’m almost sure your automation can be done without manually resetting timers. Would you mind providing some details so I (or anybody else) could assist?
Hello - first sorry for my late reply - I was on a business trip and couldn’t find time to check on this issue before.
I configured my CCU and motion sensor that the sensor send at least every 15sec a trigger in case of a motion event. Reaons for this is that I use the same sensor also for my alarm system and I will send me a message (telegram) at every event - so you can easily see if this was only one event (maybe also wrong alarm) or if there is contious motion. I have several motion sensors - so I can easily see also the motion profile in case of an alarm. Due to the case that my previouse system (node-red) worked in that way I tried to implement in the same way.
In the meantime I updated the appdameon scritp based on your info for my light and it works fine, but the multiple message trigger in case of an alarm still doesn’t work - any idea how I can solve that?
As stated before, HomeMatic motion sensors don’t push events. At least not via XML-RPC API, which is what we use for the HomeMatic integration. Wen can’t do more than the API allows us to do.
I have explained the part why it is done this way above.
However, you said you had a look at the code. Having a quick look at it actually the only thing you would need to do is to change False to True here: https://github.com/home-assistant/home-assistant/blob/59e943b3c1f2571abac4db0fb49a1bcee744c029/homeassistant/components/homematic.py#L762
That way everything that happens with the device would trigger an update of the Home Assistant entity. So in your case if you would open the entity-card, with every motion it should update to updated 0 seconds ago or something like that.
Thanks for your efforts - this I already tried and will not solve the issue - that was the reason to start this forum entry, because beside changing the homematic code I don’t know how all the rest works together.
It seems that this is implemented at low level at the motion and data handling itself. The only thing I wondering is that at appdaemon the feature is documented to get every value update reported doesn’t work …