Closed ToeiRei closed 3 years ago
This does exist already. Here is my script that I use to do this for my devices:
alias: Toggle AC light
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ is_state(entity_id, "on") }}'
sequence:
- choose:
- conditions:
- condition: template
value_template: >-
{{ not is_state_attr(entity_id, "display_backlight",
false) }}
sequence:
- service: philips_airpurifier.set_display_backlight_off
data:
entity_id: '{{ entity_id }}'
- service: philips_airpurifier.set_light_brightness
data:
entity_id: '{{ entity_id }}'
brightness: 0
default:
- service: philips_airpurifier.set_display_backlight_on
data:
entity_id: '{{ entity_id }}'
- service: philips_airpurifier.set_light_brightness
data:
entity_id: '{{ entity_id }}'
brightness: 100
mode: single
icon: 'pap:light_dimming_button'
fields:
entity_id:
description: Entity of fan
example: fan.air_ac2729
description: Toggle the backlight of philips AC
Thanks a ton. I was looking at service calls but couldn't find anything useful.
Well, there are service calls, three to be precise:
service: philips_airpurifier.set_light_brightness
service: philips_airpurifier.set_display_backlight_off
service: philips_airpurifier.set_display_backlight_on
I just packaged it into a script for myself to have it handy for more than one device and also use it from the interface and from automations more easily.
Thanks! I guess I was just blind. Works like a charm if you do it right (tm)
I have added PR #36 to make the available services more obvious.
I was poking around on fan.philips_airpurifier instead of philips_airpurifier
Can you please add a way to change the display brightness as it would make my life a bit easier when I'm able to automatically dim the display at night.