docs.na.id.au

The core limitation

Automating with Google Home & HomeKit

Patterns for making Home Assistant behave well when lights, switches and media are controlled from Google Home or HomeKit — platforms that can only turn things on and off, not run your scripts.

The core limitation

Google Home and HomeKit talk to HA through the Google Assistant / HomeKit integrations. They can:

They cannot run automations, and they won’t run a script you forgot to expose. So any “polish” behaviour — dimming after dark, turning a light off later, logging the event — has to live in an automation that reacts to the state change the assistant causes, not in the assistant itself.

The general recipe:

  1. Expose only the entities and scripts each platform should control (exposure is off by default — list them explicitly).
  2. Write automations with light.turned_on / switch.turned_on triggers targeting those entities. The trigger fires identically whether the change came from the HA dashboard, a voice command, or a HomeKit switch on the wall — so one automation serves all sources.
  3. Add time-of-day / state conditions to shape the behaviour.

Example: Light:On:Dim

The best illustration of the pattern. Bedside lamps exposed to the assistants are sometimes switched on at full brightness late at night (a voice command or a HomeKit switch). This automation re-dims them to a safe level:

- id: '202607080107'
  description: ''
  triggers:
    - trigger: light.turned_on
      target:
        entity_id:
          - light.light_bedside_1
          - light.light_bedside_2
          - light.light_masterbedroom_1
      options:
        behavior: each
  conditions:
    - condition: state
      entity_id: input_boolean.active
      state: ['on']
    - condition: time
      after: '21:00'
      before: '07:30:00'
    - condition: template
      value_template: >-
        {{ is_state_attr(trigger.entity_id, 'brightness', none) == false and
           state_attr(trigger.entity_id, 'brightness') | int(0) > 15 }}
  actions:
    - sequence:
        - action: light.turn_on
          target:
            entity_id: "{{ trigger.entity_id }}"
          data:
            brightness_pct: 20
  alias: Light:On:Dim
  mode: parallel
  max: 10

Design points worth copying:

This is the key idea: react to state, not to the source. Because the trigger is on the light itself, the automation works for HomeKit, Google Home, the dashboard, and any future platform, with zero per-platform code.

Exposing entities deliberately

Both integrations default to no exposure — you list each entity you want voice-controlled, and you can attach friendly names/areas. Tips:

Gotchas



Source Disclaimer