My former install of HA has run perfectly for over 3.5 years.
Finally, it was time to update and there have been massive changes to Home Assistant.
Feeling super dumb here as I had all my automations stored and none of them work now.
I have tried using the Automations Editor (nice tool), they trigger if I press the button in the editor but never trigger at the designated time.
Using the configurator (also awesome) I can see the code the automation editor makes.
Slowly came to realise that despite giving my geolocation the automations use UTC.
Here is an example of the code from my one-millionth unsuccessful attempt to simply turn on a light.
- id: '1565160145162'
alias: Not Working
trigger:
- entity_id: light.hallway_light_1
from: 'off'
platform: state
to: 'on'
condition:
- after: 07:03:00
condition: time
action:
- data:
brightness: 254
entity_id: light.hallway_light_1
service: light.turn_on
FYI the old code looked something like this for my workstation lights for example.
(calls a different service??)
alias: "Work Station Lights off at 22:00"
trigger:
platform: time
after: '22:00:00'
action:
service: homeassistant.turn_off
entity_id: light.workstation_lights
Thanks for the response.
I have inserted quotes both double and single and the time refuses to fire the automation.
Using the Automation editor to make an automation, it does not include quotes around the time value
This was confirmed confirmed using the configurator to view the /config/automations.yaml file directly…
Putting quotes on the Automation Editor GUI field for time reports a malformed data.
Here is the simplest possible automation I can think off.
It turns on a light at a given time with no conditions (just turn that sucker on)
This also does not fire at the specified time.
- id: '1565171052258'
alias: Not Working
trigger:
- at: '09:55:00'
platform: time
condition: []
action:
- data:
entity_id: light.hallway_light_1
service: light.turn_on
Can anyone post some working code or correct any of these code samples for me.
I am finding this simple problem wickedly frustrating and time consuming.
Are you 100% certain the entity_id is correct? There is nothing wrong with the code. Click on the automation and then click on trigger… does the light turn on?
Yes the one (and only one) light comes on when pressing the trigger.
Thanks for your suggestion but I have even been moving the triggered light around to ensure I am specifying the correct target.
Another issue could be my use of UTC to check myself…
Example 8:30 PM Brisbane Queensland = 10:30 AM UTC
Of course I have use both Local and UTC times to no avail.
I will plunk in some local times and see if the situation changes.
In the past, I used local times but the doco seemed to specify UTC for all automations.
Personally, I will go with whatever works
I am going to knock this install over and start again.
I had one instance trigger about 5 min later than it should.
Specified my Lat and Long to HA, checked the clocks on the host and my local machine.
My target is a hue bulb that seems to be quite content being auto discovered and switched on and off manually in the HA GUI.
I will start again tomorrow and see where that leads.
Thanks
Ross
sounds like the time in your system is off. Nothing in HA is UTC unless you get into templating. Also, you have to turn your automations on after creating them
Never underestimate missing the obvious, so yes, definitely switched them on.
I did sometimes had the automations.yaml file open, SAVED but open.
I assume the file would run ok in this state but also had it closed.
I always closed the Automations Editor before the due time for the automation as well.
Honestly sick of this one, lets see where a clean install gets me.
Hi All
Had the time for a bit of a regroup and the ONLY thing that fixed this issue was to reinstall hassio.
I did a clean install, refused all integrations and put only my light code into the configuration.yaml file.
Set the time for an automation and it worked first go.
A few observations.
The broken install did not voluntarily put the light switches into the GUI.
I was able to find the light and add it to the GU and turn on and off the light.
The new install spotted the lights code in the config file and automatically put two light switches into the GUI.
Thanks for your help, it is appreciated.
Regards
Ross
The old install… was it using a Lovelace you customised? If so you have to add manually. The new install is probably using an auto-generated lovelace so it would automatically pick it up. It sounds to me like the automation was probably not switched on… If you go to configuration->automations you can check if an automation is on or not.
Anyway glad you fixed it but it’s fixed probably for reasons unrelated to reinstalling.
Yes I did customise it to the extent of moving panels around, so I suppose that qualify’s.
The automations on the old install were definitely turned on.
I am dealing with something like a 50 release upgrade, there is new stuff, changed stuff and stuff hiding everywhere.
Seriously though it is great to see how far the software has come.
My aim is to integrate Hassio locally with Google Assistant in the cloud.
Already I can see that the Hue app is flakey with automations randomly turning off.
Hassio is solid, in fact a light just came on then!
I am currently using a few unmodded Sonoff TH16’s and linking them up to the Google Assistant using the Itead gateway.
I have a number of Google Mini’s and a Google Home for voice control.
Chromecasts and Chromecast Audios also work very well.
Recently I have been playing with Mosquitto, Tasmota and Gbridge, darn near got that to work.
Could actually switch one switch.
I have had many installs of with the Mosquitto addon working and chatting to some TH16’s with Tasmota flashed. The Tasmo addon is really good sure beats hunting them down and reflashing them for an upgrade.
I am waiting on an upgraded YT1 bridge for my limitlessled, Milight, Easybulb globes so that the software can connect to Google Assistant.
They are working fine locally on Hassio but the bridge is so old the cloud service is not offered.
Um… never heard of one of those. I’m using the ibox2 for my Milights and via HA links to Google Assistant fine. No idea what a YT1 bridge is. There are also some DIY bridges you can make with a NodeMCU and a few other parts. I’m also a fan of Tasmota - have a bunch of switches and stuff running that - mostly flashed Sonoffs.
I can’t even imagine the mass of changes since 50 releases ago lol…