Hi Luma,
Glad you're following that emulator!
You have the exact same idea I have for integrating Echo and SONOS.
Best of all, my wife is actually using Echo now and won't admit it but likes the seamless integration and ease of use
To transfer the dimmer value intensity.percent to sonos, you just need to do this:
Create a Python Command Action (Add Action -> EventGhost -> PythonCommand)
In the text field add this:
Code: Select all
eg.plugins.Sonos.VolumeSet(u'RINCON_XXXXXXXXXXXXX1400', eg.event.payload[0])
replace RINCON_XXXXXXXXXXXXX1400 with your SONOS player. This value can be found in a sonos action with the zone player drop down.
Break down of the command:
Any action for any plugin can be called in this way.
eg.plugins. standard for any plugin action and must be included
Sonos - > Plugin name
VolumeSet - > Action
(u'RINCON_XXXXXXXXXXXXX1400', eg.event.payload[0]) - > Variables for the action
u'RINCON_XXXXXXXXXXXXX1400 - > SONOS Player
eg.event.payload[0] - > this is where the payload of the last Event is stored in EG. NOTE that the payload is a list which is why you need [0]
[0] is the first position of the list.
Note, you can get this string and the action variables for any action by adding the action in the GUI, copy the action, then paste into a text editor. This will reveal the plugin name and action variables. (ignore the XML data above and below this line). Also remember to add "eg.plugins." before the string if adding it to a python command or python script.
The other thing to note is if you try to manually activate this macro, the eg.event.payload might be empty or have some other value in it. This can cause an error. This macro should only be triggered by the proper event.