Messages app plugin

Posted on
Mon Jan 08, 2018 7:14 pm
Colorado4Wheeler offline
User avatar
Posts: 1409
Joined: Jul 20, 2009
Location: Colorado

Re: Messages app plugin

Try making your props a dictionary rather than a list and do it before the call and simply pass the dict to the executeAction rather than building it there. You used "[]" instead of "{}" for your definition, so list instead of dict.

My Modest Contributions to Indigo:

Homebridge Buddy | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser

Check Them Out Here

Posted on
Mon Jan 08, 2018 7:17 pm
Colorado4Wheeler offline
User avatar
Posts: 1409
Joined: Jul 20, 2009
Location: Colorado

Re: Messages app plugin

rycardo wrote:
Could it be your mix of single and double quotes?


You can single and double quote interchangeably in Py, and it comes in handywhen you need to quote strings so these two statements are accurate:

Code: Select all
indigo.server.log ("Hello '{0}', I'm very happy to meet you".format("Joe"))
indigo.server.log ('Hello "{0}", I'm very happy to meet you'.format('Joe'))


rycardo wrote:
you might need quotes or double quotes around your JSON data.


That's not JSON data, it's a Py list as he pasted it and a Py dict as defined by the Indigo API.

Of course it's been a long day of coding and everything is blurry so he could have written C++ as far as I know :lol:

My Modest Contributions to Indigo:

Homebridge Buddy | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser

Check Them Out Here

Posted on
Tue Jan 09, 2018 12:22 pm
jay (support) offline
Site Admin
User avatar
Posts: 13475
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Messages app plugin

You're very close: deviceID (the second param) should be deviceId in the executeAction call (notice the lowercase 'd' at the end):

Code: Select all
messagesPlugin.executeAction("sendMessage", deviceId=184726458, props={'message':"Hello Bruce", 'service':"E:*******@gmail.com", 'handle':"+15555551212"})

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jan 10, 2018 1:53 pm
bhough17 offline
Posts: 2
Joined: Jan 04, 2018

Re: Messages app plugin

Nailed it.

Thanks

Who is online

Users browsing this forum: dduff617 and 2 guests