Home

Awesome

ZhiMQTT

Generic MQTT Component for HomeAssistant

基于 MQTT Swicth 的扩展开关,支持以下功能:

1. 安装准备

zhimqtt 放入 custom_components

2. 配置方法

参见 我的 Home Assistant 配置configuration.yaml

switch:
  - platform: zhimqtt
    name: 书房音箱
    state_topic: NodeMCU2/relay/0
    command_topic: NodeMCU2/relay/0/set
    availability_topic: NodeMCU2/status
    value_template: '{% if value == "关闭" %}OFF{% else %}ON{% endif %}'
    icon_template: '{% if value == "关闭" %}mdi:speaker-off{% elif value == "蓝牙" %}mdi:speaker-bluetooth{% elif value == "光纤" %}mdi:speaker-wireless{% elif value == "优盘" %}mdi:usb{% elif value == "辅助" %}mdi:video-input-component{% else %}mdi:speaker{% endif %}'

3. 参考