mqtt:
sensor:
- name: 'zm1_b0f8932597d2_temperature'
# friendly_name: 温度
state_topic: 'device/zm1/b0f8932597d2/sensor'
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
unique_id: "温度"
- name: 'zm1_b0f8932597d2_humidity'
# friendly_name: 湿度
state_topic: 'device/zm1/b0f8932597d2/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
unique_id: "湿度"
- name: 'zm1_b0f8932597d2_pm25'
# friendly_name: PM25
state_topic: 'device/zm1/b0f8932597d2/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
unique_id: "PM2.5"
- name: 'zm1_b0f8932597d2_hcho'
# friendly_name: 甲醛
state_topic: 'device/zm1/b0f8932597d2/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
unique_id: "甲醛值"
- name: 'zm1_b0f893234f71_temperature'
# friendly_name: 温度
state_topic: 'device/zm1/b0f893234f71/sensor'
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
unique_id: "温度"
- name: 'zm1_b0f893234f71_humidity'
# friendly_name: 湿度
state_topic: 'device/zm1/b0f893234f71/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
unique_id: "湿度"
- name: 'zm1_b0f893234f71_pm25'
# friendly_name: PM25
state_topic: 'device/zm1/b0f893234f71/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
unique_id: "PM2.5"
- name: 'zm1_b0f893234f71_hcho'
# friendly_name: 甲醛
state_topic: 'device/zm1/b0f893234f71/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
unique_id: "甲醛值"
- name: 'zm1_b0f89325b2a2_temperature'
# friendly_name: 温度
state_topic: 'device/zm1/b0f89325b2a2/sensor'
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
unique_id: "温度"
- name: 'zm1_b0f89325b2a2_humidity'
# friendly_name: 湿度
state_topic: 'device/zm1/b0f89325b2a2/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
unique_id: "湿度"
- name: 'zm1_b0f89325b2a2_pm25'
# friendly_name: PM25
state_topic: 'device/zm1/b0f89325b2a2/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
unique_id: "PM2.5"
- name: 'zm1_b0f89325b2a2_hcho'
# friendly_name: 甲醛
state_topic: 'device/zm1/b0f89325b2a2/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
unique_id: "甲醛值"
- name: 'zm1_b0f89325b3c2_temperature'
# friendly_name: 温度
state_topic: 'device/zm1/b0f89325b3c2/sensor'
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
unique_id: "温度"
- name: 'zm1_b0f89325b3c2_humidity'
# friendly_name: 湿度
state_topic: 'device/zm1/b0f89325b3c2/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
unique_id: "湿度"
- name: 'zm1_b0f89325b3c2_pm25'
# friendly_name: PM25
state_topic: 'device/zm1/b0f89325b3c2/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
unique_id: "PM2.5"
- name: 'zm1_b0f89325b3c2_hcho'
# friendly_name: 甲醛
state_topic: 'device/zm1/b0f89325b3c2/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
unique_id: "甲醛值"
light:
- name: zm1_b0f8932597d2_brightness
unique_id: "亮度"
schema: template
command_topic: "device/zm1/b0f8932597d2/set"
state_topic: "device/zm1/b0f8932597d2/state"
command_on_template: >
{"mac": "b0f8932597d2"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f8932597d2", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
unique_id: "亮度"
- name: zm1_b0f893234f71_brightness
unique_id: "亮度"
schema: template
command_topic: "device/zm1/b0f893234f71/set"
state_topic: "device/zm1/b0f893234f71/state"
command_on_template: >
{"mac": "b0f893234f71"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f893234f71", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
unique_id: "亮度"
- name: zm1_b0f89325b2a2_brightness
unique_id: "亮度"
schema: template
command_topic: "device/zm1/b0f89325b2a2/set"
state_topic: "device/zm1/b0f89325b2a2/state"
command_on_template: >
{"mac": "b0f89325b2a2"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f89325b2a2", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
unique_id: "亮度"
- name: zm1_b0f89325b3c2_brightness
unique_id: "亮度"
schema: template
command_topic: "device/zm1/b0f89325b3c2/set"
state_topic: "device/zm1/b0f89325b3c2/state"
command_on_template: >
{"mac": "b0f89325b3c2"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f89325b3c2", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
unique_id: "亮度"
customize:
#客厅
light.zm1_b0f8932597d2_brightness:
friendly_name: 客厅M1亮度
sensor.zm1_b0f8932597d2_temperature:
friendly_name: 客厅温度
sensor.zm1_b0f8932597d2_humidity:
friendly_name: 客厅湿度
sensor.zm1_b0f8932597d2_pm25:
friendly_name: 客厅PM2.5
sensor.zm1_b0f8932597d2_hcho:
friendly_name: 客厅甲醛浓度
#次卧
light.zm1_b0f893234f71_brightness:
friendly_name: 次卧M1亮度
sensor.zm1_b0f893234f71_temperature:
friendly_name: 次卧温度
sensor.zm1_b0f893234f71_humidity:
friendly_name: 次卧湿度
sensor.zm1_b0f893234f71_pm25:
friendly_name: 次卧PM2.5
sensor.zm1_b0f893234f71_hcho:
friendly_name: 次卧甲醛浓度
#北卧
light.zm1_b0f89325b2a2_brightness:
friendly_name: 北卧M1亮度
sensor.zm1_b0f89325b2a2_temperature:
friendly_name: 北卧温度
sensor.zm1_b0f89325b2a2_humidity:
friendly_name: 北卧湿度
sensor.zm1_b0f89325b2a2_pm25:
friendly_name: 北卧PM2.5
sensor.zm1_b0f89325b2a2_hcho:
friendly_name: 北卧甲醛
#主卧
light.zm1_b0f89325b3c2_brightness:
friendly_name: 主卧M1亮度
sensor.zm1_b0f89325b3c2_temperature:
friendly_name: 主卧温度
sensor.zm1_b0f89325b3c2_humidity:
friendly_name: 主卧湿度
sensor.zm1_b0f89325b3c2_pm25:
friendly_name: 主卧PM2.5
sensor.zm1_b0f89325b3c2_hcho:
friendly_name: 主卧甲醛
|