sorry just notice the other bit I will try
Are you using the latest version of Home Assistant (2024.8.X) or a previous release?
The “Startup Monitor” example I posted is meant for use with the latest version (because it uses the option name action
instead of service
).
conditions: []
should be:
condition: []
Assuming you use the latest release, if not you’ll get another error about an action (that can be fixed too).
Thank you!
I have corrected the example.
ok this ran
and i saw amessage about alexa starting and others and then finshed startup
am i suppost to see anything else
If the automation executed, it will produce a trace and post a persistent notification.
View the list of automations and find Startup Monitor. The time it executed will appear next to its name. If the time is “Never” then it means the automation didn’t execute on startup.
sorry no it did not!!. it did when i ran it manually (not when i used the restart) (the three dots then run)
I just tested it on my system and confirmed that I got the same result as you; it was not triggered on startup.
That means Home Assistant fails to issue a homeassistant_started
event on startup. In other words, it’s not working the way the documentation claims it should work.
It’s a bug.
thats good to know it not me being stupid!!
do i need to do anything about it or is it something that will just get fixed later?
interestingly if i use the original trigger (start) it does put the notification at the end of the startup!
trigger:
- platform: event
event_type: homeassistant_started
enabled: false
- platform: homeassistant
event: start
seem strange its not at the start
Home Assistant may be started, but that does not mean that all add-ons are finished initializing. Alexa Media Player takes some time to connect and become “ready”.
yes i have come to that conclusion as far as i can tell there is no way of knowing when that happens?
There is no way to know when all add-ons finish their startups.
You might be able to use the state of one of the players. For example, “media_player.kitchen” state is “standby”. I don’t know what the state is before the add-on is started. So, maybe trigger on “to: standby”? Try it and let us know.
I sort of get your idea but dont know how to test
was trying this:
action: notify.persistent_notification
data:
title: "{{ now().timestamp()|timestamp_custom() }}
message: "{{sensor.media_players.state}}" Home Assistant started.
but it does not work what am i doing wrong please
I’ll report it as an Issue in the Github Core repository. That’s where the development team tracks bugs
ok this is what I have got for now :-
alias: bondhome started
description: ""
trigger:
- platform: homeassistant
event: start
enabled: true
- platform: state
entity_id:
- media_player.hallway_echo_dot
attribute: state
to: standby
enabled: true
condition: []
action:
- data:
data:
method: all
type: announce
target:
- media_player.lounge_echo_dot
- media_player.lounge_tv_cube
- media_player.kitchen_echo_dot
- media_player.spare_echo_dot_dining
- media_player.loung_show_8_2nd_gen
message: Home assistance has started
action: notify.alexa_media
- action: notify.persistent_notification
data:
title: "{{ now().timestamp()|timestamp_custom() }}"
message: "{{ states('media_player.hallway_echo_dot') }} Home Assistant started."
mode: single
and it appears to be working so far but I still needed the “start” trigger to get it to run!
will monitor for now
Not sure this will work every time as its not actually using the second trigger!!!
Didn’t you say in your first post that you didn’t want to use the startup trigger?
Or was that something else?
ok I think I now have it correct
alias: bondhome started
description: ""
trigger:
- platform: homeassistant
event: start
enabled: true
condition:
- condition: state
entity_id: media_player.hallway_echo_dot
state: standby
enabled: true
action:
- data:
data:
method: all
type: announce
target:
- media_player.lounge_echo_dot
- media_player.lounge_tv_cube
- media_player.kitchen_echo_dot
- media_player.spare_echo_dot_dining
- media_player.loung_show_8_2nd_gen
message: Home assistance has started
action: notify.alexa_media
- action: notify.persistent_notification
data:
title: "{{ now().timestamp()|timestamp_custom() }}"
message: "{{ states('media_player.hallway_echo_dot') }} Home Assistant started."
mode: single
the “start” appears the only way to get it to run and it used to run sometimes (it was more reliable with the delay)
so i am going to have to monitor this to see if it always starts
I have rebooted a couple of times so far & it appears ok