Automations with 0.84

Good morning.

I use homeassistant quite a while now but that is the first time I cant figure out what is going on. Spent already several hours on it. I updated to 0.84 yesterday and since then no automation is working anymore. Removed all of them beside two for debugging and still cant find the problem. Only thing I see in the logs is:

2018-12-13 11:39:13 DEBUG (MainThread) [homeassistant.components.automation] Automation automation.1_debug_switch_on initial state False from recorder last state <state automation.1_debug_switch_on=off; last_triggered=None, id=debug1, friendly_name=1 Debug Switch On @ 2018-12-13T11:38:55.131475-07:00>
2018-12-13 11:39:13 DEBUG (MainThread) [homeassistant.components.automation] Automation automation.1_debug_switch_off initial state False from recorder last state <state automation.1_debug_switch_off=off; last_triggered=None, id=debug2, friendly_name=1 Debug Switch Off @ 2018-12-13T11:38:55.131958-07:00>

I tried to remove automation from history and recorder but that donā€™t change these messages and they are not getting triggered. I donā€™t even see the box opening if I click on the automation in the GUI where I usually could trigger them. Does someone has an idea what I can do here?

Thanks

Answer myself here. Of course shortly after writing it down I found something which seems to work. I had to add ā€œinitial_state: trueā€ to every automation in order to make it work again. The documentation states something about on/off for this parameter which is not working. Wonder why I am the only one with this problem.

  • id: debug1
    alias: ā€˜1 Debug Switch Onā€™
    initial_state: true
    trigger:
    platform: state
    entity_id: input_boolean.test_script
    to: ā€˜onā€™
    action:
    service: input_select.select_option
    data:
    entity_id: input_select.test_select
    option: ā€˜Onā€™

leads to this then:
2018-12-13 12:02:55 DEBUG (MainThread) [homeassistant.components.automation] Automation automation.1_debug_switch_on initial state True from config initial_state
2018-12-13 12:03:02 INFO (MainThread) [homeassistant.components.automation] Initialized trigger 1 Debug Switch On
2018-12-13 12:03:21 INFO (MainThread) [homeassistant.components.automation] Executing 1 Debug Switch On

ah, so this line is not working anymore then?

initial_state: 'on'

does it needs to be changed to :

initial_state: true

Just a quick test initial_state: 'on' seems to work too. My problem was that I didnā€™t have this parameter and without it the automations were stuck.

ah, well, i didnt had that line before at all
and sometimes when i restarted HA, all my automations were in OFF state
then i added that line, and now everty time i do a restart, my automations are ON

They changed the way states are stored/restored in 0.84. However, on ā€œfirst startā€ with 0.84, it canā€™t restore the state properly for some items. If you show your automations in the GUI, you will see each has an on/off switch next to itā€¦ if they are off your automation is disabled. So make sure they are on should stay on through restarts (or off through restarts if thatā€™s what you want)

I just reverted to 0.83.3, because no automations worked with 0.84.1 . Iā€™ve read about the new ā€œstate trackerā€ and that it causes a loss of all states when initially started. Didnā€™t think about automations, this should definitely mentioned in the breaking changes ā€¦

Why not just put the initial state on true? Didnā€™t that fix it?

1 Like

Iā€˜ve read this post after the revert, will give it another try later.

So, itā€™s literally the first item on breaking changesā€¦

Breaking Changes

It is of course my missing mental capability to interpolate this info to the absence of working automations. But - never mind, an automation.turn_on without arguments did the trick.

My comment isnā€™t about your mental capacity, itā€™s more about you complaining about the devs not doing something when they did. These guys are doing these changes for free for other people and here you are complaining without reading the changes. Mind you, this occurred directly after you reply to another user who posted the exact breaking change you complain about.

I have some iisue with automation and time conditionsā€¦ time conditions donā€™t seem to be taken into account. I have to make further investigations and report but it is strange that since last upgrade some automations donā€™t ork the way they worked before and the way they are supposed to work

So I assume thereā€™s a typo in the change logā€¦ where it says:

This means that the Lovelace YAML config is now parsed with YAML 1.1 instead of YAML 1.2

That should be the other way around, no?

@thundergreen Go to /dev-service (classic UI) and run service ā€œautomation.turn_onā€ without an entity_id. This will enable all automations again and assuming the storage helper works, they will stay on. Alternatively, you could add an attribute ā€œinitial_stateā€ with ā€˜onā€™ value to each of your automations and reload them.

From a developerā€™s perspective, this has been mentioned properly by breaking change ā€œState restoration will not work the first time you start 0.84.ā€ . Donā€™t criticize the devs, they do it for free.

Iā€™m not sure. They may have purposely downgrade. Iā€™ve heard people having issues with !include which could be a result of this downgrade. I donā€™t know enough about the yaml parser. Think this would best be discussed on the discord server where the mods can respond.

Salty arenā€™t we? If you want changes, submit and issue or request a feature. Complaining doesnā€™t help anyone.

o no! please donā€™t get me wrongā€¦ I donā€™t critisize at allā€¦ itā€™s more related to my time conditions. I set for example after: ā€˜10:00:00ā€™ and before: ā€˜20:00:00ā€™ but this automation would fire even at 09:00:00 and it turn on a light which has even not been set in this automation but in another automation which should fire at this time .

1 Like

Thank you so much for this! I first thought this problem was related to mqtt since all my automation triggers depend on it. I was following all the guides that currently report issues for mqtt, without success. I spend and hours and days until I realized that only the automation part was affected. Did some googling, found this discussion and problem solved within a minute!