claytonjn / hass-circadian_lighting

Circadian Lighting custom component for Home Assistant
Apache License 2.0
756 stars 89 forks source link

Does this work on `service: scene.` ? #235

Open Gil80 opened 10 months ago

Gil80 commented 10 months ago

Does this work on scenes too?

This is what I have:

action:
  - choose:
        - conditions:
               - condition: template
                  value_template: "{{ trigger.to_state.state == 'on' }}"
          sequence:
              - service: scene.turn_on
                 target:
                    entity_id: scene.evning_light_color
                 metadata: {}

Will this work if I set it up like this?

action:
  - choose:
        - conditions:
               - condition: template
                  value_template: "{{ trigger.to_state.state == 'on' }}"
          sequence:
              - service: scene.turn_on
                 target:
                    entity_id: scene.evning_light_color
                    data_template:
                    entity_id: light.entity
                    kelvin: "{{ state_attr('sensor.circadian_values', 'colortemp') | int }}"
                   brightness_pct: "{{ state_attr('switch.circadian_lighting_[...]', 'brightness') | int }}"
                 metadata: {}
claytonjn commented 10 months ago

This question doesn't actually relate to the integration; the template you described should translate into proper values for kelvin and brightness_pct.

Speaking generally, I don't believe the scene.turn_on service allows you to pass in entity_id, kelvin, brightness_pct, or anything else under data or data_template - have you seen the ability to do so documented anywhere? I'm also not sure what you're trying to accomplish by turning on a scene and also passing values from Circadian Lighting.