App suggestion - virtual switches for state communication with Homekit

Hi there -

I have been trying to work out how to add a virtual switch to my Hue setup - and ended up deep into APIs and CLIs trying to add a CLIPGenericFlag device….and it’s all above my head so i have given up!

However, i have bought your app, and think it would be a great addition to allow adding virtual switches - my use case is:

I have friends of hue switches (actually the reason i bought your app, the homekit and Hue config for these is so limited!) and i want to have the HOLD action on one of them run a homekit shortcut. Homekit only sees the PRESS actions on the switches and i need those for the actual lights, so i can’t just do this directly.

Since your app allows configuring the HOLD actions of the switch, it seems that if i had a virtual switch on the Hue bridge i could have that as the intermediary that both the app and Homekit can “see”. What do you think? Similar things exist for homekit (via homebridge dummy switch plugin) but i need the switch to be on the Hue bridge.

1 Like

Great idea! I made a similar suggestion before. We have a number of CLIPGenericFlag virtual switches used to activate or deactivate rooms (where off doesn’t mean completely off, just motion triggered presence light).

We use the Hue Essentials app with Deconz to control all lights, heating in our home. It works really well for the most part. Would be a shame to have to create a custom page somewhere else to control just these virtual switches.

We have a number of CLIPGenericFlag virtual switches

How did you create your CLIPGenericFlag switches? I’m still interested in this, my suggestion was for an easy way to create them in the app as I don’t know how to via the API. I am able to use the web debug console to log in to my Hue bridge but get stuck with how to proceed :frowning:

Sorry for the delay, I wanted to open source the project I was working on first. I create the virtual switches, and other automations, using a command line tool. Point it at a folder of resources defined as YAML and it will make the API calls required to create/update them.

Note: It’s only been tested on deCONZ so far, so your mileage may vary.

The challenge I now have is how to turn the virtual switches on/off easily from out mobile phones. Have it wired up to physical Aqara switches, but they’re the only thing we can’t easily turn on/off via Hue Essentials. Not sure how to at-mention the maintainer. :joy:

Hey thanks for that! Looking now…

I wonder if you could help a n00b out…

I have installed the package, and can communicate with my bridge. I created a YAML dri and file that I was hoping would give me a virtual switch i can see from Hue/Hue Essentials/HomeKit but I do not see the newly created switch…

Am I misunderstanding what should happen, or more likely I am just not using the tool correctly …?

My only YAML file contains:

resources:
  - kind: sensor
    name: virtual-switch-1
    type: CLIPGenericFlag

I left out the rule part in your example above as it seems like it extends the switch with a rule that I don’t want, I just want a virtual switch to appear which i will then use as a condition from other actions like using Hue Essentials to turn on something IF the switch is on etc.

The challenge I now have is how to turn the virtual switches on/off easily from out mobile phones.

This makes me think i might be misunderstanding - I thought the virtual switches would appear in the Home app, Hue Essentials etc just like other devices…anyway:

I added it seemingly successfully:

deploy from directory hue-deploy-yaml/
Update diff:
{“manufacturername”:“hue-deploy”,“modelid”:“virtual-switch-1”,“name”:“virtual-switch-1”,“recycle”:false,“swversion”:“1.0”,“type”:“CLIPGenericFlag”,“uniqueid”:“hue-deploy::sensor::virtual-switch-1”}
{“manufacturername”:“hue-deploy”,“modelid”:“virtual-switch-1”,“name”:“virtual-switch-1”,“swversion”:“1.0”,“type”:“CLIPGenericFlag”,“uniqueid”:“hue-deploy::sensor::virtual-switch-1”}
Updated /sensors/virtual-switch-1
Done

Wondering if you have time to help out?

Ahh… I downloaded the “all4Hue” app and can see the virtual flag…but I think I have misunderstood and it’s not going to do what I want, which is state tracking accessible from Hue, Home.app, and so on just like a Hue bulb would be, but without using a real device.

Will keep investigating, but suggestions would be gratefully recieved!