Getting (re) started with Indigo/Insteon and Homekit

Posted on
Fri Oct 25, 2019 8:36 pm
tcherna offline
Posts: 24
Joined: Apr 14, 2018

Getting (re) started with Indigo/Insteon and Homekit

Hi, I'm a long time Indigo / Insteon user. I'm just in the process of trying to improve my config, as I've just updated from 7.1 to 7.4 and there are some new things, so I'm looking for best practices these days.

Most of my config are two way Insteon switches, with a few cases of Insteon keypads where I'd like the button to control / and update on changing a load. I also use Control pages, where typically I use something like:

Code: Select all
lamp = indigo.devices["Kitchen Island (K)"]
sceneNum = 26

lightOn = 0
if hasattr(lamp, 'onState'):
   lightOn = lamp.onState

if lightOn:
   indigo.insteon.sendSceneOff(sceneNum)
else:
   indigo.insteon.sendSceneOn(sceneNum)


to control the combinations via scenes. Now I'm wondering what the best way to expose these to HomeKit, since I can easily expose the load, but then the matching controller doesn't change.

It looks like virtual devices are new... I guess I could create an action group pair (on and off) for each scene? (can a single action group be sent an on or off)? and then hook the HomeKit device to a virtual device?

In any case, I'm sure some of you have done this already, and I'd love the latest tricks!

Posted on
Fri Oct 25, 2019 9:39 pm
rehafer offline
Posts: 279
Joined: Feb 08, 2013

Re: Getting (re) started with Indigo/Insteon and Homekit

I usually use a Virtual Switch with an on Action Group and an off Action Group; with commands to turn the indicator LEDs on and off. Link the Virtual Switch to the Keypadlinc and Homekit and things stay nicely in sync. And, I always use a Variable to track on/off state.
There may be better ways, but this works for me.



Sent from my iPhone using Tapatalk

Posted on
Sat Oct 26, 2019 11:41 am
tcherna offline
Posts: 24
Joined: Apr 14, 2018

Re: Getting (re) started with Indigo/Insteon and Homekit

Ok, here is what I did:

1) I linked a button on a keypad to a switch ("cc"), and the switch to the button, so that without Indigo, both are controlled together.
2) I created an empty virtual switch, "cc virtual"
3) I created a pair of action groups, "cc on" and "cc off". They control the state of the switch, the keypad button and set the device state of "cc virtual" to on/off respectively.
4) I created a variable "cc var"
5) In the virtual switch, I set "cc on" and "cc off" as the action groups for on/off, and "cc var" as the variable. I left the toggle action empty
6) I created a pair of triggers based on the switch "cc" changing, which sets the virtual switch state on and off.

At this point, the virtual switch matches the state of the light and keypad, and I can send it on and off actions and the light and keypad follow.

7) For my control page, I created the following script to account for the lack of toggle behavior

Code: Select all
lamp = indigo.devices["CC Virtual"]

lightOn = 0
if hasattr(lamp, 'onState'):
   lightOn = lamp.onState

if lightOn:
   indigo.device.turnOff("CC Virtual")
else:
   indigo.device.turnOn("CC Virtual")


8 ) For HomeKit, I just created a new device for "CC Virtual"

At this point, the control page and HomeKit are working.

Any thoughts on changes or improvements?
a) It wasn't obvious that I needed to create "cc var" since I'm using the Set Virtual On/Off Device State command. I also note that it doesn't change the value as shown in the Variable List window, which seems odd.
b) I decided to not use a PowerLink scene to control the state of the button/light since indigo is involved in HomeKit and the control pages anyway
c) I wasn't sure how to make a toggle ActionGroup, which would have saved having a script on step 7.
d) Speaking of, can I access the virtual switch state / variable instead of querying the lamp onState in the script? Would that be better?

Posted on
Sat Oct 26, 2019 3:41 pm
tcherna offline
Posts: 24
Joined: Apr 14, 2018

Re: Getting (re) started with Indigo/Insteon and Homekit

Looks like I didn't need step 4 or to select the status, which answers my question in a)

:)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests

cron