Bug in enumerating Notifications Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
fdemees
Posts: 18
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Bug in enumerating Notifications

Post by fdemees »

Domoticz version 2024.7
running on Rpi 3B+ / debian 11.11
6 Hardware devices in Dz: Dummy, SMA onduleur, MQTT local, Meteo NL (buienradar), Zigbee ITEAD_SONOFF_Zigbee_3.0, and a second instance of Dummy with less logging.

Hello, this is a translation of my article in the French forum, which did not get any reply since several days.
(link: https://easydomoticz.com/forum/viewtopic.php?t=14309)

The problem lies with all my switches where notifications have been set, but cannot be retrieved from the UI.
When peeking into the database, the notifications are correctly set in the table 'Notifications', and they are executed when applicable.

Example: I have a switch (virtual device #124) which is triggered by the alarm system, when the alarm is activated/armed and another trigger when it is disarmed. Dz receives the event via http. The link between the alarm system and Dz is not questionable here.

The same problem occurs with notifications on all devices.

Example of a device, here #124
device 124.png
device 124.png (27.47 KiB) Viewed 577 times
Add a notification event:
add notification.png
add notification.png (71.28 KiB) Viewed 577 times
The database contains the notification:

Code: Select all

# sqlite3 domoticz.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite> select * from Notifications;
...
53|124|S|Alarme maison armée|email;telegram|0|0|0||1
On the swich widget, the Notifications button has become purple instead of blue.

Click on notifications, and the list is now empty
notification disparue.png
notification disparue.png (28.61 KiB) Viewed 577 times
The database still contains the notification.

By chance does someone have a bright idea ?
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares
User avatar
waltervl
Posts: 5897
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Bug in enumerating Notifications

Post by waltervl »

How do you trigger the switch device 124? With an JSON API call?
What is the call you use? As some commands like &param=udevice do not trigger actions, so use the &switchcmd option.
https://wiki.domoticz.com/Domoticz_API/ ... eral_notes
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
fdemees
Posts: 18
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Re: Bug in enumerating Notifications

Post by fdemees »

Hello @waltervl

Here is the command issued by the alarm system: /json.htm?type=command&param=switchlight&idx=124&switchcmd=On

The problem is not related with the triggers. It is simply that the UI does not retrieve the Notifications associated with the device.
When clicking on this button:
notification confirmée.png
notification confirmée.png (20.62 KiB) Viewed 547 times
I receive an empty list:
notification disparue.png
notification disparue.png (28.61 KiB) Viewed 547 times
BTW you are talking about udevice. I have been searching for a way to avoid the pollution in the logs for another http verbose device. (any presence under any of the IR detectors in the house). Either use udevice= , or create a second instance of hardware "Dummy" with less logging, and one virtual switch child...
Suddenly, while we are discussing this, I wonder whether 2 instances of the dummy device could be the cause of the malfunction of the UI ?
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares
fdemees
Posts: 18
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Re: Bug in enumerating Notifications

Post by fdemees »

Update: I have deleted the virtual switch, and I have deleted the second "Dummy" hardware device.
It did not resolve the problem.
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares
User avatar
waltervl
Posts: 5897
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Bug in enumerating Notifications

Post by waltervl »

Perhaps try to create a notification without special characters like é
It could be a encoding issue on the website.

Also check with getnotification API call for your device to see if you get the notification.

Code: Select all

/json.htm?idx=<deviceIDX>&param=getnotificationtypes&type=command
If the notification is listed the perhaps try to open the webgui in a private/incognito websession to see if it solves 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
fdemees
Posts: 18
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Re: Bug in enumerating Notifications

Post by fdemees »

Hello,
Dear @waltervl,

After having removed he second Dummy hardware instance this afternoon, I checked that the Notifications still didn't show.

Then, while redacting this reply: I have installed the Android app ; I have called the API as you suggested above ; I have rebooted the RPi.
And miracle: everything is now normal! So I don't know which action did what.
I hate such mysteries. :o

I thank you a lot ;)
-- -- --
So, below you will find my initial text with database, API and Android app showing device #124.

extract of table: Notifications:

Code: Select all

53|124|S|Alarme maison armée|email;telegram|0|0|0||1
API call: wget "127.0.0.1/json.htm?idx=124&param=getnotificationtypes&type=command"

Code: Select all

{
        "result" :
        [
                {
                        "ptag" : "S",
                        "text" : "Switch On",
                        "val" : 7
                },
                {
                        "ptag" : "O",
                        "text" : "Switch Off",
                        "val" : 16
                }
        ],
        "status" : "OK",
        "title" : "GetNotificationTypes"
}
The Android app shows the notification (before the reboot):
Screenshot_20250220_222911_Domoticz.jpg
Screenshot_20250220_222911_Domoticz.jpg (64.23 KiB) Viewed 515 times
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares
User avatar
waltervl
Posts: 5897
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Bug in enumerating Notifications

Post by waltervl »

Great that it is working again. I doubt that re-installing the Android app solved the issue. But also I have no idea what really solved it.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
fdemees
Posts: 18
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Re: Bug in enumerating Notifications

Post by fdemees »

I have been able to reproduce.
The culprit seems to be the second Dummy Hardware instance (although I gave a different name: "virtual (nolog)" instead of "virtual" )
The Notifications could not be displayed anymore for any switch.
Removing the additional hardware device and refreshing the browser cache ... and voilà everything is back.

Also I have now discovered that udevice triggers the notifications although the documentation seems to indicate that no subsequent action would occur following udevice. The "Last seen" indicator is also updated.
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest