Hey guys I have recently got a few deta lights switches installed that I had flashed with ESPHome however I am having a few issue and I am wondering if someone that might have them installed as well might be able to share a bit of assistance or copy of there ESPHome configs.
I have two of the deta 6952HA two way switches installed one a series 1 and one a series2 however I am having issues with the configs not sure if is a error with my config or maybe a faulty device.
I can see the series 1 vs series 2 seem to have a different chip cb3s - series 2 vs wb3s - series 1
I have the 6952HA series 2 installed at the bottom of my stairs controlling a two light switch for the stairs with another two way switch series 1 at the top. The switch at the bottom is also connected to a single way switch/lights as well.
The single way switch on the 6952HA series 2 appears to be working fine the issue is with the two way switch controlling the stairs lights.
I can’t get the device to correctly report the activation status of one of the switches/relays I have tried piecing together what I think the config should look like from the examples at devices.esphome.io but I am not sure if I have the config %100 correct or not vs the different models not sure if some of the pinouts might be a bit different between the two models?
Below are the current configs of the two switches the issue that I am having is that with the below configs on the series 2 switch I can’t get it to correctly report the activation status of the remote relay. With this config the cb3s device never reports the correct status for when I press the button for the “Stair Lights” in my ESPHome config.
The switch at the bottom of the stairs doesn’t have the light/load connect and its the switch at the top has the light/load connected.
With the series 2 I can toggle the relay/press button the button I can here the relay click and the light will turn on but the activation status never changes and the other strange thing is that the series 2 device the blue LED light around the button never lights up but the relay is defiantly clicking and causing the light to come on but the status never correctly updates in the ESPHome config.
The series 1 blue LED light does come on when the light is on but the series 2 never changes and the LED Light is always off. The other strange thing is the series 1 switch with the light turned off the blue LED around the switch will some times faintly come on and off when the light is off. Leading me to believe that the the series 2 device might be faulty but I am not sure?
So I was wondering if anyone does have these two way switches installed if you might be able to share you configs for me to compare against. Particularly if you have the series 1 and series 2 models as I am not sure if there is any difference config wise between the two models.
Wondering if anyone might have any other ideas on what could possible be wrong?
I might see if I can just double check that all the wiring is %100 correct between the two switches as well as I am not sure if this could possible be a cause of the issues I am seeing as well?
# Deta 6952HA cb3s - series 2
esphome:
name: bottom-stairs-switch
friendly_name: bottom_stairs_switch
bk72xx:
board: cb3s
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Bottom-Stairs-Switch"
password: ""
captive_portal:
#Enable Web Server
web_server:
port: 80
captive_portal:
## ---------------- ##
## Status LED ##
## ---------------- ##
status_led:
pin:
number: P24
inverted: true
## ---------------- ##
## Relays ##
## ---------------- ##
output:
# Relay
- platform: gpio
id: relay1
pin: P14
- platform: gpio
id: relay2
pin: P6
## ------------ ##
## Lights ##
## ------------ ##
light:
# Light
- platform: binary
name: Lounge Lights
icon: "mdi:light-recessed"
output: relay1
id: lounge_light
internal: True
# Light
- platform: binary
name: Stair Lights
icon: "mdi:light-recessed"
output: relay2
id: staris_light
internal: True
## ---------------- ##
## Switch ##
## ---------------- ##
switch:
- platform: template
name: "Lounge Switch"
id: lounge_switch
lambda: |-
if (id(activation_status_1).state) {
return true;
} else {
return false;
}
turn_on_action:
- if:
condition:
binary_sensor.is_off: activation_status_1
then:
- light.toggle: lounge_light
turn_off_action:
- if:
condition:
binary_sensor.is_on: activation_status_1
then:
- light.toggle: lounge_light
- platform: template
name: "Stairs Switch"
id: stairs_switch
lambda: |-
if (id(activation_status_2).state) {
return true;
} else {
return false;
}
turn_on_action:
- if:
condition:
binary_sensor.is_off: activation_status_2
then:
- light.toggle: staris_light
turn_off_action:
- if:
condition:
binary_sensor.is_on: activation_status_2
then:
- light.toggle: staris_light
## ----------------- ##
## Buttons ##
## ----------------- ##
binary_sensor:
# Button
- platform: gpio
id: button
internal: True
pin:
number: P26
inverted: true
mode: INPUT_PULLUP
on_press:
- if:
#If HA API is connected but relay is off turn on interal relay/light on
condition:
and:
- api.connected:
- switch.is_off: lounge_switch
then:
- switch.toggle: lounge_switch
- if:
#If HA API is connected treat as deatached mode and toggle light via homeassistant
condition:
api.connected:
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.lounge_room
else:
#Else if API must be disconnected toggle local relay and treat light switch as local
- switch.toggle: lounge_switch
- platform: gpio
id: button1
internal: True
pin:
number: P23
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: stairs_switch
## ----------------- ##
## Two Way ##
## Sensors ##
## ----------------- ##
# Activation statuses
# Represents the "local" relay (this device) XOR the "remote" relay (another device).
# It only shows TRUE if one of the "local" or "remote" relays are active, but not both.
- platform: gpio
#Hall Light Activation Status
id: activation_status_1
name: activation_status_1
pin:
number: P8
mode: INPUT
inverted: true
#internal: true
- platform: gpio
#Stair Light Activation Status
id: activation_status_2
name: activation_status_2
pin:
number: P9
mode: INPUT
inverted: true
#internal: true
#Deta 6952HA Series 1Two Gang Two Way Switch - Top of Staris
esphome:
name: hall-switch
friendly_name: hall_switch
bk72xx:
board: wb3s
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Hall-Switch Fallback Hotspot"
password: ""
#Enable Web Server
web_server:
port: 80
captive_portal:
## ---------------- ##
## Status LED ##
## ---------------- ##
status_led:
pin:
number: P24
inverted: true
## ---------------- ##
## Relays ##
## ---------------- ##
output:
# Relay
- platform: gpio
id: relay1
pin: P14
- platform: gpio
id: relay2
pin: P6
## ------------ ##
## Lights ##
## ------------ ##
light:
# Light
- platform: binary
name: Hall Lights
icon: "mdi:light-recessed"
output: relay1
id: hall_light
internal: True
# Light
- platform: binary
name: Stair Lights
icon: "mdi:light-recessed"
output: relay2
id: staris_light
#internal: True
## ---------------- ##
## Switch ##
## ---------------- ##
switch:
- platform: template
name: "Hall Switch"
id: hall_switch
lambda: |-
if (id(activation_status_1).state) {
return true;
} else {
return false;
}
turn_on_action:
- if:
condition:
binary_sensor.is_off: activation_status_1
then:
- light.toggle: hall_light
turn_off_action:
- if:
condition:
binary_sensor.is_on: activation_status_1
then:
- light.toggle: hall_light
#- platform: template
# name: "Stairs Switch"
# id: stairs_switch
# lambda: |-
# if (id(activation_status_2).state) {
# return true;
# } else {
# return false;
# }
# turn_on_action:
# - if:
# condition:
# binary_sensor.is_off: activation_status_2
# then:
# - light.toggle: staris_light
# turn_off_action:
# - if:
# condition:
# binary_sensor.is_on: activation_status_2
# then:
# - light.toggle: staris_light
## ----------------- ##
## Buttons ##
## ----------------- ##
binary_sensor:
# Button
- platform: gpio
id: button
internal: True
pin:
number: P26
inverted: true
mode: INPUT_PULLUP
on_press:
- if:
#If HA API is connected but relay is off turn on interal relay/light on
condition:
and:
- api.connected:
- switch.is_off: hall_switch
then:
- switch.toggle: hall_switch
- if:
#If HA API is connected treat as deatached mode and toggle light via homeassistant
condition:
api.connected:
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.upstairs_hall
else:
#Else if API must be disconnected toggle local relay and treat light switch as local
- switch.toggle: hall_switch
- platform: gpio
id: button1
internal: True
pin:
number: P23
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- light.toggle: staris_light
## ----------------- ##
## Two Way ##
## Sensors ##
## ----------------- ##
# Activation statuses
# Represents the "local" relay (this device) XOR the "remote" relay (another device).
# It only shows TRUE if one of the "local" or "remote" relays are active, but not both.
- platform: gpio
#Hall Light Activation Status
id: activation_status_1
name: activation_status_1
pin:
number: P8
mode: INPUT
inverted: true
#internal: true
- platform: gpio
#Stair Light Activation Status
id: activation_status_2
name: activation_status_2
pin:
number: P7
mode: INPUT
inverted: true
#internal: true