Having some trouble wrapping my head around creating “something” in Home Assistant that I can switch on and off via speaking to Google Home.
For example, I want to say “Hey Google, Good Night” and have that flip something in HA to “on.” I can handle the various automations via Node-RED. I’m just having problems figuring out what to create in HA and then how to make that available via HA Cloud to Google.
Well assuming it’s not just a switch you want to expose, I use an input_boolean that triggers an automation and the input_boolean is exposed to Google Assistant.
in config:
# Binary Switch for Home and Away Automations
input_boolean:
homeandawayauto:
name: Home and Away Automations
automation:
- id: 'homeawayinpboolturnon'
alias: Home and Away On
initial_state: 'on'
trigger:
- entity_id: input_boolean.homeandawayauto
from: 'off'
platform: state
to: 'on'
action:
- service: automation.turn_on
data:
entity_id: group.homeaway
- id: 'homeawayinpboolturnoff'
alias: Home and Away Off
initial_state: 'on'
trigger:
- entity_id: input_boolean.homeandawayauto
from: 'on'
platform: state
to: 'off'
action:
- service: automation.turn_off
data:
entity_id: group.homeaway
Then in my google assistant config:
# Google Assistant
project_id: !secret ga_project
api_key: !secret api-ga
exposed_domains:
- switch
- light
- scene
- input_boolean
entity_config:
input_boolean.homeandawayauto:
room: house