Hi folks,
I have a CYD using some code I found online which works well.
I want to update thew code so that the screen backlight stays on if an input boolean helper in HA is set to on and reverts back to turning off automatically if the helper is off
The original code is:
- interval: 45s
then:
- if:
condition:
- lambda: |-
return !id(recent_touch);
then:
light.turn_off:
id: backlight
else:
- lambda: |-
id(recent_touch) = false;
and I have the helper imported from HA with:
- platform: homeassistant
name: "Desk presence"
id: deskState
entity_id: input_boolean.desk_occupied
internal: false
I want to update the code to something like this but code that actually works
- interval: 45s
then:
- if:
condition:
- lambda: |-
return !id(recent_touch) && !id(deskState);
then:
light.turn_off:
id: backlight
else:
- lambda: |-
id(recent_touch) = false;
Hopefully that makes sense.
Thanks!