Yes in this instance I was trying to trigger it manually however it didn’t trigger when I did get an alert so I was trying to test why it didn’t trigger. Is there a way to force a trigger? Maybe set the alert back to 0 then to 1, will that force a trigger?
You could try it. I’m not sure how the trigger data would be handled as far as “to_state” is concerned but I guess it could work.
when it didn’t trigger on the alert did you check the automation trace to see why it didn’t run the actions as expected?
I did but the automation never triggered. It didn’t trigger until I tried to do it manually.
Just tried setting the state back to 0 then to 1 but again it didn’t trigger
are you saying that looking at the traces that the trigger never occurred at all even tho the state of the sensor changed?
if so then what is the trigger that you have configured?
post the entire automation in properly formatted yaml.
Well, I’m embarrassed, turns out I just copied and pasted your yaml without checking what the actual sensor id was. I assumed it was going to be sensor.nws_alert but in reality it is sensor.nws_alert_alert. Looked at it a dozen times and I still didn’t see it.
Having said that I tried again to manually set back the state and it appears the autmation ran but I still didn’t get the persistent notification. I’ll have to look into it some more.
Yeah, with the latest change to the integration that added that extra “_alert” to the end of the sensor the package files won’t work out of the box anymore.
I completely forgot about that so thanks for pointing it out. I’ll need to fix that.
I tried again with changing the state from 0 to 1 and it appears to trigger the automation. Looking at the trace it seams to go through each step however the script doesn’t trigger. When I go to look at the trace for the script there isn’t one that corresponds to the trigger of the automation. Seems like the manual trigger of changing the state is triggering the automation but for some reason now the script isn’t running. I thought maybe the repeat .item info isn’t there but I would think the script would still trigger so not sure why it’s not.
Also I see I have another sensor called “sensor.nws_alerts_alerts0”, is this expected? I didn’t see it mentioned anywhere.
I have no idea where that sensor entity_id came from. Are you sure you didn’t accidentally change the entity_id when you tried changing the sensor state (maybe adding a 0 when trying to change the state to 0)?
Otherwise as far as the script is concerned it likely won’t work triggering it manually since there is no repeat items to act on. Sometimes there’s no real easy way to things like this. You may just need to either wait until an actual alert comes thru or you can change the location that the sensor is monitoring to a location that has current alerts. You can use INZ009 since we have an active alert right now. then you can easily change it back after testing.
also as an FYI I updated the repo with a new package file for use with v6 and later. It’s untested but I think it should work as all that was needed was to add an extra “_alerts” to the end of every instance of “sensor.nws_alerts”.
Just a quick update, I received a new alert overnight and everything triggered as expected. Thanks for your help. This is one of my favorite integrations. I used it for years in our prior location and couldn’t wait to get it going again here in our new home.
Just to chime, in sorry it’s late.
When manually triggering, the to_state
doesn’t get populated due to nothing actually triggering the automation. Manually running an automation bypasses the trigger
portion entierly.