- 积分
- 981
- 金钱
- 894
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 981
- 金钱
- 894
- HASS币
- 0
|
发表于 2024-4-15 18:04:43
|
显示全部楼层
本帖最后由 sauron 于 2024-4-15 18:06 编辑
mqtt:
sensor:
- name: 'zm1_b0f893278269_temperature'
unique_id: zm1_b0f893278269_temperature
device:
identifiers: b0f893278269
name: zm1_8269
model: 'm1'
manufacturer: 'Phicomm'
# friendly_name: 温度
state_topic: 'device/zm1/b0f893278269/sensor'
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
# availability_topic: "device/zm1/b0f893278269/availability"
# payload_available: 1
# payload_not_available: 0
- name: 'zm1_b0f893278269_humidity'
unique_id: zm1_b0f893278269_humidity
device:
identifiers: b0f893278269
name: zm1_8269
model: 'm1'
manufacturer: 'Phicomm'
# friendly_name: 湿度
state_topic: 'device/zm1/b0f893278269/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
# availability_topic: "device/zm1/b0f893278269/availability"
# payload_available: 1
# payload_not_available: 0
- name: 'zm1_b0f893278269_pm25'
unique_id: zm1_b0f893278269_pm25
device:
identifiers: b0f893278269
name: zm1_8269
model: 'm1'
manufacturer: 'Phicomm'
# availability_topic: "device/zm1/b0f893278269/availability"
# payload_available: 1
# payload_not_available: 0
# friendly_name: PM25
state_topic: 'device/zm1/b0f893278269/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
- name: 'zm1_b0f893278269_hcho'
unique_id: zm1_b0f893278269_hcho
device:
identifiers: b0f893278269
name: zm1_8269
model: 'm1'
manufacturer: 'Phicomm'
# friendly_name: 甲醛
state_topic: 'device/zm1/b0f893278269/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
# availability_topic: "device/zm1/b0f893278269/availability"
# payload_available: 1
# payload_not_available: 0
light:
name: zm1_b0f893278269_brightness
unique_id: zm1_b0f893278269_brightness
device:
identifiers: b0f893278269
name: zm1_8269
model: 'm1'
manufacturer: 'Phicomm'
schema: template
command_topic: "device/zm1/b0f893278269/set"
state_topic: "device/zm1/b0f893278269/state"
command_on_template: >
{"mac": "b0f893278269"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f893278269", "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 -%}
homeassistant:
customize:
light.zm1_b0f893278269_brightness:
friendly_name: zM1亮度
sensor.zm1_b0f893278269_temperature:
friendly_name: zM1温度
sensor.zm1_b0f893278269_humidity:
friendly_name: zM1湿度
sensor.zm1_b0f893278269_pm25:
friendly_name: zM1 PM2.5
sensor.zm1_b0f893278269_hcho:
friendly_name: zM1甲醛 |
评分
-
查看全部评分
|