Better Blueprint to report when any battery device (Zigbee/Zwave etc) or Zigbee/Zwave SmartSwtich has gone offline

for me it doesn’t work either - I am getting following warning - WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: ‘offline_devices’ is undefined when rendering ‘Folgende Geräte sind offline: {{offline_devices}}’

So a notification was sent to the HA app but just the text “Folgende Geräte sind offline:” - nothing else. Any advice what I am doing wrong ?

It “works” for me, except that the unavailable device it lists is just the generic manufacture name and not the friendly name. So among my dozen motion sensors, for example, I don’t know WHICH one is dead. Not too helpful.

hi, just checking back in to see if you had time to work on an update?

thank you!

Hi, just forked it to have friendly_name.
You can just use [state_attr(sensor.entity_id, “friendly_name”)] %} (line 49) to get it

You can import the fork to your HA instance using this url: Home Assistant Blueprint: Low battery level detection & notification for all battery sensors · GitHub

My report always shows my “Hue Bridge” is offline which it isn’t. The “Hue Bridge” is a device only without a similar entity. Hue Bridge is NOT even a battery device.
Excluding it (Device) doesn’t work either although I’m not sure what your device disclaimer means.

I’m alerted with “Roborock S7” on every run, even though i’ve excluded the “sensor.roborock_s7_battery” entity. is this fixable?

1 Like

@corgan By any chance have you found any workarounds to this?

I too seem to be running into this same issue with my Echos, and if there might not be a workaround, I might have to disable this blueprint (since otherwise I’d end up getting a report with 8 false positives every day).

I resolved my “Hue Bridge” occurrence as an “unavailable” battery device appearing in my offline list. The culprit was a Hue light bulb automation and/or switch with a state of “unavailable”. Don’t know what it is or where it came from, but either setting the state to off or excluding the entity (not named Hue Bridge, but named Desk Lamp On (automation) resolved it.

Go through the Entity exclusion list in the automation and exclude everything then turn them off one at a time to find the issue. It will likely have a different name than the false positive.

Thanks for your Blueprint (BBBAAA, Modular Taco). I love it.

same here. how can I find the “wrong” sensor?

First of all, thanks a lot Tahutipai for your blueprint. I was looking for this for some months.
I started to install it and excluded some devices considered non relevant and reported when the automation was executed. Worked well using entities instead of devices.
Will see in due time

Thanks

Hi,
Well, after some days, I can’t make it work. I scheduled if at 10 everyday, but the automation is not playing.
I also have deliberately put a zigbee sensor offline. When I manually execute the automation, it does not appear in the list.
I don’t know what could possibly be wrong. Any help or clue would be much appreciated.
Thanks

Hello,
I received the following error message while running the automation:

Logger: homeassistant.components.automation.push_offline_devices
Quelle: components/automation/__init__.py:669
Integration: Automatisierung (Dokumentation, Probleme)
Erstmals aufgetreten: 15:54:22 (2 Vorkommnisse)
Zuletzt protokolliert: 15:54:33
Error rendering variables: TemplateError: Must provide a device or entity ID 
1 Like

Neverminded It was something do with me automation action

Hi

I got a issues trying this out here what I see in the log

Logger: homeassistant.components.automation.devices_are_offline
Source: helpers/script.py:2005
integration: Automation (documentation, issues)
First occurred: June 5, 2024 at 6:58:26 PM (10 occurrences)
Last logged: 2:49:08 AM

  • Devices are offline: Choose at step 1: default: Error executing script. Error for call_service at pos 1: Error rendering data template: Result is not a Dictionary
  • Devices are offline: Error executing script. Error for choose at pos 1: Error rendering data template: Result is not a Dictionary

When the automation runs it’s showing “Home Assistant Cloud” as being offline.
I can not find any way to add it to the exclusion list.

Just as a note I don’t use Nabu Casa/Home Assistant Cloud.

Any ideas how I might stop this from being reported
Thanks

Getting same error as qwert1.

BlockquoteLogger: homeassistant.components.automation.report_offline_zigbee_zwave_battery
Source: components/automation/init.py:669
integration: Automation (documentation, issues)
First occurred: 28 June 2024 at 08:51:46 (9 occurrences)
Last logged: 09:04:00

Error rendering variables: TemplateError: Must provide a device or entity ID

Blockquote
Tracet log just shows

Any ideas

Hi, can’t make it work either, in the trace it fails at step A/B:

Result:

result: false
entities: [. ]

Step Config
.>_
{{ offline_devices != ‘’ and (day | int == 0 or day | int ==

now().isoweekday()) }}

I suppose it’s because it thinks there is no device offline, despite having taken the battery off a sensor…

I’m so frustrated, that’s the 4th method I find on the internet and nothing works, hours and hours of debugging just for one basic function to not even work…

Well I think I know why, the unavailable state doesn’t seem to happen… ever… If I remove the battery, HA still thinks the sensor is online, temperature etc still showing the last value before going offline. What is this mess ?

Yes this is what happens to me, weather station data just gets stale, never unavailable, I’m thinking to add a test eg if temp and humidity unchanged in x mins/hours then send notification. the chance of both temperature and humidity not changing by 0.1 should be vanishingly small? A more robust test would take several values and check if they are all the same over that interval.