参考以下帖子欧瑞博精灵接入hass,PCB原理图参考了罗总、宝子、Kevin
https://bbs.hassbian.com/thread-18356-1-1.html
欧瑞博精灵外挂espc3_5bb8da5f2f1e414da467c1395c35a92c.zip
(76.41 KB, 下载次数: 1)
substitutions:
device_name: orvibo-mixpad-df5ec0
esphome:
name: ${device_name}
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
wifi: {ssid: "iot",password: "66666666"}
api: {reboot_timeout: 0s}
web_server: {port: 80}
ota: {safe_mode: true}
logger:
binary_sensor:
- platform: gpio
id: i1
pin: {number: "GPIO5", mode: INPUT_PULLUP, inverted: true}
- platform: gpio
id: i2
pin: {number: "GPIO6", mode: INPUT_PULLUP, inverted: true}
- platform: gpio
id: button1
pin: {number: "GPIO10", mode: INPUT_PULLUP, inverted: true}
filters:
- delayed_on: 10ms
on_release:
if:
condition:
or:
- binary_sensor.is_on: i1
- binary_sensor.is_on: i2
then:
- switch.turn_off: trelay1
- switch.turn_off: trelay2
else:
- switch.turn_on: trelay1
switch:
- platform: gpio
pin: 3
id: relay1
internal: true
on_turn_on:
- delay: 300ms
- switch.turn_off: relay1
- platform: gpio
pin: 1
id: relay2
internal: true
on_turn_on:
- delay: 300ms
- switch.turn_off: relay2
- platform: template
name: "lamp 1"
id: trelay1
lambda: |-
if (id(i1).state) {
return true;
} else {
return false;
}
turn_on_action:
if:
condition:
binary_sensor.is_off: i1
then:
switch.turn_on: relay1
turn_off_action:
if:
condition:
binary_sensor.is_on: i1
then:
switch.turn_on: relay1
- platform: template
name: "lamp 2"
id: trelay2
lambda: |-
if (id(i2).state) {
return true;
} else {
return false;
}
turn_on_action:
if:
condition:
binary_sensor.is_off: i2
then:
switch.turn_on: relay2
turn_off_action:
if:
condition:
binary_sensor.is_on: i2
then:
switch.turn_on: relay2
|