0.19: Empowering 脚本 and Alexa

这次发布很重磅。到目前为止,我们的自动化和脚本一直比较静态。从今天开始,它们会变得更动态一些。

脚本 现在可用于自动化,也可用于响应 Alexa/Amazon Echo。这两个组件现在都会暴露可在脚本模板中使用的数据(包括 from_state!)。你还可以通过向脚本服务传递数据,把变量传给脚本实体。

automation:
  trigger:
    platform: mqtt
    topic: some/notify/topic
  action:
    service: notify.notify
    data:
      message: 

automation 2:
  trigger:
    platform: state
    entity_id: light.hue
  action:
    service: notify.notify
    data:
      message:  is now 

实体命名空间(Entity namespaces) 允许你控制特定平台生成的实体 ID。例如,你可以通过下面的配置把 light.living_room 变成 light.holiday_home_living_room

light:
  platform: hue
  entity_namespace: holiday_home

Deprecations

  • 条件 in 自动化 should now specify which 条件 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