great, so that’s working. Interested to hear if that solved your issue
I meant that when I updated I changed those so they have been correct all the time.
I just tested quickly the motion sensor. When there is light the sensors attributes are “dark: true” and “lx: 11.02” and when I cover the sensor those are “dark: true” and “lx: 1”.
So at least the dark part is not working. lx is changing but it does not really change when in bathroom since apparently the light is not so bright.
about the dark attribute: lx=11 means it is still dark…
have a look:
dark wouldn’t be my first choice of trigger for that reason. If anything, use the light level which has the largest range to work with.
for refercence this is the scale Hue uses:
Philips Hue definition Lux MeasuredValue
Overcast moonless night sky 0.0001 0
Outdoor: Bright moonlight 1 1
Home: Night light 2 3000
Home: Dimmed light 10 10000
Home: ‘Cosy’ living room 50 17000
Home: ‘Normal’ non-task light 150 22000
Home: Working / reading 350 25500
Home: Inside daylight 700 28500
Home: Maximum to avoid glare 2000 33000
Outdoor: Clear daylight > 10000 > 40000
Outdoor: direct sunlight 120000 51000
made that into a template for my sensors:
attic_motion_sensor_lux:
friendly_name_template: >
Attic:
{% set lux = state_attr('binary_sensor.attic_motion_sensor','lx') %}
{% if lux <=1 %}
moonlight
{% elif lux <=2 %}
night light
{% elif lux <= 10 %}
dimmed light
{% elif lux <= 50 %}
'cosy' living room
{% elif lux <= 150 %}
'normal' non-task light
{% elif lux <= 350 %}
working / reading
{% elif lux <= 700 %}
inside daylight
{% elif lux <= 2000 %}
maximum to avoid glare
{% elif lux <= 10000 %}
clear daylight
{% elif lux <= 120000 %}
direct sunlight
{% else %}
too bright!
{% endif %}
value_template: >
{{state_attr('binary_sensor.attic_motion_sensor','lx')}}
and
attic_motion_sensor_light_level:
friendly_name_template: >
Attic:
{% set light_level = state_attr('binary_sensor.attic_motion_sensor','light_level') %}
{% if light_level <=1 %}
bright moonlight
{% elif light_level <=3000 %}
night light
{% elif light_level <= 10000 %}
dimmed light
{% elif light_level <= 17000 %}
'cosy' living room
{% elif light_level <= 22000 %}
'normal' non-task light
{% elif light_level <= 25500 %}
working / reading
{% elif light_level <= 28500 %}
inside daylight
{% elif light_level <= 33000 %}
maximum to avoid glare
{% elif lux <= 40000 %}
clear daylight
{% elif light_level <= 51000 %}
direct sunlight
{% else %}
too bright!
{% endif %}
value_template: >
{{state_attr('binary_sensor.attic_motion_sensor','light_level')}}
device_class: illuminance
can you at least confirm the motion sensor is working as it should?
I am not using or going to use the dark or lx values, just saying that they seemed like not changing. And the dark value is not, tested it outside. Sorry for the confusion.
But thanks for those values, they will be useful in other usages!
Still trying to find the reason why the light sometimes goes of even when there is motion.
I downgraded to 0.84 my HA and the problem still persists. Next step is to downgrade the Hue CC since I am now using the newest.
It is just hard to find the reason since the problem is not happening all the time and there is nothing on the logs.
Haven’t had any problems when downgraded to HA 0.86.4 and to Hue CC 1.0.2. In that CC version the motion sensor is still in “sensor.py”. Maybe the binary_sensor motion sensor has some different functionality?
Next step is to update to newest HA and see if there is problem persistence.