Unavailable entity detection & notification

@ian.robson, check if you have the right home assistance URL on the page that opens when you click Import Blueprint. The URL address is located at the bottom of the windows and you can edit by clicking the pencil icon at the right.

Alternatively use this URL to import it: https://github.com/gmlupatelli/blueprints_repo/blob/cab231edbd05820c070de5c6a38f140868cbbbcb/unavailable_entities_notification/unavailable_entities_notification.yams

1 Like

Thank you that fixed it.

Very nice blueprint! @gmlupatelli

I have this problem:

Everything works perfect but the telegram notification does not start. If I simply delete the word {{entities}} the notification is sent (obviously without the entity names)
Any idea on the possible solution?

Just remove the '' from entities.

Here is an example of a working message:

message: 'Here is a list of unavailable entities in your home: {{entities}}'

Unfortunately, the problem is not there.
Here is the image with the new message (I deleted every word I added before).

The blueprint works perfectly since the results (above in the image) are what I expected, but the telegram notification doesnā€™t start. The notification starts if I delete the word {{entities}} so the problem is not in the notifiy service either. What should I check for?

Thank you

I think I got it :slight_smile:

After doing some research at the forum I found someone with a problem with the telegram bot similar to the one you are having, and it was related to the fact that the variables in the message had underscore, here is the link to it: Telegram message with variables - #2 by anon43302295

Looking at what you have inside the entities variable I see you have some sensors that have _ in the name, given that you need to replace them with something else, try this {{ entities|replace('_', ' ') }}

Thank you so much! :pray:
That was the problem! I fixed it!

Any chance you could add an include list as well as the exclude?

Iā€™d like to track specific entities that fall offline, and I have many many entities that are ā€˜unavailableā€™ for other reasons, due to custom components considering that to be a valid state for ā€˜not activeā€™ (e g Google home timers).

No worries if not, just thought it might be a nice addition of easy enough.

3 Likes

This is really great.

Anyone know an easy way to adapt this to include and not exclude entries? or change it from daily to hours etcā€¦

1 Like

If you know how to edit the blueprint:
In the unavailable_entities_notification.yaml file edit the following:

Line 91:
Change
{% if state.state == ā€˜unavailableā€™ and not state.entity_id in exclude.entity_id %}
To
{% if state.state == ā€˜unavailableā€™ and state.entity_id in exclude.entity_id %}

You can also replace every word ā€œExcludeā€ (or ā€œexcludeā€¦ā€) with the word ā€œIncludeā€ for less confusion :sweat_smile:.
The Blueprint now works only with every Included entity!

1 Like

Is there any way to avoid triggering the automation when thereā€™s no unavailable entity? Iā€™ve tested with unavailable ones and work like a charm, a persistent notification is sent. But when all entities are available the notificaiton got triggered as well.

I have integrated the battery blueprint and works like a charm, not triggered when threshold is not under.

Thanks in advance

Iā€™ve found the issue: It was introduced with latest commit. I just copied the previous version were entities were shown using commas instead of /n. Hope it helps.

@marc.forn, just figure out as I also have a low battery automation that uses the same code base. Sorry about that. Just committed a fix to both.

I donā€™t find the verbose entity names useful, so I forked this Blueprint so that it spits out entity_ids instead: https://raw.githubusercontent.com/mmichon/blueprints_repo/master/unavailable_entities_notification/unavailable_entities_notification.yaml

1 Like

Thanks for the update. We are all here for the community :wink:

@gmlupatelli ciao. can you add an option to run the check every X minutes instead of once per day?

1 Like

@gmlupatelli I implemented expanding devices - see pull request at GitHub :slight_smile:

1 Like

Merged. Thanks for adding the feature.

Been using this for a while and itā€™s very helpful, thank you!

I have this in an auto entities dropdown in an admin dashboard, but is there a way to just show devices which have any unavailable entities instead of the entities themselves? Some of these devices have like 10 entities and I donā€™t need to see them individually because when they go offline itā€™s always all of them.