home-assistant.io/source/_posts/2016-05-07-empowering-scripts-and-alexa.markdown
2016-05-11 08:35:00 -07:00

7.0 KiB

layout, title, description, date, date_formatted, author, author_twitter, comments, categories
layout title description date date_formatted author author_twitter comments categories
post 0.19: Empowering scripts and Alexa The new release of Home Assistant includes a lot of upgrades to how we handle scripts and make them available in a wide range of new components including automation and alexa. 2016-05-07 11:06:00 -0700 May 7, 2016 Paulus Schoutsen balloob true Release-Notes

This release is big. Until now, our automations and scripts have been very static. Starting today it should all be a bit more dynamic.

Scripts are now available in automations and when responding to Alexa/Amazon Echo. Both of these components will now expose data to be used in script templates (including from_state !). Passing data to script entities is available by passing the data to the script services.

automation:
  trigger:
    platform: mqtt
    topic: some/notify/topic
  action:
    service: notify.notify
    data_template:
      message: {{ trigger.payload }}

automation 2:
  trigger:
    platform: state
    entity_id: light.hue
  action:
    service: notify.notify
    data_template:
      message: {{ trigger.to_state.name }} is now {{ trigger.to_state.state }}

Entity Namespaces allow you to influence the entity ids for a specific platform. For example you can turn light.living_room into light.holiday_home_living_room with the following config:

light:
  platform: hue
  entity_namespace: holiday_home

Deprecations

  • Conditions in automations should now specify which condition to use with condition: instead of platform:. For example condition: state.
  • RFXtrx has a new config format.

Old RFXtrx config format:

  devices:
    123efab1:
      name: My DI.0 light device
      packetid: 1b2200000890efab1213f60

New RFXtrx config format:

  devices:
    1b2200000890efab1213f60:
      name: My DI.0 light device