I’m using a Dallas sensor to measure the temperature in a room and want to get the sensor update interval value the ESPhome web interface.
The web interface looks like this:
For that I use the following code:
number:
- platform: template
id: select_sensor_update_time
name: "Sensor update time (s)"
optimistic: true
mode: box
min_value: '10'
max_value: '300'
step: '10'
restore_value: yes
initial_value: '30'
on_value:
then:
- logger.log:
format: "Chosen option: %s "
args: ["x.c_str()"]
Next I want the use this value the set the sensor update_interval but I can find a way to use the value appended with ‘s’. Is there a way to get this done?
## Get the sensor data every <update_interval>
sensor:
- platform: dallas_temp
address: 0xf8041662dbf3ff28
id: dallastempid
name: dallas-temperature
accuracy_decimals: 1
update_interval: 30s
filters:
- offset: 1.0