Device Notification on/off setting just like timers (active) Topic is solved

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
marmachine
Posts: 128
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Device Notification on/off setting just like timers (active)

Post by marmachine »

Hi,

I have the following usecase;
When i leave home i activate the "away" switch.
When "away" i want to receive notifications of motion- and doorsensors for example.

My request is:
What i would like to do is to toggle notification settings for specific devices to 'ON' (or active) just like i can with timers for each device.
When i am home, i don't need to be notified when there is movement in the house, especially not over and over again, day or night, so i'd like to turn OFF notification settings then and/or activate a second setting that would send notifications with different settings. (low priority)

I don't see this option in the JSON/API, this is where/how i would like to control the notification setting.

Thanks!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waaren »

marmachine wrote: Thursday 18 March 2021 12:11 When "away" i want to receive notifications of motion- and doorsensors for example.
I don't see this option in the JSON/API, this is where/how i would like to control the notification setting.
There is no active = true or active = false type of setting for notifications.

One way to workaround this would be to set the target notification system to one you do not use. In my case that would be kodi.

The 'deactivate' call would then look look like

Code: Select all

http://<domoticz ip:domoticz:port>/json.htm?devidx=54&idx=17&param=updatenotification&tmsg=&tpriority=1&tsendalways=false&tsystems=kodi&ttype=7&tvalue=0&twhen=0&type=command

The 'reactivate' call would then look look like

Code: Select all

http://<domoticz ip:domoticz:port>/json.htm?devidx=54&idx=17&param=updatenotification&tmsg=&tpriority=1&tsendalways=false&tsystems=email;fcm;http&ttype=7&tvalue=0&twhen=0&type=command
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
marmachine
Posts: 128
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by marmachine »

Excellent, thank you Waaren!
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Hello everyone,

I am French and sorry in advance if the translation is not quite correct.
I allow myself to raise this subject because despite several tests on two different machines under raspberry the workaround to disable a notification given by "waaren" does not work or no longer works.

Here is the Domoticz version:
Version: 2024.7
dzVents Version: 3.1.8
Python Version: 3.9.2

If you have an idea I am a taker.
Thank you and have a good day.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waltervl »

furtifc wrote: Wednesday 20 November 2024 16:27 Hello everyone,

I am French and sorry in advance if the translation is not quite correct.
I allow myself to raise this subject because despite several tests on two different machines under raspberry the workaround to disable a notification given by "waaren" does not work or no longer works.
So what is not working? You do not see the notification system on the selected device switch to for example only Kodi?

See also the wiki for all the know notification API calls: https://wiki.domoticz.com/Domoticz_API/ ... ifications
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Thank you for your answer, Yes that's exactly it, the notification on the selected device does not only go to kodi.

If I run the command line below via my browser on my PC here is the answer:

Code: Select all

https://192.168.1.14:443/json.htm?devidx=820&idx=30&param=updatenotification&tmsg=&tpriority=1&tsendalways=false&tsystems=kodi&ttype=7&tvalue=0&twhen=0&type=command
http://laudouard.hd.free.fr:25041/share ... pture1.JPG

I have the same error message with the function: Add device notification, while the order : Get device notifications it's ok.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waltervl »

A less complex API call like below is working (change deviceIDX)?

Code: Select all

IP:Port/json.htm?idx=<deviceIDX>&param=getnotificationtypes&type=command
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Yes it works. Screenshot on the link below

http://laudouard.hd.free.fr:25041/share ... pture2.JPG

Can you reproduce this malfunction at your level, am I the only one?
Thank you.
Last edited by furtifc on Wednesday 20 November 2024 18:24, edited 1 time in total.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waltervl »

Yes, I have the same issue with the documented API call.

But the good news is that the API has changed and now also is able to really enable and disable the notification with parameter tactive=false|true
The API you can use is for example to switch off and set only http as notification system.

Code: Select all

/json.htm?devidx=<devID>&idx=<ID>&param=updatenotification&taction=&tactive=false&tmsg=&tpriority=0&tsendalways=false&tsystems=http&ttype=7&tvalue=0&twhen=0&type=command
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waltervl »

I changed the wiki so it now is documented correctly:

Code: Select all

/json.htm?devidx=<DeviceID>&idx=<notificationID>&param=updatenotification&taction=<action command>&tactive=<true/false>&tmsg=<msgText>&tpriority=<pri>&tsendalways=<true/false>&tsystems=<list of notification subsystems>&ttype=<notificationType>&tvalue=0&twhen=0&type=command
Added is
taction=<action command>
tactive=<true/false>
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Too strong! It's perfect! It works very well and it's a feature that was missing.
Thank you very much for your responsiveness and availability.
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Hello,
I add a clarification, this command line does not support spaces in the message section: &tmsg=<msgText>

Via the pc browser it's ok, but not from the command of a domoticz switch it's no. If we replace the spaces with a _ it works.

example:
&tmsg=Opening balcony door& = error
&tmsg=Opening_balcony_door& = OK
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by waltervl »

You probably have to urlencode the message as indicated in the wiki.
&tmsg=Opening balcony door& = error
Will be
&tmsg=Opening%20balcony%20door%26%20%3D%20error
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

Hello,
Thanks for your feedback, it works well with the %20 on the spaces.

On the other hand, the disadvantage of the true or false of the notification via an Update device notifications is that the idx of the notification changes, strangely it is not systematically but sometimes the idx changes while the only modification of the command is the true or false. In script mode it poses a problem.
furtifc
Posts: 6
Joined: Wednesday 20 November 2024 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Paris
Contact:

Re: Device Notification on/off setting just like timers (active)

Post by furtifc »

The workaround by adding and removing the notification doesn't seem to work for me.

Same error message as at the beginning of the upgrade command.

Here is the tested command:

Code: Select all

http://<domoticz ip:domoticz:port>/json.htm?idx=93&param=addnotification&tmsg=test&tpriority=0&tsendalways=true&tsystems=fcm;http&ttype=7&tvalue=0&twhen=0&type=command
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest