Migrating from Hubitat, how do do virtual devices?

I’m looking at migrating from Hubitat and am wondering how to create virtual devices, or replicate the end result. For a specific example I have a ZWave outlet that I use to control a space heater and a corresponding automation to allow me to turn it on, and keep it on via Google Assistant.

  • Craft Room Heater - Outlet is the actual ZWave+ outlet, it is not exposed to Google
  • Craft Room Heater is a virtual switch, it is exposed to Google

Here is the Hubitat rule:
Screen Shot 2020-09-14 at 8.48.59 AM

The result/goal of the rule is:

  • I can say “OK Google turn on the Craft Room heater” which results in Assistant turning on the virtual switch which triggers the rule to turn on the actual outlet
  • After 30 minutes turn off the virtual switch, notify me that the heater is turning off in 1 minute, wait 1 minute, turn off the real outlet
  • If I say “OK Google turn on the Craft Room heater” the virtual switch gets turned back on canceling the wait and resetting the 30 minute timer
  • If I say “OK Google turn off the Craft Room heater” at any time, the actual outlet gets turned off and the whole wait gets cancelled.

The delay and notify I get how to do. I’m not sure how to emulate the virtual switch that turns off 1 minute before the real switch.

1 Like

HA doesn’t really have a packaged set of entities to emulate actual devices like Hubitat. For something as simple as a switch you can create an input boolean that is essentially a virtual entity with a true or false state (on/off). You can use this as your Virtual Switch.

In one of the recent updates HA has made it easier to create by going to Configuration->Helpers->hit the “+” and choose the toggle option. You can then use this as your virtual switch in an automation.

3 Likes

Thanks, I’ll give that a try.

Do you know if I’ll be able to export that boolean input as a Switch to Google Home?

Edit: Just tested, looks like it exports to Assistant! I had missed the whole Helpers section when starting out, looks like just what I need.

Yes you can.

1 Like