|
把系统从0.84升级到0.90后,原来的两个自动化出现问题,望大神帮忙解决一下,谢谢!
1、布谷鸟报时自动化
- alias: Hourly Chime
initial_state: true
trigger:
- platform: time_pattern
hours: '/1'
minutes: 0
seconds: 0
condition:
- condition: time
after: '06:50:00'
before: '22:05:00'
action:
- service: xiaomi_aqara.play_ringtone
data:
gw_mac: ************
ringtone_id: >
{{now().strftime("%I") | int + 10000}}
ringtone_vol: 40
升级后,系统报如下错误:
Error while executing automation automation.hourly_chime. Invalid data for call_service at pos 1: expected int for dictionary value @ data['ringtone_id']
2、小米网关灯根据空气质量显示不同的颜色
- id: Air_sensor_light
alias: Air_sensor_light
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.sensor_light
to: 'on'
- platform: state
entity_id: sensor.air_pollution
action:
- service: light.turn_on
entity_id: light.gateway_light_***********
data:
brightness: 50
color_name: >-
{% if is_state("sensor.air_pollution", "优秀") %}
green
{% elif is_state("sensor.air_pollution", "良好") %}
yellow
{% elif is_state("sensor.air_pollution", "中等") %}
orange
{% elif is_state("sensor.air_pollution", "一般") %}
red
{% elif is_state("sensor.air_pollution", "较差") %}
purple
{% else %}
brown
{% endif %}
系统报如下错误:
Got unknown color {% if is_state("sensor.air_pollution", "优秀") %}
green
{% elif is_state("sensor.air_pollution", "良好") %}
yellow
{% elif is_state("sensor.air_pollution", "中等") %}
orange
{% elif is_state("sensor.air_pollution", "一般") %}
red
{% elif is_state("sensor.air_pollution", "较差") %}
purple
{% else %}
brown
{% endif %}, falling back to white
|
|