Page 1 of 1

Bug in enumerating Notifications

Posted: Wednesday 19 February 2025 17:45
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 584 times
Add a notification event:
add notification.png
add notification.png (71.28 KiB) Viewed 584 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 584 times
The database still contains the notification.

By chance does someone have a bright idea ?

Re: Bug in enumerating Notifications

Posted: Wednesday 19 February 2025 20:17
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

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 19:23
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 554 times
I receive an empty list:
notification disparue.png
notification disparue.png (28.61 KiB) Viewed 554 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 ?

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 19:49
by fdemees
Update: I have deleted the virtual switch, and I have deleted the second "Dummy" hardware device.
It did not resolve the problem.

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 21:45
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.

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 22:52
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 522 times

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 23:05
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.

Re: Bug in enumerating Notifications

Posted: Thursday 20 February 2025 23:08
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.