I’m a beginner on HA and I have simple difficulty:
I want that the backlight of switches to be set to "off " regardless of a trigger. I know set it by an auxiliary entity or other automations types, but I want to set backlight off regardless of an action. The switch is always configured backlight “on” when energized (At Tuya integration there is a card “configuration” that ALWAYS sets this attibutes "on " after device power on) . I know that there is a way to create an automation that uses the HA initialization as a trigger but could happens that a device can be energized for any reason at any time and then this device assumes a default setup again. I´m using the backlight of a switch as an example but my doubt is valid for other devices too. NOTE: I don’t have yet good expertise to create templates or scripts, maybe they are the solution… I wil apreciate some examples.
When powering on the device, this entity attibutes always remains ON
`Entity attributes:
supported_color_modes: onoff
friendly_name: Zigbee Backlight 2 Keys
supported_features: 0
color_mode: null`
Update :
I obtained the result with an “obvious” automation which was the trigger: if the backlight stays “on”, then the action is to turn “off” the backlight.
This automation bypasses the default condition after any device power on.
But I’m still looking for a way to set an attribute as an initialization setup of a device (always keep an attribute in a given setup)
→
alias: manter luz fundo desligad zigbbee 2 teclas
description: “”
trigger:
- platform: device
type: turned_on
device_id: ccd081f8311a5e2e0ddebb58fb8e0ce1
entity_id: 0a0c36268133d829f9107489492f6df2
domain: light
condition:
action:
- type: turn_off
device_id: ccd081f8311a5e2e0ddebb58fb8e0ce1
entity_id: 0a0c36268133d829f9107489492f6df2
domain: light
mode: restart
Many thanks