Battery calibration and LED effects
This commit is contained in:
@@ -10,11 +10,11 @@ esphome:
|
||||
then:
|
||||
- dfplayer.set_volume: 10
|
||||
- light.turn_on:
|
||||
id: status_led
|
||||
brightness: 60%
|
||||
red: 100%
|
||||
green: 0%
|
||||
blue: 100%
|
||||
id: status_led
|
||||
brightness: 60%
|
||||
red: 80%
|
||||
green: 0%
|
||||
blue: 100%
|
||||
|
||||
esp8266:
|
||||
board: d1_mini_lite
|
||||
@@ -76,10 +76,22 @@ pn532_i2c:
|
||||
ESP_LOGD("Fabula", " No valid record found in tag. Please add a text field containing the folder number, e.g. 001");
|
||||
id(current_folder) = 0;
|
||||
return 0;
|
||||
- light.turn_on:
|
||||
id: status_led
|
||||
brightness: 60%
|
||||
red: 0%
|
||||
green: 100%
|
||||
blue: 100%
|
||||
on_tag_removed:
|
||||
then:
|
||||
- logger.log: "NFC Tag removed"
|
||||
- dfplayer.pause
|
||||
- light.turn_on:
|
||||
id: status_led
|
||||
brightness: 60%
|
||||
red: 80%
|
||||
green: 0%
|
||||
blue: 100%
|
||||
|
||||
|
||||
# ---------------------- DFPlayer MP3 Player ----------------------
|
||||
@@ -205,23 +217,25 @@ light:
|
||||
|
||||
|
||||
# ---------------------- Battery level sensor ----------------------
|
||||
# 665 = 100% (4.2v)
|
||||
# 555 = 0% (3.5v) --> TODO: Check this
|
||||
sensor:
|
||||
- platform: adc
|
||||
pin: A0
|
||||
name: "Battery level"
|
||||
icon: 'mdi:battery'
|
||||
update_interval: 1min
|
||||
#unit_of_measurement: "%"
|
||||
#raw: true
|
||||
#filters:
|
||||
# - clamp:
|
||||
# min_value: 500.0
|
||||
# max_value: 850.0
|
||||
# - calibrate_linear:
|
||||
# - 500.0 -> 0.0
|
||||
# - 850.0 -> 100.0
|
||||
# - min:
|
||||
# send_first_at: 3
|
||||
unit_of_measurement: "%"
|
||||
raw: true
|
||||
filters:
|
||||
- clamp:
|
||||
min_value: 555.0
|
||||
max_value: 665.0
|
||||
- calibrate_linear:
|
||||
- 555.0 -> 0.0
|
||||
- 665.0 -> 100.0
|
||||
# - min:
|
||||
# send_first_at: 3
|
||||
|
||||
|
||||
# ---------------------- REMOVE FROM THERE TO END OF FILE WHEN TESTING FINISHED ----------------------
|
||||
|
||||
Reference in New Issue
Block a user