Trying to have Device Comm State set Variable

Posted on
Sat Dec 22, 2018 9:27 am
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Trying to have Device Comm State set Variable

I have 3 Philips HUE bulbs, and I have 2 custom control page buttons that fire off these actions:

Button 1: "Disable Device" x 3 Bulb Devices
Button 2: "Enable Device" x 3 Bulb Devices

We normally have the bulbs turn on/off when certain doors are opened/closed, but if it is very late or early, I disable the bulbs temporarily so as not to wake anyone up.

I guess this would be considered "Disabling Comms" or "Enabling Comms".

Now I would like a true status of each of the devices "Comm State".

I was looking for a way to have the Comm State set 3 different variables to True or False, and from there I can do what I need.

But I can't find a way in the UI to have a Comm State change set a variable, but I might be missing it.

To be clear, I am not talking about whether the device itself is ON or OFF, but whether comms are ENABLED or DISABLED for each device within Indigo.

I am using the Hue Lights Plugin 1.6.x & Indigo 7.2.

Posted on
Sat Dec 22, 2018 10:43 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Trying to have Device Comm State set Variable

The comm state isn't reflected in a device state (I'll add that to the feature request list), so it isn't currently possible to create a trigger when the comm state changes.

Instead you can create a scheduled action that fires every minute (duration depending on your requirements) that runs a script like this:

Code: Select all
dev1_enabled = indigo.devices[DEVICE 1 ID HERE].enabled
dev2_enabled = indigo.devices[DEVICE 2 ID HERE].enabled
dev3_enabled = indigo.devices[DEVICE 3 ID HERE].enabled
indigo.variable.updateValue(VAR 1 ID HERE, str(dev1_enabled))
indigo.variable.updateValue(VAR 2 ID HERE, str(dev2_enabled))
indigo.variable.updateValue(VAR 3 ID HERE, str(dev3_enabled))

Image

Posted on
Sat Dec 22, 2018 12:15 pm
sumocomputers offline
Posts: 267
Joined: Jun 23, 2008

Re: Trying to have Device Comm State set Variable

This did the trick, thank you very much!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests