Send notification to Domoticz lite app.

Moderator: leecollings

Post Reply
brjhaverkamp
Posts: 56
Joined: Wednesday 06 December 2017 16:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Send notification to Domoticz lite app.

Post by brjhaverkamp »

Hello all,

I am trying to send notifications to the domotic lite app, preferably to one specific mobile device.
The test messages are working OK, both in the mobile device panel as in the notification tab under settings.

As I understand the format of the Lua command should be
commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem'.

I have tried various ways. As I understand the subsystem needs to be gcm.
But I havent been able to send a message to my mobile succesfully.

Does anyone have a hint or example on how to get this working?

Regards,

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

Re: Send notification to Domoticz lite app.

Post by waaren »

brjhaverkamp wrote: Tuesday 13 November 2018 8:55 I am trying to send notifications to the domotic lite app, preferably to one specific mobile device.

As I understand the format of the Lua command should be
commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem'.

Does anyone have a hint or example on how to get this working?
Please include the relevant part of your script. Your understanding of the format is correct.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brjhaverkamp
Posts: 56
Joined: Wednesday 06 December 2017 16:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Send notification to Domoticz lite app.

Post by brjhaverkamp »

Hi Waaren,

I can't reach the event right now unfortunately. But basically I tried a lot of different variations of
commandArray['SendNotification']='Notice#Alarm####gcm'

But nothing gets through.

Regards,

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

Re: Send notification to Domoticz lite app.

Post by waaren »

brjhaverkamp wrote: Tuesday 13 November 2018 15:00 I can't reach the event right now unfortunately. But basically I tried a lot of different variations of
commandArray['SendNotification']='Notice#Alarm####gcm'
But nothing gets through.
Without the eventscript at hand it is very hard to help.
In dzVents this code snippet

Code: Select all

domoticz.notify("Domoticz", "test", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , domoticz.NSS_GOOGLE_CLOUD_MESSAGING)
works as expected.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brjhaverkamp
Posts: 56
Joined: Wednesday 06 December 2017 16:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Send notification to Domoticz lite app.

Post by brjhaverkamp »

Hi Waaren,

Well currently my event script literally is:
--------------------------
commandArray = {}

-- commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem'.
commandArray['SendNotification'] = 'Subject5###8##gcm';

return commandArray
------------------
the value 8 was my last attempt to play with the priority..
The related log looks like this:
2018-11-13 16:59:13.828 Status: EventSystem: Script event triggered: Test notification
2018-11-13 16:59:13.834 Status: Notification: Subject5

I will try your dzVents line tonight. Thanks for this. Hopefully it will show me the way forward.
But meanwhile, if anyone has a working gcm sendnotification setup, I'd like to hear about it.

Regards,

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

Re: Send notification to Domoticz lite app.

Post by waaren »

brjhaverkamp wrote: Tuesday 13 November 2018 17:02 Well currently my event script literally is:

Code: Select all

commandArray = {}

-- commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem'.
commandArray['SendNotification'] = 'Subject5###8##gcm';

return commandArray
the value 8 was my last attempt to play with the priority..
Just tested with this in an internal Lua script and it works without any problem. I am on the latest Beta and RPI3 with Debioan Stretch.

commandArray['SendNotification'] = 'Subject5#test####gcm';
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
brjhaverkamp
Posts: 56
Joined: Wednesday 06 December 2017 16:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Send notification to Domoticz lite app.

Post by brjhaverkamp »

Hi Waaren,

Much appreciated! I at least have something to check against.
I will doublecheck all setting. At least I know now that this line _should_ work!

Regards,

Bert
brjhaverkamp
Posts: 56
Joined: Wednesday 06 December 2017 16:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Send notification to Domoticz lite app.

Post by brjhaverkamp »

Just to finish the thread.
I got it working now as well.
With embarrassment I have to admit that the gcm notification was disabled...
I probably only pressed test, and forgot to enable it, or enabled it and forgot to press apply at the top of the page.
Anyways, I got a lot of noise coming out of my phone when the alarm goes of.

I havent been able to send messages to individual users. There is sourcecode to enable this when you fill in midx_xx for the extradata parameter.
I have to look into this a bit deeper still.

Ciao,

Bert
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest