Hi,
I’ve a group of lights to light up plants with a specific color. The scene is called in a Hue bridge. For other automations I need to know if this scene is ON. So I implemented a helper: input.boolean.hue_scene.Plantlight.
I thought, that I can set this helper to ON, when I get the state of the Hue scene. But sadly the Hue bridge doesn’t send the status of any scene.
How can a automation in home assistant recognize if this scene is called from a hue bridge?
I can’t code in Jinja2 at this moment. I found this code, that doesn’t work. The helper have to set ON when all lights of the group are ON and have a brightness of 255 and a xy-color (0.1896, 0.0652).
{% set plant_lights = expand('light.wohnzimmer_pflanzen') %}
{% set all_correct = true %}
{% for light in plant_lights %}
{% if not (
is_state(light.entity_id, 'on') and
light.attributes.xy_color[0] == 0.1896 and
light.attributes.xy_color[1] == 0.0652
) %}
{% set all_correct = false %}
{% endif %}
{% endfor %}
{{ all_correct }}
Can someone help me?