Help on automation with Aqara FP2 & Hue

Hello,

I have a brand new Aqara FP2 and I’m looking to create an automation with Hue lights:

Trigger: Someone is in the room
Condition: Light is off AND Level of illuminance is between 10 and 20
Action: turn on the light at 30%

the illuminance is at 17lx → nothing is happening.

1- is my logic is good between Trigger vs Condition ( as I can do the reverse I guess)?
2- Are the Triggers are evaluated when you activate the evaluation?
3- if I want to have light % increase as the illuminance decrease there is no other way than to do multiple rules?

alias: Bureau FP2 sensor 2 turn on light 30%
description: ""
trigger:
  - type: occupied
    platform: device
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: binary_sensor.presence_sensor_fp2_4bcc_presence_sensor_2
    domain: binary_sensor
condition:
  - condition: device
    type: is_off
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: light.hue_color_lamp_1
    domain: light
  - type: is_illuminance
    condition: device
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: sensor.presence_sensor_fp2_4bcc_light_sensor_light_level
    domain: sensor
    below: 20
    above: 10
action:
  - type: turn_on
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: light.hue_color_lamp_1
    domain: light
    brightness_pct: 30
  - type: turn_on
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: light.hue_color_lamp_2
    domain: light
    brightness_pct: 30
mode: single

Your logic seems good and it should work, can you provide the output of the sensor:

sensor.presence_sensor_fp2_4bcc_light_sensor_light_level

Also click on the test condition on the automation page to see which condition is not passing.

This is how I’d do this (using entities, not devices):

alias: Bureau FP2 sensor 2 turn on light 30%
trigger:
  - platform: state
    entity_id: binary_sensor.presence_sensor_fp2_4bcc_presence_sensor_2
    to: 'on'
condition:
  - condition: state
    entity_id: light.hue_color_lamp_1
    state: 'off'
  - condition: numeric_state
    entity_id: sensor.presence_sensor_fp2_4bcc_light_sensor_light_level
    below: 20
    above: 10
action:
  - service: light.turn_on
    data:
      entity_id: light.hue_color_lamp_1
      brightness_pct: 30
  - service: light.turn_on
    data:
      entity_id: light.hue_color_lamp_2
      brightness_pct: 30
mode: single
initial_state: true #perhaps this is what you miss in your config and automation is disabled and doe not run?

For this point indeed I’d use state change of illumination as trigger and then use motion sensor and light level as conditions. It still could be done in single autonation using choose: in action or templating brightness against based on illumination level. Things would get more complex only if you expect that there will be permanent presence (e.g motions sensor syats triggered) and would like to have light brightness adjusted to illuminance reading. This would require addiditional automation.

it’s my office and I do home office … so I’m spendings hours there on the front of the computer.

my issue is the Lx increase as sound one light turn on … so it’s not easy to regulate it.

Well, in general using same sensor for measuring the light level and turning on/off light is bad idea, indeed. Can you use any external light sensor for this? I’d assume that light level (with lights turned off) in your office would be proportional to external light level… more-less.

I have a similar problem and don’t know exactly how to best solve it.

If someone is present in the living area and the light intensity falls below 10 lux, the lamps should be switched on. What is the best way to do this? If I use the light intensity as a trigger and the presence as a condition, it doesn’t work if the light intensity is already below 10 lux. Can someone give me a tip on how to do this?