https://github.com/FlyingDiver/Indigo-M ... /tag/0.4.0
There's a new tab in the device configuration dialog for enabling variable and device commands. There's also a text field for specifying the template (regex) for the topic. The default device command template is:
- Code: Select all
indigo/devices/(?P<id>.*)/command/(?P<cmd>.*)
The first, second, and fourth fields are arbitrary and can be changed (or deleted) as needed. The third field specifies that the device ID goes there. The fifth is where the command goes. You can re-order or delete fields as desired. Just make sure the ID and command fields are entered exactly as written. Also, make sure that the specified topic does NOT match any other topic received by the broker device. Specifically, this topic CANNOT be the same as the any updates sent by or to the device.
The last (<cmd>) field can contain any of these:
- on
- off
- toggle
- set (payload = 'on' or 'off'
- brightness (payload = 0-100)
- brighten (payload is positive or negative integer, eg -10, -50, 20, 40)
These are valid commands using the default template:
- Code: Select all
indigo/devices/117988686/command/off
indigo/devices/117988686/command/on
indigo/devices/117988686/command/set -> on
indigo/devices/117988686/command/set -> off
indigo/devices/587622500/command/brightness -> 0
indigo/devices/587622500/command/brightness -> 50
indigo/devices/587622500/command/brightness -> 100
For variables, it's almost the same:
- Code: Select all
indigo/variables/(?P<id>.*)/command/(?P<cmd>.*)
All the same rules apply. Commands available are:
- set (payload is new string value of the variable)
- clear (variable will be set to "")
- Code: Select all
indigo/variables/117988686/command/set -> "This is a test"
indigo/variables/117988686/command/clear