RobDYI
March 9, 2018, 7:41pm
1
I have had instances in the configuration.yaml when I have removed entities or misspelled them and it didn’t cause any errors. It did however made sensors / groups / automations and other components not work as intended.
Is there a way to check my configuration for entities in component configuration that do not exist?
treno
(travis reno)
March 11, 2018, 1:35am
2
You can see all your entities in the “States” developer tool:
RobDYI
March 11, 2018, 1:58am
3
Can that help my find the misspelled entities like this one in a action in a automation?
action:
- service: switch.turn_off
entity_id: switch.misspelled_entity_that_doesn't_exist
Georg
(George)
June 2, 2021, 5:33pm
4
Here’s how I did this:
#1 Get the list of the entities mentioned in my config files.
find /config -type f \( -name "*.yaml" -o -name "*.py" \) -exec egrep -r -e '(switch|light|sensor|camera|device_tracker|group|input_boolean|input_number|input_select|input_text)\.' {} \; |\
sed 's/\(\(switch\|light\|binary_sensor\|sensor\|camera\|device_tracker\|group\|input_boolean\|input_number\|input_select\|input_text\)\.[a-z_0-9][a-z_0-9]*\)/\n\1/ig' |\
sed 's/\(\(switch\|light\|binary_sensor\|sensor\|camera\|device_tracker\|group\|input_boolean\|input_number\|input_select\|input_text\)\.[a-z_0-9][a-z_0-9]*\).*/\1/ig' |\
sort | uniq |\
grep '\.' |\
egrep -vw 'light.toggle|light.turn_off|light.turn_on|switch.is_off|switch.is_on|switch.toggle|switch.turn_off|switch.turn_on'
#2 Get the list of existing entities in HA
In the /developer-tools/template execute the following:
{% for state in states %}
"{{- state.entity_id -}}
{% endfor %}
#3 Compare the two lists
An addon/integration/appdaemon that could compare all automations, scripts, etc to active/known entity id’s would be awsome. Hell, I’d settle for a Blueprint.
Has anyone found a viable and nice possibility for this?
Edwin_D
(Edwin D.)
January 6, 2024, 8:59pm
7
Watchman will hunt down entities in your yaml that do not exist or are unavailable:
1 Like