Homebridge and Virtual Devices

AndyVirus
Posts: 257
Joined: Tue Mar 18, 2014 11:47 am
Location: Newport Pagnell, UK

Homebridge and Virtual Devices

Post by AndyVirus »

Hello,

I have set up a virtual device which is basically On/Off that triggers an action group per state.

If I control via Indigo, On fires one Action Group and Off fires the other as expected.

If i then add this Virtual Device to HomeKit, when turn it on, it fires the on Action group but when in turn it off, nothing happens. It turns off in homkit but not Indigo and does not execute the action group. The indigo log confirms this, no Off command was sent to Indigo.

Any ideas?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Homebridge and Virtual Devices

Post by FlyingDiver »

I ran into this with some virtual devices I created. HomeKit requires that it get the correct state for the device. You need to set up a variable to hold that state, identify it in the Virtual Device config, and add actions to the action groups to change that state variable.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Homebridge and Virtual Devices

Post by jay (support) »

FlyingDiver wrote:I ran into this with some virtual devices I created. HomeKit requires that it get the correct state for the device. You need to set up a variable to hold that state, identify it in the Virtual Device config, and add actions to the action groups to change that state variable.
Or use the Set Virtual On/Off Device State action in your existing action groups to update it's status to on or off. You don't have to use a variable (just set it directly).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Homebridge and Virtual Devices

Post by FlyingDiver »

jay (support) wrote: Or use the Set Virtual On/Off Device State action in your existing action groups to update it's status to on or off. You don't have to use a variable (just set it directly).
Learn something new every day. ;)
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Homebridge and Virtual Devices

Post by jay (support) »

FlyingDiver wrote:Learn something new every day. ;)
Yeah - as I was writing that, it occurred to me that you might not know about that action. It's the pattern I'd use on any thin "shim" device that don't have any built-in commands to modify the device (like a sensor): create specific actions to update the known properties/states.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
tcherna
Posts: 24
Joined: Sat Apr 14, 2018 8:48 pm

Re: Homebridge and Virtual Devices

Post by tcherna »

Jay, do you still need to bind the Virtual Device to a variable when using the direct method above? It seems like I need to in any case if I want the device's status monitored.

Incidentally, the device is working in this case, but I'm not seeing the variable update in the variable list window.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Homebridge and Virtual Devices

Post by jay (support) »

tcherna wrote:Jay, do you still need to bind the Virtual Device to a variable when using the direct method above?
No. This will directly alter the device's state without a variable (we added it explicitly so that you didn't have to use a variable, which was a frequent request).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
tcherna
Posts: 24
Joined: Sat Apr 14, 2018 8:48 pm

Re: Homebridge and Virtual Devices

Post by tcherna »

So how do I create the virtual device without creating a variable and still have it report status. When I click the status checkbox it forces a variable.

See my post in viewtopic.php?p=183673#p183673 for what I've actually attempted.

Thanks :)
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Homebridge and Virtual Devices

Post by jay (support) »

You don't need to check the status checkbox.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
tcherna
Posts: 24
Joined: Sat Apr 14, 2018 8:48 pm

Re: Homebridge and Virtual Devices

Post by tcherna »

Ah, ok it's working. Not sure what I did differently (this time I unchecked and deleted the variable). Thanks Jay!
Post Reply

Return to “HomeKit Bridge”