本帖最后由 AnyLine 于 2021-2-24 10:36 编辑
Home Assistant升级到2021.2.3后,fan好用不像之前那么用了,ZM1空气净化器数字百分比风速无法使用了,求大神支招下,该怎怎办改写?
下面是目前配置,求大神分析:
phicomm_a1.rar
(525 Bytes, 下载次数: 2)
fan:
- platform: mqtt
name: 'za1_MACMAC'
unique_id: za1_MACMAC
state_topic: "device/za1/MACMAC/state"
command_topic: "device/za1/MACMAC/set"
state_value_template: >
{%- if value_json.on == 0 -%}
{"mac":"MACMAC","on":0}
{%- else -%}
{"mac":"MACMAC","on":1}
{%- endif -%}
speed_state_topic: "device/za1/MACMAC/state"
speed_command_topic: "device/za1/MACMAC/set"
speed_value_template: >
{%- if value_json.speed < 25 -%}
{"mac":"MACMAC","speed":10}
{%- elif value_json.speed < 75 -%}
{"mac":"MACMAC","speed":50}
{%- else -%}
{"mac":"MACMAC","speed":100}
{%- endif -%}
qos: 0
payload_on: '{"mac":"MACMAC","on":1}'
payload_off: '{"mac":"MACMAC","on":0}'
payload_low_speed: '{"mac":"MACMAC","speed":20}'
payload_medium_speed: '{"mac":"MACMAC","speed":40}'
payload_high_speed: '{"mac":"MACMAC","speed":60}'
speeds:
- low
- medium
- high
- '{"mac":"MACMAC","speed":10}'
- '{"mac":"MACMAC","speed":20}'
- '{"mac":"MACMAC","speed":30}'
- '{"mac":"MACMAC","speed":40}'
- '{"mac":"MACMAC","speed":50}'
- '{"mac":"MACMAC","speed":60}'
- '{"mac":"MACMAC","speed":70}'
- '{"mac":"MACMAC","speed":80}'
- '{"mac":"MACMAC","speed":90}'
- '{"mac":"MACMAC","speed":100}'
homeassistant:
customize:
fan.za1_MACMAC:
friendly_name: 空气净化器
icon: mdi:concourse-ci
|