Virtual Switch with Google Assistant/Google Home

  • Platform information:
    • Hardware: Raspi Pi 4B
    • OS: Linux openhabian2 6.12.34+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64
    • Java Runtime Environment: Temurin-21.0.10+7
    • openHAB version: Openhabian 5.1.4

I’ve looked at similar topics for ideas but I can’t get a virtual switch to respond to a voice command nor does the switch appear in Google Home even after “Okay Google, sync devices”.

Several other “real” devices are responding fine and show up in Google apps.

Item code:

version: 1
items:
  Garage_Door_Open:
    type: Switch
    label: Garage Door Open
    icon: wallswitch
    metadata:
      ga:
        value: Switch

I’ve tried “value: Switchable” as some examples have shown. No difference.

What am I missing?

I’m using Mycroft (open source voice assistant) and he can control many of my virtual switches, as you said, by just making them [Switchable]

I’m using text files for items, so I am not sure is the “value: Switchable” equivalent to appending [Switchable] to the text item. After making them switchable, all I have to do is ask the voice assistant to “refresh openhab items” and I get a response “all right, found 42 items”. So once you add a new one, you can clearly understand if it worked because the response should be I found 43 items.

Hi, I think you have to give a room hint in openHAB or move the Virtual Switch from the “Linked to my home” section to a room in the Home App for controlling them with voice commands.

In my setup everything works fine, including “virtual switches”

Thanks, Kim, but as I mentioned, the device does not appear in the Home app.

I also tried specifying its location in OH but that didn’t help.

version: 1
items:
  Garage_Door_Open:
    type: Switch
    label: Garage Door Open
    icon: wallswitch
    groups:
      - Garage
    tags:
      - Office
      - Switch
    metadata:
      ga:
        value: Switch

Thanks. Not working for me.

Switch Garage_Door_Open "Garage Door Open" <wallswitch> (Garage) [Garage, Switch] { ga="Switchable" }

how about

Switch Garage_Door_Open "Garage Door Open" <wallswitch> (Garage) [Switchable]