feature-requests
feature-requests copied to clipboard
Door sensor deep sleep for bk7231n board
Door sensor deep sleep for bk7231n board
Describe the problem you have/What new integration you would like
Add door sensor deep sleep for bk7231n boardPlease describe your use case for this integration and alternatives you've tried:
ESPHOME deep sleep not working for bk72xx platformAdditional context
I didn't know how to enable deep sleep too
My temporary solution
script:
- id: scr
then:
- wifi.enable:
- delay: 30s
- wifi.disable:
mode: restart
binary_sensor:
- platform: gpio
device_class: door
name: Door
pin: P22
on_state:
then:
- script.execute: scr
ThanksMy iPad will find youOn Dec 24, 2023, at 08:44, Ivan Shevchenko @.***> wrote: My temporary solution script: - id: scr then: - wifi.enable: - delay: 30s - wifi.disable: mode: restart
binary_sensor:
- platform: gpio device_class: door name: Door pin: P22 on_state: then: - script.execute: scr
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Having functional deep sleep will help in a long run.
in mean time, I've been trying to get up to speed with the project
I've implemented your solution as I'm trying to find the deep sleep code for the exact same type of sensor... Below my running ESPHome config as it works now, quite well. Please comments are needed as I'm not really sure it is efficent enough!
esphome:
name: basement-door-sensor
friendly_name: basement_door_sensor
on_boot:
priority: 10
then:
- switch.turn_on: batt_dv
- script.execute: scr
bk72xx:
board: cb3s
framework:
version: dev
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot in case wifi connection fails
ap:
ssid: "Basement-Door-Sensor"
password: "1234567890"
web_server:
port: 80
version: 2
include_internal: true
ota: true
captive_portal:
script:
- id: scr
then:
- wifi.enable:
- delay: 30s
- wifi.disable:
mode: restart
binary_sensor:
- platform: gpio
device_class: door
name: Door
pin: P8
on_state:
then:
- output.turn_on: light_output
- delay: 500ms
- output.turn_off: light_output
- script.execute: scr
switch:
- platform: gpio
id: batt_dv
pin: P14
sensor:
- platform: adc
pin: ADC3
id: "VCC"
name: "Battery Level"
filters:
- multiply: 2.4
- platform: template
name: "Battery Level (%)"
unit_of_measurement: '%'
update_interval: 240s
lambda: |-
return ((id(VCC).state /3.0) * 100.00);
light:
- platform: binary
name: "Activity LED"
output: light_output
output:
- id: light_output
platform: gpio
pin: P26
Any updates?
There is some work going on the LibreTiny to support it in ESPHome, but I believe it will take some time until we have Deep Sleep for these chips.
Does the above script work? What is the power consumption? I have two water sensors operating with 2xAAA batteries and I'd really like to replace the tuya firmware with something else.