Pre-release 0.4.0 - Device and Variable actions

Posted on
Sat Mar 28, 2020 9:24 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Pre-release 0.4.0 - Device and Variable actions

The pre-release implements MQTT topic commands to set variables or command devices.

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:

  1. on
  2. off
  3. toggle
  4. set (payload = 'on' or 'off'
  5. brightness (payload = 0-100)
  6. 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:

  1. set (payload is new string value of the variable)
  2. clear (variable will be set to "")

Code: Select all
indigo/variables/117988686/command/set -> "This is a test"
indigo/variables/117988686/command/clear

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Mar 28, 2020 9:27 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Pre-release 0.4.0 - Device and Variable actions

It very important that you ensure your MQTT server is secure before enabling these commands. At a minimum, password authentication should be enabled. I would also highly recommend SSL/TLS as well. See the documentation for your broker on how to enable that. The plugin already supports these security features.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests