Hi,
I just implemented the Airthings BLE Sensors on an ESP32. It works very nicely.
I was even able to read two devices with one ESP32 board.
Question: there is an update_interval in the sensor, where I can set the interval, the device is queried via BLE.
Is it possible to set the update interval dynamically?
(I tried to come up with a lambda-code, but it does not work, because the update interval just does not allow templating there.)
I would like to get readings every 5min between 6:00 - 8:00 || 11:30 - 14:00 || 17:30 - 20:30.
The rest of the day 8:00 - 21:00, I would like to get readings every 30min.
During the night 21:00 - 6:00, I would like to get readings every 60min.
Goal behind all this: save battery power on the Airthings-devices.
Any ideas are very welcome.
sensor:
# Airthings Wave Plus Dachzimmer
- platform: airthings_wave_plus
name: '${friendly_name} Dachzimmer'
ble_client_id: awp_Dach
update_interval: 5min # default
battery_update_interval: 24h # default
temperature:
name: "Dach Temperatur"
id: awp_Dach_temp
radon:
name: "Dach Radon"
id: awp_Dach_Radon
radon_long_term:
name: "Dach Radon Long Term"
id: awp_Dach_Radon_long
pressure:
name: "Dach Luftdruck"
id: awp_Dach_pressure
humidity:
name: "Dach Feuchtigkeit"
id: awp_Dach_humidity
co2:
name: "Dach CO2"
id: awp_Dach_co2
tvoc:
name: "Dach VOC"
id: awp_Dach_voc
illuminance:
name: "Dach ambient light"
id: awp_Dach_light
battery_voltage:
name: "Dach Batterie Spannung"
id: awp_Dach_volt
# Airthings Wave Plus Dachzimmer: Batterieanzeige in %
- platform: copy
source_id: awp_Dach_volt
name: 'Dach Battery Level'
id: awp_Dach_battery
unit_of_measurement: "%"
device_class: battery
accuracy_decimals: 0
filters:
- calibrate_linear:
- 2.2 -> 0
- 3.1 -> 100