米家夜灯2 蓝牙版
sensor:
- platform: mqtt
name: mi_yedeng_move_NAME
state_topic: 'mqttl/设备ID/15'
value_template: >-
{% if value|int(0,16) == 1 %}
有人移动,环境光-暗
{% elif value|int(0,16) == 100 %}
有人移动,环境光-亮
{% else %}
未知
{% endif %}
- platform: mqtt
name: mi_yedeng_battery_NAME
icon: 'mdi:battery-80'
state_topic: 'mqttl/设备ID/4106'
unit_of_measurement: '%'
value_template: "{{value|int(0,16)}}"
- platform: mqtt
name: mi_yedeng_timedelay_NAME
state_topic: 'mqttl/设备ID/4119'
value_template: "{{value|int(0,16)}}"
homeassistant:
customize:
sensor.mi_yedeng_move_NAME:
friendly_name: 感应夜灯状态
sensor.mi_yedeng_battery_NAME:
friendly_name: 感应夜灯电量
sensor.mi_yedeng_timedelay_NAME:
friendly_name: 无人移动时间 #上报0秒,2分钟,5分钟,10分钟,20分钟,30分钟,用秒表示
小米门窗传感器2
- platform: mqtt
name: mi_mengci_huanjingguang_E4AAEC34D824
state_topic: 'mqttl/设备ID/4120'
value_template: >-
{% if value|int(0,16) == 0 %}
环境光暗
{% elif value|int(0,16) == 1 %}
环境光亮
{% else %}
未知
{% endif %}
- platform: mqtt
name: mi_mengci_kaiguan_E4AAEC34D824
icon: mdi:timer
state_topic: 'mqttl/设备ID/4121'
value_template: >-
{% if value|int(0,16) == 0 %}
门窗打开
{% elif value|int(0,16) == 1 %}
门窗关闭
{% elif value|int(0,16) == 2 %}
超时未关
{% else %}
未知
{% endif %}
- platform: mqtt
name: mi_mengci_battery_E4AAEC34D824
icon: 'mdi:battery-80'
state_topic: 'mqttl/设备ID/4106' # 新设备配对后只见过一次消息,后来一直没再出现
unit_of_measurement: '%'
value_template: "{{value|int(0,16)}}"
|