chase wrote:I would like to use iMessage for my primary notifications method.
I would also like to use the DeviceIDs, VariableIDs to minimize hardcoding the message text, and reduce the number of triggers I need to maintain.
I can't find any documentation of parameters available. I have had some success combining the documentation and using educated guesses, but a listing would be handy.
Example: I want to send an iMessage every night @ 9:00 pm with the status of a deadbolt lock. The sensor is an Insteon hidden door sensor which has states of on on/off. I am using the EPS-Device extensions to create a new device 'Garage Deadbolt' with States of Locked/Unlocked (EPS-Device Extensions devices are working as needed).
I was hoping to make an iMessage send the Device Name and the Device State.
%%d:710933748:DeviceName%% is %%d:710933748:OnOffState%%
DeviceName, Name, etc all return errors. ( iMessage Plugin Error Device id 710933748 or state id DeviceName not found for substitution )
OnOffState gives a result of True or False. ( I am looking for the State text to be returned (either 'Locked' or 'Unlocked'))
The desired iMessage text would be
Garage Deadbolt is Locked
Any thought on how to do this? Is it possible?
Hi
Back again
onOffState = onOffState, note missing captilisation.
If uncertain as to what states certain device has, would suggest
-Indigo Plugins Open scripting Shell
- Go to device - Right click device - select 'Copy Python Reference"
Go back to Scripting shell
type print and then paste above
end will be something like:
print indigo.devices[1325699550] # "FrontDoor Lock Indigo"
This will print all the device info - including correct spelling.
Have a look for States:
For my locks - seems like
onOffState.ui- would be ideal
But for some reasons indigo substitution %%d: doesnt work for this state... probably because of .ui - but quotes, escaping doesn’t seem to help...
Couple of options
Could use EPS-Device Extensions - set up one for each door lock and link to the state within these Device Extensions devices with substitution
or
Use python script to create and then send the message:
Would depend on your states available, and need to change buddyId to correct email address for buddy.
- Code: Select all
doorstatus = indigo.devices[1325699550].displayStateValUi
name = indigo.devices[1325699550].name
messagevariable = name + " is " +doorstatus
imessageID = 'com.GlennNZ.indigoplugin.iMessage'
imsgPlugin = indigo.server.getPlugin(imessageID)
imsgPlugin.executeAction('sendMessage', props={'message':messagevariable, 'buddyId':'me@myemail.com'})
Glenn