espeasy 加入Homeassistan,通過MQTT控制GPIO

首先要在homeassistant中配置conguration.yaml文件,開啓mqtt服務器。

mqtt:
  password: hello

接下來開始配置espeasy。

1.點擊Controllers,Edit。填入homeassistant的mqtt參數。

2.點擊Devices  -  Edit

3.點擊Tools-Advanced,rules打鉤,mqtt打鉤,message relay改成100ms。

 

 

4.在homeassistant中配置configuration.yaml文件。注意command_topic的寫法。

switch:
  - platform: mqtt
    name: "Bedroom Switch"
    state_topic: "/ESP_Easy/test/switch"
    command_topic: "/ESP_Easy/gpio/2"
    payload_on: "1"
    payload_off: "0"
    state_on: "1"
    state_off: "0"
    optimistic: false
    qos: 0
    retain: true

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章