Hi I am trying to make a door lock and closed sensor with an esp32c6 using zigbee. I also wants to see my battery voltage or percentage. this is my yaml code:
*# Board: Seeed Studio XIAO ESP32C6 (Seeed Studio)*
*# Definition: definitions/boards/seeed_xiao_esp32c6/manifest.yaml*
*esphome:*
* name: door-lock-sensor*
* friendly_name: Door lock sensor*
* *
*esp32:*
* variant: esp32c6*
* flash_size: 4MB*
* framework:*
* type: esp-idf*
* *
*# Enable logging*
*logger:*
* *
*#Enable the Zigbee End Device radio.*
*zigbee:*
* # Optioneel: Definieer het apparaattype (standaard is END_DEVICE)*
* power_source: BATTERY *
* *
*binary_sensor:*
* - platform: gpio*
* pin:*
* number: GPIO1*
* mode: INPUT_PULLUP*
* inverted: true*
* name: "Lock Sensor"*
* icon: "mdi:lock-question"*
* *
* - platform: gpio*
* pin:*
* number: GPIO2*
* mode: INPUT_PULLUP*
* inverted: true*
* name: "door closed"*
* icon: "mdi:door"*
*sensor:*
* - platform: adc*
* pin: GPIO0*
* name: "XIAO Battery Voltage"*
* id: xiao_battery_voltage *
* update_interval: 60s*
* attenuation: 12db*
* filters:*
* - multiply: 2.0*
* unit_of_measurement: "V"*
* accuracy_decimals: 2*
* - platform: template*
* name: "XIAO Battery Level"*
* id: xiao_battery_level*
* unit_of_measurement: "%"*
* device_class: "battery"*
* accuracy_decimals: 0*
* lambda: |-*
* return id(xiao_battery_voltage).state; *
* filters:*
* - calibrate_linear:*
* - 3.2 -> 0*
* - 3.6 -> 10*
* - 3.7 -> 20*
* - 3.85 -> 50*
* - 4.0 -> 80*
* - 4.2 -> 100*
* - clamp:*
* min_value: 0*
* max_value: 100*
The problem is that once I flash this I get connected to my zigbee network. but when i remove the usb and power again or use te 3,7 volt battery to power the device It will not connect to the zigbee network any more. any suggestion’s?