先说下硬件
树莓派3
sonoff S20
系统
树莓派是官网search lite+hassio
sonoff安装
目前的情况:
1.iOS能够找到终端,但没有添加开关
2.HA不能获取到开关的状态
配置表:
HA的配置
sensor:
- platform: mqtt
name: "tem"
state_topic: "tele/sonoff/fan/SENSOR"
value_template: "{{ value_json['DHT11'].Temperature }}"
unit_of_measurement: "°C"
- platform: mqtt
name: "hum"
state_topic: "tele/sonoff/fan/SENSOR"
value_template: "{{ value_json['DHT11'].Humidity }}"
unit_of_measurement: "%"
mqtt:
broker: 192.168.1.200
port: 1883
client_id: home-assistant-1
keepalive: 60
username: sonoff
password: raspberry
protocol: 3.1
switch:
- platform: mqtt
name: "fan"
state_topic: "stat/sonoff/fan/POWER"
command_topic: "cmnd/sonoff/fan/POWER"
payload_on: "ON"
payload_off: "OFF"
optimistic: false
qos: 1
retain: true
HB的配置:
{
"bridge": {
"name": "家庭终端",
"username": "B8:27:EB:AD:99:31",
"port": 51826,
"pin": "233-00-666"
},
"description": "HomeKit智能终端",
"accessories": [],
"platforms": [
{
"platform": "HomeAssistant",
"name": "HomeAssistant",
"host": "http://127.0.0.1:8123",
"password": "fengfeng",
"default_visibility": "hidden",
"supported_types": [
"automation",
"binary_sensor",
"climate",
"cover",
"device_tracker",
"fan",
"group",
"input_boolean",
"light",
"lock",
"media_player",
"remote",
"scene",
"script",
"sensor",
"switch",
"vacuum"
],
"logging": true,
"verify_ssl": true
}
]
}
|