Skip to content

Yonsm/ZhiMQTT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

ZhiMQTT

Generic MQTT Component for HomeAssistant

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

  • 支持 icon_template 配置,可以使用 Jinja 脚本运算出不同的图标。
  • 支持 original_state 属性,以便在配置 value_template 时能获取原始状态。

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. 参考

About

Zhi MQTT Component for HomeAssistant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages