Page 1 of 1

Enhancement - Specify GCM destination

Posted: Friday 09 February 2018 19:02
by antipiot
Hello all,

I did some search but couln't find anything related:

It would be great to be able to specify destination of GCM messages based on the list of available mobile devices or to any connected GCM devices as it work actually.

As we already can send test message to a specific device in the mobile devices section, can this be added easily?

The idea behind is that response for user specific interactions are returne to the specific user:
I get back home - Alarm is disabled based on my location - I get a notification the alarm is disable.

Kind regards,

Antipiot

Re: Enhancement - Specify GCM destination

Posted: Wednesday 28 February 2018 16:49
by ToxicTiger
Wondering if you managed to find an answer to this?

I can send the test message to an individual phone using the Mobile devices menu, but I can't find out a way to send a message from a script to a single mobile phone using GCM.
Is it possible using LUA?

Thanks

Re: Enhancement - Specify GCM destination

Posted: Thursday 01 March 2018 11:56
by ToxicTiger
I've been looking at how the Test message button on the Mobile Devices page works. It sends a json request:

http://xxx.xxx.xxx.xxx:xxxx/json.htm?type=command&param=testnotification&subsystem=gcm&extradata=midx_44

xxx.xxx.xxx.xxx:xxxx being my servers IP address and Domoticz port and midx_44 being my mobile device (obtained from the reading the HTML code behind the test button on the Mobile devices page).

When I enter this into a my web browser it send a test message to my mobile phone, just as expected.

So from, this I tested the following json, which I hoped would work:
http://xxx.xxx.xxx.xxx:xxxx/json.htm?type=command&param=sendnotification&subject=SUBJECT&body=BODY&subsystem=gcm&extradata=midx_44

This does send the message to my mobile, but unfortunately it ignores the extradata=midx_44, so it sends to all mobile devices registered on my Domoticz server.

Re: Enhancement - Specify GCM destination

Posted: Thursday 01 March 2018 15:44
by antipiot
Hello,

sorry for my late answer; i did not searched further for this:
Nice informations you got there tho, looking forward for this to work :-)