Indigo variables in the On/Off/Toggle Action Payload Fields

Posted on
Tue Dec 22, 2020 6:59 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Indigo variables in the On/Off/Toggle Action Payload Fields

Good morning all.

I can't seem to wrap my head around how to handle a switch device that has 3 different endpoints. I have sucessfully deployed several Hue lamps and I can switch them on/off without any problem, because they all support a single endpoint (e.g.: "state": "ON" to turn the light on; "state":"OFF" to turn it off).

Now, I also got a few Zigbee Nue/3A Smart switches, which carry 3 different load touch "buttons", but unfortunately seem to export a single device, with 3 endpoints, instead of 3 separate devices with a single endpoint like above... e.g: {"state_bottom"::"ON", "state_center":"OFF", "state_top":"OFF"}. This makes switching separate buttons much more complex, as you don't want to switch off the center and bottom loads when you try to switch the top button, for instance.

After much trial and error, I came out with the idea of using Indigo variables and filling their values programatically.. I developed a set of different python scripts to fill the value for the Botton, center and top variables. The python scripts work and I can put whatever I want inside the variables. Once the individual bottom, center and top variables are filled, I then also programatically fill a fourth variable with the payload I want to send.

The problem now, of course, is I can't seem to find how to reference Indigo variables inside the On Action Payload / Off Action Payload / Toggle Action Payload field in the Shim devices...

So the question is: Is this even supported?

TIA
Cesar
Attachments
Screen Shot 2020-12-22 at 09.31.53.png
Screen Shot 2020-12-22 at 09.31.53.png (18.13 KiB) Viewed 1268 times
Screen Shot 2020-12-22 at 09.30.55.png
Screen Shot 2020-12-22 at 09.30.55.png (95.5 KiB) Viewed 1268 times

Posted on
Tue Dec 22, 2020 7:16 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

To answer your immediate question, I did not enable variable substitution for those fields. I can add that to the plugin if necessary, but let's see first if that's the best way to handle this situation.

I did a little research, and this appears to be a load controller with no user controls on it. That is, there's no actual buttons or switches on the device. It's solely controlled via MQTT. Is that correct?

Can you point me to any documentation on the MQTT topics and payloads for this device? I'm having a hard time understanding the requirements to make the device work with MQTT. I suspect you're making the solution more complicated than it needs to be.

Are you ONLY controlling via MQTT or is there some other Zigbee devices that can send commands to the device and change it's states? If there is, do you have examples of the topics & payloads that the device publishes when it changes state(s)?

It seems to me that a better solution would be to figure out a way to handle this as three distinct Shim devices, rather than one device with three "endpoints".

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

Posted on
Tue Dec 22, 2020 8:04 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

Wow, that was fast!

In fact, it does have three touch buttons. Each button control a separate load. Aparently they are refered to as "bottom", "center" and "top".
I'm also trying to handle each endpoint as a separate shim device, with 6 different triggers (2 for top (on/off), 2 for center (on/off) and 2 for bottom (on/off). The image above is from the top shim device. I can already control it from Indigo and the loads engage and disengage correctly on the device. But, once I try to control the top button shim device in Indigo, the middle and the bottom shim device in Indigo turns off (but not on the actual device). Kind of hard to explain in words... Ideally I would also like to have the triggers fire when someone touches the buttons on the device itself, but I'm concentrating on controlling it from Indigo now. If I use MQQT Explorer to post a payload, the loads also engage/disengage correctly on the device.

Here is the actual device I'm using: https://www.zigbee2mqtt.io/devices/HGZB-43.html

Best regards,
Cesar

Posted on
Tue Dec 22, 2020 8:28 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

I don't understand why you would need six triggers. One should suffice:

Screen Shot 2020-12-22 at 9.30.08 AM.png
Screen Shot 2020-12-22 at 9.30.08 AM.png (155.1 KiB) Viewed 1241 times


Then the first device would look like:

Screen Shot 2020-12-22 at 9.23.42 AM.png
Screen Shot 2020-12-22 at 9.23.42 AM.png (355.82 KiB) Viewed 1245 times


If you do that, does that one device work properly? Does it effect the other two loads? If not, please capture the MQTT traffic using the Connector's debug log and post that. Text using CODE tags, not screen shots. If I have the exact messages I can simulate it on my system.

If it does work, create two more devices exactly the same the as first one, but change all references to "state_top" to "state_center" and "state_bottom" and test again.

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

Posted on
Tue Dec 22, 2020 8:30 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

Many thanks for your continued support. I will try your recommendations above and will post back in a short while.

Posted on
Tue Dec 22, 2020 8:31 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

I changed the trigger. Please see revised screen shot.

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

Posted on
Tue Dec 22, 2020 8:57 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: Indigo variables in the On/Off/Toggle Action Payload Fie

Dear Joe,
You were indeed right: I was overcomplicating it.
Let me tell you and everyone here you are a true genius. You solved, remotely, in less than five minutes, something I have been struggling with for DAYS.

I can now control each endpoint individually from Indigo's GUI, by clicking on the "Turn On" and "Turn Off" buttons of the corresponding bottom, center or top shim device and it doesn't interfere with the other endpoints..

That not only means each load stay on if previously on, off previosuly off. Additionally, touching each individual touch button on the device itself also fire the SOLE trigger and the corresponding shim device turn on/off on the Indigo interface.

I'm flabbergasted at how simple you've made it.

I wish you and your family and friends Happy Holidays.
Stay safe!
Cesar

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron