Skip to content

Instantly share code, notes, and snippets.

@frenck
Last active June 18, 2020 20:45
Show Gist options
  • Select an option

  • Save frenck/81037d072c9b719b1444e670f3f65199 to your computer and use it in GitHub Desktop.

Select an option

Save frenck/81037d072c9b719b1444e670f3f65199 to your computer and use it in GitHub Desktop.
Home Assistant Scripts & Automations Syntax Idea Palette

This is a gist for me personally to play and think about extending the Home Assistant script & automation engine and its syntax.

This is in no way a direction Home Assistant is going, and is just a personal idea/notebook.

Just for fiddling...

trigger:
  - event: scene.reloaded
  - event:
    - homeassistant.start
    - automation.reloaded
  - light.kitchen
  - entity: light.kitchen
  - entity:  # backwards compatible `entity_id`
     - light.kitchen
     - light.living_room
  - entity_id:
     - light.kitchen
     - light.living_room
  - state: 'on'
    entity_id: light.kitchen
    for:
      minute: 1
  - state: 'on'
    entity_id: light.kitchen
    for: 1 minute
  - entity_id: light.kitchen
    for: 1 minute
condition:  # backwards compatible `if`
  - input_boolean.automations_enabled: true
action: # backwards compatible `then`
  - if:
      - state:
          entity: binary_sensor.motion
          state: 'off'
      - state:
          entity: kitchen.light
          state: 'on'
      - input_boolean.enabled: true
    then:
      - light.turn_off: light.kitchen
    else:
      - light.turn_on:
          entity: light.kitchen
          brightness: 100%
@adonno

adonno commented Jun 18, 2020

Copy link
Copy Markdown

no updates here m8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment