Mihai
January 8, 2017, 2:14pm
1
I need to check and store the minimum value of an analogue sensor (smoke) to use it as ground reference. To do this, I think to use a slider as lowest value memory (start at maximum, then an automation read the sensor value and, if lower, modify the slider to the latest lower value) and second automation to check the difference between the actual value and the slider value.
Do you have any other idea especially to check and store the lowest sensor value?
I have addes the following code which doesn’t work yet, if you know how to correct it, please let me know:
input_slider R1SL1:
slider1:
name: Smoke_Ground
initial: 1023
min: 0
max: 1023
step: 1
automation:
- alias: R1_smoke_ground
trigger:
platform: numeric_state
entity_id: sensor.R1_gas
below: '{{numeric_state.input_slider.slider1}}'
action:
service: input_slider.select_value
data_template:
entity_id: input_slider.slider1
value: '{{ numeric_state.sensor.R1_gas }}'
- alias: R1_smoke_alarm
trigger:
platform: numeric_state
entity_id: sensor.R1_gas
above: '{{numeric_state.input_slider.slider1 + 100}}'
action:
service: homeassistant.turn_on
entity_id: switch.R1_REL2
Thank you
Mihai
January 26, 2017, 5:24pm
2
Is it possible to keep a sensor value into a variable? How to do this through configuration.yaml file?
arsaboo
(Arsaboo)
January 26, 2017, 5:30pm
3
Did you try the Min/Max sensor? Also, take a look at the Statistics sensor.
Mihai
January 26, 2017, 6:08pm
4
Thank you, min/max is about at least two entities, so it doesn’t help, but statistic seems interesting and may be useful for me.
Mihai
February 4, 2017, 5:05pm
5
I succeed with statistics sensor, thanks. The code is the following, may be it can help other people:
sensor arduino_stat:
platform: statistics
entity_id: sensor.arduino_A0
name: arduinostat
sensor x1:
- platform: template
sensors:
analog:
value_template: '{{ "%.0f"|format((states.sensor.arduino_a0.state | float) - (states.sensor.arduinostat_mean.attributes.min_value | float)) }}'
timco
(timco)
April 11, 2019, 12:30pm
6
Please, can you help me in this?
Hi, I would like to send email notification, when some value of sensor rise about level. Now I am trying just to send that value with email to me. My code looks like this:
script.yaml
test_notification:
alias: 'Test Gmail Notification'
sequence:
- service: notify.alert_jarvis
data:
message: Temperature regulator measured value is: {{ states.sensor.measure_regulatortemp_modul }}
Recieved email text:
Temperature regulator measured value is: <template state sen…