offline device

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

Post Reply
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

offline device

Post by ssk17051980 »

Hello,

i use domoticz whit zigbee2mqtt with Sonoff dongle.
I want to know when a device it's offline .

what solution i have ?

thx
User avatar
waltervl
Posts: 5855
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline device

Post by waltervl »

A sensor widget will become red (offline) if it did not send an update for X hours.
A switch you can check perhaps with a script.
Do you see an online/offline status in Zigbee2MQTT?
Do you use the MQTT AD gateway or the old python plugin to connect with Zigbee2mqtt?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Re: offline device

Post by ssk17051980 »

good idea, but i do not know how to doit =))
i'm using Zigbee2MQTT Plugin (v. 3.2.0-beta)
User avatar
waltervl
Posts: 5855
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline device

Post by waltervl »

So what is status offline? You have to check the plugin manual if it supports detecting the status and push that status to Domoticz.
In Domoticz you normally see a last seen date and time on each device. In Domoticz you can set a notification on sensors (not switches!) when a certain time has been passed without update.

You could also think why a zigbee device gets offline. My devices won't go offline. I do not use zigbee2MQTT so cannot help you in detail.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
kimhav
Posts: 154
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Re: offline device

Post by kimhav »

waltervl wrote: Saturday 26 August 2023 14:42In Domoticz you can set a notification on sensors (not switches!) when a certain time has been passed without update.
Hi Walter, regarding the device specific notifications which allows one to receive quite quickly alerts when a critical sensor goes offline by ignoring the main interval settings in Domoticz and after defined value when it last was seen. Why this solves one issue another one occurs which is that Domoticz now keeps sending an email once per minute where it would be great if it just sent one (1) inital email based on the rules defined in the device notification and after that it could utilise for example the system defined interval. Is there any workaround or tweak to avoid getting the inbox flooded?
User avatar
waltervl
Posts: 5855
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline device

Post by waltervl »

I don't have that issue when using this function. I only get one notification when the last update is above a certain level.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
kimhav
Posts: 154
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Re: offline device

Post by kimhav »

waltervl wrote: Sunday 27 August 2023 22:29I don't have that issue when using this function. I only get one notification when the last update is above a certain level.
Ok, interesting, so either a bug or error 40 on my side; here is the settings for the device notification, either I overlooked something very obvisious or it's something else in the main Domoticz settings:
Domoticz_DeviceNotification_NotificationFlooding.png
Domoticz_DeviceNotification_NotificationFlooding.png (55.04 KiB) Viewed 988 times
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Re: offline device

Post by ssk17051980 »

there was a case where I saw that a temperature sensor had not been updated for 4 days.
it's a Sonoff SNZB-02. I had to re-pair it. I want to know when I have such situations, with sensors blocked or no longer transmitting.

thx for the solution
Attachments
Untitled.jpg
Untitled.jpg (98.85 KiB) Viewed 985 times
User avatar
waltervl
Posts: 5855
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline device

Post by waltervl »

kimhav wrote: Monday 28 August 2023 9:08
waltervl wrote: Sunday 27 August 2023 22:29I don't have that issue when using this function. I only get one notification when the last update is above a certain level.
Ok, interesting, so either a bug or error 40 on my side; here is the settings for the device notification, either I overlooked something very obvisious or it's something else in the main Domoticz settings:

Domoticz_DeviceNotification_NotificationFlooding.png
I see I have the "Ignore Interval" set to No. So perhaps that is the issue.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: offline device

Post by Kedi »

When you use zigbee2mqtt you could easily parse the file 'state.json' in the data dir below the zigbee2mqtt install dir.
In that file there is an field 'last_seen' which you could compare with the current time.
I found that when a device in that file has a last_seen of more then 1 day the device is not responding good anymore.
The 1 day is from my smoke sensor which only shows presence once a day to preserve battery.
The downside is that only has the ieeeAddr in it so you have to search for the right name of the device.
You could also parse the 'configuration.yaml' or 'devices.yaml' with the ieeeAddr for the right name.
Or just parse ALL the domoticz devices for a deviceId which starts with the ieeeAddr

Edit:
I meant parsing the file '/home/pi/zigbee2mqtt/data/database.db' and the field there is: lastSeen
Last edited by Kedi on Friday 01 September 2023 16:08, edited 1 time in total.
Logic will get you from A to B. Imagination will take you everywhere.
kimhav
Posts: 154
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Re: offline device

Post by kimhav »

waltervl wrote: Monday 28 August 2023 10:22I see I have the "Ignore Interval" set to No. So perhaps that is the issue.
Ok, I'll try chainging the "Ignore Interval" to No and let's see how it works out. :D Does this means that the the device notification will send an initial notification once the value has been meet, e.g no value for the last 15 min and then it will apply the system settings for notifications?
User avatar
waltervl
Posts: 5855
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: offline device

Post by waltervl »

I did not these this for such a short offline tracking so I don't know. I use 2800 minutes. You can check the global setting in menu setup - settings, tab notifications
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest