# Low battery or dead devices domoticz mqtt

**URL:** https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108
**Category:** General
**Created:** [11 June 2023 10:53 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108 "2023-06-11T10:53:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [11 June 2023 10:53 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/1 "2023-06-11T10:53:18Z")

</div>

Hi,

I am looking for a node or flow to check the status of batteries and dead devices.

Somebody with a good solution? Or examples.

---

<div class="post-metadata">

### Author: ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)
#### Post date: [11 June 2023 11:06 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/2 "2023-06-11T11:06:28Z")

</div>

I can read the battery voltages of some devices using MQTT. Setting various values (Low, Warning or whatever) and comparing to the actual voltage, you can send a message, warning or otherwise, in my case via Telegram. (Or you could display values/warnings on a screen.)

---

<div class="post-metadata">

### Author: ![nodouser](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nodouser](https://discourse.nodered.org/u/nodouser)
#### Post date: [11 June 2023 11:25 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/3 "2023-06-11T11:25:57Z")

</div>

Yes, but is there a way to read only dead devices and low battery? And not to configure every devices.

And then send an message.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [11 June 2023 11:34 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/4 "2023-06-11T11:34:02Z")

</div>

> [@nodouser](#):
>
> Yes, but is there a way to read only dead devices

You can't really read a dead device. So you need a way to tell if a device is alive, not dead.

Depending on the capabilities of the device you could

- Ping it at intervals. If there is no response trigger your notification flow.
- Have it send "heartbeat" messages at intervals. If the heartbeat stops, trigger your notification flow.
- If the time elapsed since the last reading exceeds n seconds, trigger your notification flow.

If your device can measure it's own battery level, have it send that data as the heartbeat payload.

---

<div class="post-metadata">

### Author: ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)
#### Post date: [11 June 2023 11:36 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/5 "2023-06-11T11:36:27Z")

</div>

With MQTT it may be possible to use the [LWT (Last Will and Testament)](https://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament/).

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [11 June 2023 11:39 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/6 "2023-06-11T11:39:41Z")

</div>

LWT is good yes.  
By default Node-red will receive the "Offline" message 30 seconds after the device drops off the network.

It's basically the same as my heartbeat suggestion but built-in to MQTT.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 August 2023 11:40 UTC](https://discourse.nodered.org/t/low-battery-or-dead-devices-domoticz-mqtt/79108/7 "2023-08-10T11:40:06Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
