kylerw
(Kylerw)
February 14, 2017, 8:07pm
1
I’m probably just over complicating this but, what’s the best way to trigger off of brightness change?
- alias: "Brightness - Master Bedroom Brightness Change (Device > Slider)"
trigger:
- platform: template
value_template: "{{ states.light.master.attributes.brightness }}"
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.brightness_master
value: "{{ trigger.to_state.attributes.brightness | int / 2.55 | round(0) }}"
Doesn’t like the template/value_template in the trigger here.
rpitera
(Robert Pitera)
February 14, 2017, 8:22pm
2
Could you create a sensor from your value template and then use the state trigger on that new sensor? Example but don’t cut and paste, check my work first. LOL
- platform: template
mbr_brightness:
value_template: "{{ states.light.master.attributes.brightness }}"
then
- alias: "Brightness - Master Bedroom Brightness Change (Device > Slider)"
trigger:
- platform: state
entity_id: sensor.mbr_brightness
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.brightness_master
value: "{{ trigger.to_state.attributes.brightness | int / 2.55 | round(0) }}"