I use Ikea Tradfri motion sensors. They’re great, except that when the battery gets very low on them (<30%) they tend to randomly fire motion events even when there isn’t any motion!
I have an automation which detects low battery level on these and alerts me via a message, which is great, but really I’d like to set the sensor to some kind of “disabled” state so that it doesn’t trigger my alarm script.
The sensors are connected via deconz, not sure if that helps or gives other options.
So on this I came up with an idea, but I’m struggling to get it to work.
My idea is to create a binary template sensor which checks for movement AND if the battery is at a good level. This is what I have so far:
Blockquote
binary_sensor:
platform: template
sensors:
hallway_motion_alarm:
friendly_name: “Hallway Alarm Motion”
value_template: >-
{is_state(‘binary_sensor.motion_sensor__hallway’, ‘on’)
and is_state_attr(‘binary_sensor.motion_sensor__hallway’, ‘battery_level’|float > 40)}
on
{else}
off
{endif}
Blockquote
But it doesn’t work.
The reason I’m trying to do this with a template sensor rather than conditional automations is because I’d like to re-use an existing alarm script which someone else has written - in any case it would be really useful to be able to do this for other uses!
Hi,
Just a thought: how do you handle the “motion detected” event? Do you have an automation for it? If so, can you add condition into the automation to check battery % >30 (not sure if there is a condition_template though, not an expert yet:(( )