Just updated to 0.51.1 and its now flagging up an issue with my automations that it didnt before.
I have run hass --script check_config but it doesnt show me what line has the issue in my automation code. It just says
2017-08-15 08:57:43 ERROR (MainThread) [homeassistant.config] Invalid config for
[automation]: [state] is an invalid option for [automation]. Check: automation-
>trigger->0->state. (See ?, line ?). Please check the docs at https://home-assis
tant.io/components/automation/
2017-08-15 08:57:43 ERROR (MainThread) [homeassistant.config] Invalid config for
[automation]: [state] is an invalid option for [automation]. Check: automation-
>trigger->0->state. (See ?, line ?). Please check the docs at https://home-assis
tant.io/components/automation/
Im having trouble working out which one is the problem.
Automations: The state trigger keyword state and the time trigger keyword after were deprecated in 0.46. They have now been removed. (@amelchio - #8510) (automation.state docs) (automation.time docs) (breaking change)
So to check I’ve got this right, Im guessing this is an offending automation? Because in the condition im using state:‘on’. Which if im reading correctly is now depreciated?
How would I go about changing this then? I have an input_boolean that this automation checks if its on or not. This determines if the automation runs. On occasion I might not want to track motion so will turn off the inputboolean to stop motion alerts. How would I go about achieving this now then if “State” is now depreciated? I cant use “from” “to” as i dont want to track a state change. I want to determine if the input_boolean is on or off, hence me using “state” previously.
I got the same while testing a new Pi, I understand the problem of breking changes for the new versions (long time ago for this I keep an old version of HA…). But the error log does not help to much:
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
2017-08-17 17:27:44 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/pi/.homeassistant/configuration.yaml, line 1532). Please check the docs at https://home-assistant.io/components/automation/
The line 1532 is:
automation:
So id does not help at all and this is only part of the log, my configuration.yaml is much bigger and this message repeats a lot. As far as I remember in the past the HA log point the right line with the error. I strongly suggest to show in the log the error line instead of the generic one.
Thank you
Of course this is the error cause, but what I would like to bring into attention is that the error log mention the yaml line of automation start for all such errors and not the line where the problem encountered.
My automation area last until line 2645, so it will be nicer to find and go to the right line for replace “state” with “to”.
I can’t do just Ctrl+H because “state” is also used in the “platform state”.
I do agree with what you are saying, HA used to give the line number of the error, why it doesn’t anymore I don’t know. The way to bring it to the dev’s attention is flagging it as a error in git I suppose.