its a matter of elimination. comment them all and see if the error is gone? ok?
than enable half of them and retry. error still gone? enable half of the rest. if not, check in the last enabled sectionā¦
but, you dont need to do this in all your custom-ui templates, just the ones where the state is created during startup. Mostly HA template sensors, or things made by python scripts etc etc
wouldnt think so no, only templates. but, with the method above, its easily checked
btw, a state.state will most likely ever be āunavailableā , not āUnavailableā. you need to check the true state in the state machine, not what is shown in the Frontend
it checks if attributes are available, And if a certain attributes is available, And then if that attributes is true. in all other cases it returns the exception
I also have this but do not have it in configuration.yaml!
2022-02-04 03:04:40 WARNING (MainThread) [homeassistant.components.version] Configuration of the Version platform in YAML is deprecated and will be removed in Home Assistant 2022.4; Your existing configuration has been imported into the UI automatically and can be safely removed from your configuration.yaml file
2022-02-04 03:04:40 WARNING (MainThread) [homeassistant.components.version] Configuration of the Version platform in YAML is deprecated and will be removed in Home Assistant 2022.4; Your existing configuration has been imported into the UI automatically and can be safely removed from your configuration.yaml file
Also already removed from configuration.yaml:
Logger: homeassistant.components.androidtv.config_flow
Source: components/androidtv/config_flow.py:179
Integration: Android TV (documentation, issues)
First occurred: 3:04:56 AM (1 occurrences)
Last logged: 3:04:56 AM
Host [192.168.1.91] already configured. This yaml configuration has already been imported. Please remove it
And I canāt for the life of me the source for this!
Logger: homeassistant.helpers.script
Source: helpers/script.py:638
First occurred: 3:05:29 AM (1 occurrences)
Last logged: 3:05:29 AM
Error in 'condition' evaluation: In 'template' condition: UndefinedError: list object has no element 157
@mariustvbd, question: is it possible to change the colour of an icon based on the state of a source. For example Apple TV has various sources, if one source is playing can the icon related to that source change in colour? I am using the button card.
what I came up with is:
- type: button
icon: mdi:television
icon_height: 80px
state_color: red
name: SET TOP BOX
show_state: true
styles:
icon:
- color: |
[[[
if (state_source[āmedia_player.apple_tvā, āGSE IPTV PROā].state == āplayingā) return āredā;
return ādarkgreenā;
]]]
tap_action:
action: call-service
service: script.lounge_box
service_data: {}
target: {}
hold_action:
action: call-service
service: script.lounge_box
service_data: {}
target: {}
but that doesnāt seem to be working. Any help would be highly appreciated
A simple button should show the icon highlighted if the mower is mowing. I donāt have any idea why itās not working. Here my code in customize.yaml:
mower.mahndy:
templates:
icon_color: if (state == 'mowing') return 'rgb(214,162,69)';return 'rgb(102,102,102)';
any color setting can be done in the styles directly.
for further instructions/exmaples, youād best hop over to the dedicated thread on custom:button-card