#替换所有“mac地址”为s7的mac,全部小写中间无冒号。tt语音播报请根据自己的设备更改
sensor:
- platform: mqtt
name: 'zs7_weight_mac地址'
state_topic: 'device/zs7/mac地址/sensor'
unit_of_measurement: 'kg'
icon: 'mdi:weight-kilogram'
value_template: '{{ value_json.weight / 100 | float }}'
automation:
- alias: get_s7_weight_tts
initial_state: true
trigger:
- platform: state
entity_id: sensor.zs7_weight_mac地址
action:
entity_id: media_player.mpd
service: tts.baidu_say
data_template:
message: 您的最新体重为{{ states('sensor.zs7_weight_mac地址') }}公斤。
homeassistant:
customize:
sensor.zs7_weight_mac地址:
friendly_name: 体重
|