This commit is contained in:
2024-10-13 22:59:09 +02:00
parent 63fb7f8f73
commit e426efb80f
107 changed files with 20616 additions and 5533 deletions

View File

@@ -0,0 +1,29 @@
---
sensor:
- platform: adc
pin: ${pin_vbatt}
name: "Battery voltage"
id: battery_voltage
unit_of_measurement: "V"
accuracy_decimals: 1
device_class: "voltage"
entity_category: "diagnostic"
disabled_by_default: true
update_interval: 30s
attenuation: auto
filters:
- multiply: 4.11
- platform: copy
id: battery_percent
source_id: battery_voltage
name: "Battery level"
unit_of_measurement: "%"
accuracy_decimals: 0
device_class: "battery"
entity_category: "diagnostic"
filters:
- lambda: return (x - 2.7) / (4.2 - 2.7) * 100;
- clamp:
min_value: 0
max_value: 100