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.

For a dedicated scenario, i would like to use my domoticz to send notifications.

I looked at the API and didn't find any related to notification. I took then a look to the source code and saw the registered "sendnotification" command code.

Looking at the Cmd_SendNotification method, i found that using subject and body do almost what i want. But the message is sent to all the configured way of notification (NOTIFYALL).
Looking deeper, i found that the sendMessage is also used in the notification testing. You can here choose the subsystem but not the body and the subject.

I'm not able to provide a patch in C++ but it could be great to have a common sendNotification API that could be then used by the test system also.

Hi Egregius,
I'm ok with the fact that most of the systems can be used externally. My concern is to have a configuration of notification systems in domoticz and use them independently. On any device, we can choose the enabled notification systems and we have two APIs that cover each a half of the feature, one enables the use of a specified system, the other one the posibility to define the subject and the body.

I do not know C++ but i will try to understanf how it works and propose a patch.

About your question, i use the domoticz app on my phone that send notifcations on my smartwatch, it could be one i want to use.

With this patch, you can use the API to send notifications using the domoticz configuration from the outside. The addition is the ability to choose the subsystem in: email,gcm,http,kodi,lms,nma,prowl,pushalot,pushbullet,pushover,pushsafer,clickatell

Note: if no subsystem is set, the default configuration is used and all the configured system are used (NOTIFYALL)
Best regards,
U

With my patch: you can still use the previous one, the behavior is the same and you can add the subsystem like:
http://<domoticz_ip>:8008/json.htm?type=command&param=sendnotification&subject=subject&body=thebody&subsystem=email

Even if it works on my install, I built this code by mimetic. So i do not think i'll do a pull request.
Best regards,
U.

sorry, but I didn't yet get how to use it in the latest beta with LUA script. Could you please post an example, especially with highest priority (2) where you can set reminder time, etc. according to Pushover API? I want to use it to alert me when the alert system detects intrusion, and thus it should make a lot of noise.

- Subject is .. the subject
- Body is the content of the message
- 0 is the priority that you are talking about
- sound is the sound you want to use if you use pushover
- extradata can be used by some of the notification. Will not describe it

I added subsystem that is a ';' separated list of the notification subsystems you want this notification to bent through.
If you let subsystem empty, it will be sent through all the configured way, like in previous implementation.
The current available subsystems are:

gcm
http
kodi
lms
nma
prowl
pushalot
pushbullet
pushover
pushsafer

For example, if you want to use kodi and pushbullet, you need something like:
commandArray['SendNotification']='subject#body#0#sound#extradata#kodi;pushbullet'

Just found out about this. Wow, works great, thanks! I never really needed it before because I had only set up one notification system. But now I also started using my Sonos speakers for notifications. This gave errors when a generic notification was sent from a LUA script, since the Sonos notification system (Python plugin version) expects special commands like a mp3 file name and a volume. Now these errors are gone!

yfaykya wrote:Trying to change the image using extradata for a kodi notification.

I have tried :
commandArray['SendNotification']='Gates Opened#'..otherdevices['Gate Open Reason']..'#Image=/home/pi/domoticz-binary/www/images/door48open.png###kodi;pushbullet'