Guys, I’m not talking about reboots, or restarts of the program itself (I don’t believe that was ever a question of mine).
It was indicated to me, in this thread that whenever certain work is done inside HA, the system performs a “global reset”. HomeSeer simply does not do this.
That is not what is happening in my case. I can see when the speaker wakes up via an indicator led (When it is sent audio or tts) . It follows that delay.
If I set the delay for 05 seconds, the audio file is not send for at least 5 seconds.
If I set the delay for 30 seconds, the audio file is not send for at least 30 seconds.
The first action is the sending of the audio file.
the initial tone should start right away and then then the automation should continue to indicate it’s still running for the additional 5 seconds of the delay.
Just to confirm, you’re saying the 20Hz tone only plays after the delay has expired (followed immediately by the TTS message)? Or does the tone never play, just the TTS message?
If it’s the former then that’s odd behavior because actions are normally executed in their defined order so the tone ought to come before the delay.
This is not true. The speaker doesn’t wake up for five seconds, sure, but the service call to send the audio file was made before the delay. This is an indication that there is something wrong with your attempt to wake the speaker with the audio file, not that the service call isn’t being made. The speaker is not waking until the TTS command makes it through.
Have you checked for any errors with the service call? Have you ensured that the file is accessible and being played successfully?
To be accessible from outside of HA, it should be in the www directory and accessed through a URL closer to http://192.168.1.132:8123/local/music/20Hz4Sec.mp3.
Well, I was explaining why you were getting errors when trying to access the files via a web browser. I can’t speak as well to Media Source as I’ve never used it, but your service call doesn’t follow the example from the docs you shared. If it did, it would look more like this:
So after several hours burned on this issue. I have found a ‘solution’, as there is a failure of some nature paying an audio files with media_player.play_media from the default ‘media’ folder when your HA instance is without ssl. (I’m using HA’s cloud)
I want to thank everyone who helped me, it was with all your suggestions that enabled me to get to the bottom of this issue (don’t think this basic function should have been a problem, but I digress. )
Hope this help some in the future…
Used the \config\www\ folder to place my audio in. Thanks @r-j-taylor
This thread now serves as an example of how not to report a problem.
Instead of simply stating the tone failed to play but the TTS message did after the delay expired, it reported:
Anyone who has used Home Assistant for awhile knows that’s nonsense; a delay has no affect on actions preceding it.
The first post also gave the misleading impression that the tone did play:
Yet it never did play because Home Assistant was improperly configured to play local media.
Finally, the Solution post allegedly provides instructions for correcting the cause of the tone’s failure to play (for which delay was blameless) yet it overlooks to follow the instructions found in Media Source.
Well as it turns out I did indeed follow much of the ‘How to help us help you’ list.
0-1-2-3-4) I have spent more hours reading and re-reading over and over again, watching help video’s and working on it before ever starting this post.
5-6) I didn’t follow
I personally thought the title of this post was clear.
I stated the goal first and not the problem and I thought I was clear when I said “Appears”…
9-11) I showed my automation, I believe properly formatted. Yes I didn’t understand the root cause, but isn’t that part of learning from the failures in your understanding and logic? “You don’t know what you don’t know” kind of thing.
I failed to do, as at the time I didn’t think it was relevant in this case.
An observation over the 2 months of reading the posts and reply’s on this site is that most people here are extremely helpful, willing and able to help those who are new and simply don’t have the programming background required to accomplish many tasks in HA.
Then there are a few others, mostly HA veterans who fail to understand, either via hubris or repetition (the "get off my lawn type) that many, like my self are not programmers (hobby or professional) and thus when we read the documents some of it doesn’t make sense no matter how much we re-read.
In this specific case I read that section quite a few times (and many others), with no success (albeit due to a lack of knowledge and understanding on my part)
Thankfully @r-j-taylor and @finity could see through the noise of my ignorance and provide useful and meaningful steps to help me solve the problem at hand and more importantly help me gain knowledge and understanding of how HA works.
Just to add -
this would have been MUCH easier to diagnose - had “show trace” been clicked, and the results posted here. At the very minimum, we would know from the timestamps that the automation did indeed run in the expected way.
Additionally to answer this:
That would be unaffected by editing the automations, provided that they were automation triggers, because it’s the core state system that keeps track of how long things have been in a certain state, the only thing that would throw that off, would be an actual restart of core.
But if you had an automation with a trigger of no motion detected for 10 minutes, that would still fire when the automations were reloaded, once there had been no motion for 10 minutes. So if you reloaded the automations 9 minutes after motion was last detected - it would still trigger a minute later.
Indeed, however yet another piece of the HA puzzle I was not aware of until yesterday. It is a VERY nice feature in which I’ve already used to diag. another issue.
Thank you. So if I’m understanding you correctly. If I’m working on (updating) an automation and I hit the save button, the trigger will still be valid?
It is indeed very handy. Especially when you start passing variables to scripts. Eg - I have a LUX sensor outdoors, which I use to set a master slider to a value between 0% and 100% and all the rooms use the value of the master slider to determine the current level that any lights that are on should be set to:
service: input_number.set_value
target:
entity_id: input_number.master_brightness_based_on_lux
data:
value: >-
{% set val = trigger.to_state.state|int %} {% set min_in = 1 %} {% set
max_in = 3000 %} {% set max_out = 100 %} {% set min_out = 1 %} {% set out =
(101 - (max_out + (min_out - max_out) * (1 - ((val - min_in) / (max_in -
min_in))))) %} {% if out < min_out %}{% set out = min_out %}{% endif %} {%
if out > max_out %} {% set out = max_out %}{% endif %} {{ out|int }}
and then say the Livingroom is triggered when the value of the master changes - so it can determine it’s brightness level:
service: input_number.set_value
target:
entity_id: input_number.livingroom_light
data_template:
value: ' {% set min = 15 %} {% set max = 82 %} {% set b = (trigger.to_state.state|int) -(100 - max) %} {% if b <= min %} {% set v = min %} {% elif b >= max %} {% set v = max %} {% else %} {% set v = b %} {% endif %} {{ v }}'
The traces let me see the actual numbers being passed to automations and service calls so I can make sure it is working as I expect it to.