- 积分
- 102
- 金钱
- 100
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
注册会员
- 积分
- 102
- 金钱
- 100
- HASS币
- 0
|
发表于 2024-3-8 23:46:21
|
显示全部楼层
M1接入HA后没有设备和实体信息,配置文件存放路径/config/packages/phicomm_aircat.yaml 配置文件信息如下:
##mqtt-空气检测仪##
## 以下内容中,请将MACMAC替换为你的排插的mac地址,不带冒号,全部小写,如123456789abc
## https://github.com/a2633063/zM1/ ... t%E6%8E%A5%E5%85%A5
mqtt:
sensor:
- name: 'zm1_已换成实际mac_temperature'
state_topic: 'device/zm1/已换成实际mac/sensor'
unique_id: zm1_已换成实际mac_temperature
unit_of_measurement: '°C'
icon: 'mdi:thermometer'
value_template: '{{ value_json.temperature }}'
- name: 'zm1_已换成实际mac_humidity'
unique_id: zm1_已换成实际mac_humidity
state_topic: 'device/zm1/已换成实际mac/sensor'
unit_of_measurement: '%'
icon: mdi:water-percent
value_template: '{{ value_json.humidity }}'
- name: 'zm1_已换成实际mac_pm25'
unique_id: zm1_已换成实际mac_pm25
state_topic: 'device/zm1/已换成实际mac/sensor'
unit_of_measurement: 'μg/m³'
icon: mdi:blur
value_template: '{{ value_json.PM25 }}'
- name: 'zm1_已换成实际mac_hcho'
unique_id: zm1_已换成实际mac_hcho
state_topic: 'device/zm1/已换成实际mac/sensor'
unit_of_measurement: 'mg/m³'
icon: mdi:chemical-weapon
value_template: '{{ value_json.formaldehyde }}'
light:
- name: zm1_已换成实际mac_brightness
unique_id: zm1_已换成实际mac_brightness
schema: template
command_topic: "device/zm1/已换成实际mac/set"
state_topic: "device/zm1/已换成实际mac/state"
command_on_template: >
{"mac": "已换成实际mac"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "已换成实际mac", "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_已换成实际mac_brightness:
friendly_name: zM1亮度
sensor.zm1_已换成实际mac_temperature:
friendly_name: zM1温度
sensor.zm1_已换成实际mac_humidity:
friendly_name: zM1湿度
sensor.zm1_已换成实际mac_pm25:
friendly_name: zM1 PM2.5
sensor.zm1_已换成实际mac_hcho:
friendly_name: zM1甲醛
在楼主的APP客户端上可以正常通过mqtt通信,我的HACore版本是2024.3.0,哪位大佬帮忙看一下,非常感谢。 |
|