If a device accidentally gets unplugged, I want to know about it. I have some light automatons fail because the light is unplugged, or sensor that triggers it is unplugged, and home assistant knows it… but I have no idea until i go in to debug.
I would love a simple check box like “notify me when anything goes unavailable/missing/whatever for more than 5 minutes”
sure, there might be some crazy template way to do this… but WTH isn’t it simpler than that?
I’d like to unvote for this. Systems with hundreds of entities will have many many unavailable entities, cluttering up the repairs section with useless information that may not even need to be repaired.
You can always just create an automation that does this for you and notifies you directly to your phone.
This is a fairly straight forward automation?
You could let is do anything you want, e.g., send a push notification, blink some lights and announce something over speakers.
maybe what im asking for is a simple blueprint?
can you tell me in what case you have an unavailable entity, and don’t care about it?
Or for a dashboard display, the third party auto-entities card is great for this.
card:
title: Unknown
type: entities
filter:
include:
- domain: sensor
state: unknown
- domain: binary_sensor
state: unknown
- domain: light
state: unknown
- domain: switch
state: unknown
- domain: vacuum
state: unknown
show_empty: false
type: custom:auto-entities
That would even be complex?
- Add a trigger on a state
- select the entities you want to be informed of (multiple can be added)
- to state: Unavailable
- for: 00:05:00
- Add an action you like, e.g., notify.
There is really not more too it
device_trackers in particular come and go on your router and are no longer available. I couldn’t care less as extra entities do absolutely nothing. Also, some devices are powered by other devices and are only available when they have power.
Currently I have 80 entities that are unavailable. All which I do not care about, nor do any of them need fixing.
I guess that is my issue. i don’t see a reason why this wouldn’t be “every entity i have”
can i make this “every entity”
There’s also this:
this seems like a pretty good option so far, but an alert would be best.
thanks!
trigger:
- platform: event
event: state_changed
condition:
- condition: template
value_template: "{{ trigger.to_state.state == 'unavailable'}}"
action:
- service: notify.notify
data:
message: "{{ trigger.to_state.name }} is unavailable"
i tried transcribing what you have in the template editor here, but couldnt get it to work. how do i get this template to “listen for all state changed events”?
That’s an automation, it won’t work in the template editor.
if this does what i think it does… it might be exactly what i need…
It will notify you when an entity is unavailable.
that was a reply to your other post that was a screenshot of you in the template editor in dev tools
Ah, that template is…
count
{{ states | selectattr('state','eq','unavailable') | map(attribute='entity_id') | list | count }}
entities
{{ states | selectattr('state','eq','unavailable') | map(attribute='entity_id') | list }}
Won’t this trigger all the time?
@adamaze: If you like, have a look at this approach:
unavailable-entities-sensor/package_unavailable_entities.yaml at 8cb0a6ab34f58384fb5b3dbb8337b21abadf0f36 · jazzyisj/unavailable-entities-sensor · GitHub
Yes it will, but the condition will cause it to not notify.