I noticed that the TRADFRI motion detector (E1745), fires Update events if it detects motion, during the 3min cooldown period. The cool-down for the update events is about 97s. I like to use this behaviour to restart a timer (let’s say duration 2 mins), which is used to switch off the light after it finishes. The automation is mostly clear to me. I am only struggling to build a trigger which fires with any “Attribute Updated event”. I cannot figure out from the logs which attribute is updated. So far I tried.
platform: state
entity_id:
- binary_sensor.ikea_of_sweden_tradfri_motion_sensor_motion
id: Motion
enabled: true
I guess not working, as no values is updated
This is an alternative idea, which I don’t know how to complete
platform: event
event_type: ???? WHAT HERE FOR UPDATE EVENT ????
event_data:
entity_id: binary_sensor.ikea_of_sweden_tradfri_motion_sensor_motion
I am trying to run my HASS on minimal code. So, using standard HASS functions or templates without any additional python code or plugins would be great.
I am sorry I forgot the actual logbook output. The following can occur, it there is motion at least 97s after the 3mins cool down period started:
IKEA of Sweden TRADFRI motion sensorAttribute Updated event was fired
11:39:54 - 2 hours ago
IKEA of Sweden TRADFRI motion sensor On With Timed Off event was fired with parameters: {'on_off_control': 0, 'on_time': 1800, 'off_wait_time': 0}
11:39:54 - 2 hours ago
IKEA of Sweden TRADFRI motion sensor Motion detected
11:37:21 - 2 hours ago
After several years of writing complex state machines tracking MOTION and NO_MOTION in openHAB working around unreliable retriggering with Fibaro Z-Wave PIRs with multiple timers, I found the simplest solution is the default in HASS - reverse the logic.
MOTION turns ON.
NO_MOTION for a time turns OFF.
That way, the re-triggerable timer is built-into HASS and needs no logic.
Yes - know what you mean. The ability to sense presence as well as motion is really interesting.
Reid’s YT video showing one mmW sensor triggering on specific zones in a large room is quite impressive.
mmW might mean I’m going to have to fill in the holes in the living room door frames eventually - door reed switches are the current workaround to sense presence that the PIRs can’t.
I switch to timer based state machines, as I can simulate presence using the same timer. I also prefer to see what’s going on in a room regarding counting down no motion timer, easy to debug.
Anyway, I though, as people complaining about the long cool down of the Ikea motion sensor, it would be a good idea to make this hack work and bringing the switch off time down to approximately 100s, without trying to hack the firmware.
Any of you have an idea how to use one of the events below as a trigger?
IKEA of Sweden TRADFRI motion sensorAttribute Updated event was fired
IKEA of Sweden TRADFRI motion sensor On With Timed Off event was fired with parameters: {'on_off_control': 0, 'on_time': 1800, 'off_wait_time': 0}
I don’t use ZHA, but in MQTT Explorer you can see they keep firing events as long as there is motion. Only after they see no motion for 3 minutes the send the ‘No motion’ event.
They come with intervals sometimes as short as 46 seconds, but most of the times every 48 seconds.
It therefore seems that the actual blind time of these sensors is 46 seconds.
At the end of the 46 seconds:
the sensor doesn’t send anything if there was recent motion during that interval.
it just starts reporting new motion when it occurs