Page 1 of 1
Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 8:55
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
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 12:30
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.
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 15:00
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
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 15:23
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.
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 17:02
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
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 19:14
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';
Re: Send notification to Domoticz lite app.
Posted: Tuesday 13 November 2018 20:38
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
Re: Send notification to Domoticz lite app.
Posted: Thursday 15 November 2018 19:13
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