Hi @Blacky ,
I am using aquara motion sensors connected to home assistant through the zigbee2MQTT integration (aquaria motion sensor p1 @ zigbee2mqtt). The illuminance is only published when occupancy toggles. But, that is ok for me. Anyway, once the lights are on, I cannot use the LUX value, as the lights will determine the illuminance. This is why I use the âYES - My Ambient Light Sensor is affected by the Lightsâ option in the blueprint, and would expect the LUX is not used when the lights are already on.
Here is my solution, maybe it helps others who have a similar setup. It requires, the âvirtual componentsâ integration from HACS
1.) create virtual motion sensors in configuration.yaml, then register these sensors on your blueprint
binary_sensor:
- platform: virtual
name: 'Flur_Motion'
initial_value: 'off'
class: motion
sensor:
- platform: virtual
name: "Flur_Illuminance"
class: illuminance
initial_value: 20
unit_of_measurement: lx
2.) Create an automation on the real motion detector and feed forward the values:
alias: Flur_Motion_Upstairs_ON
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.aquara_motion_detector_occupancy
to: "on"
condition: []
action:
- service: virtual.set
data_template:
entity_id: sensor.virtual_flur_illuminance
value: "{{states('sensor.aquara_motion_detector_illuminance_lux')}}"
- service: virtual.turn_on
data:
entity_id: binary_sensor.virtual_flur_motion
mode: single
Then create similar automations for the 2nd motion sensor and create similar automations that clear the virtual occupancy sensor (maybe with a condition to only clear if both real sensors are âclearâ).
I am waiting for my second sensor to arrive so that I can actually test this with 2 sensors , but I feel very comfortable that it will work.
Anyway, I am very fresh into this HA motion topic and so happy I could find the template that solves most of my problems. Thx again.
Btw, I do also have a Hue Motion sensor which is connected to a Hue-hub, which I can monitor in HA through the Hue integration. Illuminance & temperature is reported by this sensor every 5 minutes.