Virtual Device for Home Assistant

I am looking for a way to create a virtual device in Homey, then share it to Home Assistant and have Home Assistant be able to control it.

What I am trying to do is this: I have an “alarm” set up - it’s a flow to let us know if our cat opens the screen door. I also have a button setup to where if you push it once, it disables that flow, and press it twice to re-enable the flow.

I want to be able to have the button also activate a virtual switch that is shared with Home Assistant. I want this because I want the voice assistant in HA to, after the anti-cat escape flow has been disabled for a number of minutes, to ask us if we want the flow re-enabled. Unfortunately, our son sometimes disables the alarm and forgets to re-enable it - we live near a very busy road and don’t want our cat to get hurt.

I have the official Homey virtual device app, and the community one. Both have let me make a device that is shared in HA - but both result in a virtual device in HA which is seen as “state unknown.” I can actually click the device in HA and it turns off/on in Homey - but HA itself never seems to know the state, so I am unable to use it as a trigger for an automation in HA.

Does anyone know how I can accomplish what I am trying to do?

2 Likes

If I understand you right, you don’t have to share it from Homey to HA, you can do it the other way around - from HA to Homey, then all activities on any side, will be synchronized. For that you can use great app - Home Assistant Community App for Homey | Homey

The rest is then up to you how you will do it.

Yeah, I have that app, and it works great for getting devices from HA into Homey, but I have not found a way to make a simple virtual device (like a switch) in HA, I am actually starting to think HA lacks this basic function (like it lacks the ability to delete devices). HA seems great, but at times it’s like they focus so much on advanced features that they overlooked the basics…

Home Assistant doesn’t have “virtual devices” per se, but you can very easily create a switch-like helper.


1) Via the UI (Helpers)

  1. Go to Settings → Devices & Services → Helpers
  2. Click Add Helper
  3. Choose Toggle
  4. Give it a name (e.g. “My Virtual Switch”) and an icon if you like
  5. Save.

You’ll now have an input_boolean.my_virtual_switch entity you can toggle just like a switch.

ok!! I think this was a huge step in getting what I need, so THANK YOU for that! But now my issue is I can’t seem to get to use the helper as a trigger for an automation in HA. I made it, called it “test” and I can control it from both HA and Homey, I have it assigned to an area and everything. But HA doesn’t seem to want to let me select it as a trigger :frowning:

To use your input_boolean.test helper as a trigger, you need to use a State trigger (not a Device trigger). Here’s how to do it both via the UI :


  1. Go to Settings → Automations & Scenes → Automations

  2. Click + Create Automation → Start with an empty automation

  3. Under Triggers click Add Trigger, then choose State

  4. In the Entity picker select your helper (e.g. input_boolean.test)

  5. (Optional) Fill in From off and To on if you only want “off→on” transitions

  6. Configure your Actions as desired

  7. Save

That will fire whenever your virtual switch toggles.

1 Like

Thank you very much! I seem to be very close to my goal - everything works, except for my last step.
What I am trying to do - which simply may not be possible - is this: I am using Home Assistant Voice Preview Edition, I have it setup as “Jarvis.” When the cat alarm is turned off for two minutes (my “test” input boolean, in this case), Jarvis will ask me if I want it re-enabled. I tell him “yes” and he says it’s done… but he’s LYING to me lol! He doesn’t actually turn the switch back on.

But even if this is not possible, you have helped so much! I feel like I understand HA a little better, and that is important to me, as I want to learn how to use this along side Homey! Yesterday I thought none of this was possible - now I know that at least MOST of it is - so that’s pretty cool.

Obviously, I hope it is ALL possible though lol!

Maybe interesting: Here’s a tutorial I wrote to integrate both systems with eachother:

1 Like

Oh, I have HA working with Homey just fine, thank you - and I mean that… I used your tutorial EXTENSIVELY lol! So yeah, the two are playing very nicely together. But as far as what I want to do in this particular case - I am starting to think it’s just not possible in the way I am trying to do it. No matter what I try, Jarvis won’t actually turn the helper back on. He SAYS he did… but he doesn’t actually do it.

1 Like

Ah I see, Rob :blush:
Well, I use (advanced) virtual devices to disable flows, it works fine (not what you want to hear right now :grimacing: ).
Here’s what I use

The advanced virtual device on Homey (but should work with Homey virtual plug, or virtual devices app as well):

As published with MQTT Hub & MQTT Client:

It’s added to HA as MQTT device:

And can be used as automation trigger:

Wherever I push this virtual sensor OnOff switch, it’s turned on or off on both platforms.

I suspect something going on with your MQTT Hub settings.
Just to make sure, did you use the custom settings, as shown in the turorial?

The default settings left me with un-synchronised MQTT devices on both platforms.

1 Like

You, sir, are a bonafide genius! My settings in the MQTT hub weren’t quite right. I fixed that, according to your screen shot, and everything is working perfectly! Thank you!

1 Like

Ok, so maybe “perfectly” was too strong of a word. I am having some VERY strange behavior…
The first thing that clued me off to this is this: I have an LED light strip that I installed into HA. From there it goes into Homey, and from there it goes into HomeKit (HA into Homey into HomeKit). If I turn it off in HA, its state does not update in Homey… but it DOES update in HomeKit! If I turn it off or on in HomeKit, the state does not change in Homey - but it does in HA (a correctly). If I turn it off or on in Homey, then it updates in both HA an HomeKit.

But it gets a little stranger - the device tile in Homey will “light up” but the “turned off/on” text does not change.

The virtual device I created for my cat alarm, which is actually functioning perfectly in both HA and HomeKit, also does not update in Homey. It’s almost as if Homey doesn’t tell ITSELF what it’s doing lol! It tells HA and HomeKit, though - this seems very strange to me.

It’s not a deal breaker - everything is working. I just end up with a misinformed Homey. I am pretty sure I can work around this - but I do admit it would be nice not to have to. Any ideas?

Oh, I should probably mention I am using the web interface as I do 99.9% of my flows as Advanced Flows - even the simple ones (in case I want to complicate them later)

–EDIT: So I just checked the mobile app - now, THAT is working perfectly! It appears to be something weird with the web interface.

–EDIT 2: So, just refreshing the webpage for the interface fixed the issue. Didn’t realize I had to do that. YOU are a genius, I am a moron lol! Thank you so much for your help - and thank you everyone else!! I do love this community!

1 Like

We’re all just mortals :grimacing:, but thanks and I’m glad to hear you found out about the web app quirks!
After a while, it seems to rely on cached data somehow.
I lost complete new saved flows because of that, so I (force) refresh (and save) as often as possible.