I am trying to find a way confirm that my temperature sensor is increasing. I have some automations to replace the need for nest for hot water boost and for the most part, I have everything running. The problem if have is ensuring it is reliable.
I am trying to find a way to be notified or run another action when I boost the hot water and it does not increase. So far my code is
alias: Hot Water Boost Failure (Duplicate)
description: ''
trigger:
- platform: state
entity_id: timer.hot_water_boost
to: active
condition:
- condition: template
value_template: >-
{{ as_timestamp( utcnow() ) | int > as_timestamp(
states.sensor.hot_water_temperature.last_changed ) | int +2*60 }}
action:
- service: notify.mobile_app_my_iphone
data:
message: Water Temperature failed
mode: single
I have a timer set for 30 minutes so I am trying to use a as trigger for when the timer starts.
The issue I have is getting the temperature when boost starts and then checking it in about 10 minutes to confirm it increasing.
Trigger on your boost entity being on for x minutes, then check the trend value. If it is not trending up by a certain amount send your message.
trigger:
platform: state
entity_id: switch.hw_boost
to: 'on'
for:
minutes: 5
condition:
platform: numeric_state
entity_id: sensor.hw_trend
below: <vaue to be determined by experiment>
action:
- service: notify.mobile_app_my_iphone
data:
message: Water Temperature failed
The Trend option sounds like it will do exactly what I am trying to accomplish. I looked at the documentation but I don’t understand how to use it in my code. I don’t know how to get a measurement of the temperature now and again in 5 minutes. Your example says “value to be determined by experiment” but I don’t know how to implement it.
I am not interested in the current temperature value. I just want a way to ensure it is increasing when I boost. I have had issues before where I would call for boost by either manual boost or in an automation and it would not heat the hot water. The failures have been with either the pi zero running the python code, the MQTT transmitting the code, home assistant or the boiler itself.
I am trying to make it as reliable as possible so if anything fails, I at least get a notification.
Thanks again for your help and anymore you have, I will gladly accept.
You don’t have to. The sensor will do this for you.
Create the trend binary sensor with just the required options, and watch it’s gradient attribute value when you turn on the water heater.
Set the min_gradient option of the trend sensor a bit below this value. Then this binary sensor will turn on when your water is actually heating. My condition is wrong in the example above, it should just be a state condition looking at the trend binary sensor.
condition:
platform: state
entity_id: binary_sensor.hw_trend
state: 'on'
The trend sensor works perfectly. I didn’t know about the trend function but now that I do, I will use it again.
Here is the code that works.
alias: Hot Water Boost Failure
description: ''
trigger:
- platform: state
entity_id: timer.hot_water_boost
to: active
for: '00:25:00'
condition:
- condition: state
entity_id: binary_sensor.water_temperature_trend
state: 'off'
action:
- service: notify.mobile_app_first_iphone
data:
message: Water Temperature Boost Failure
- service: notify.mobile_app_second_iphone
data:
message: Water Temperature Boost Failure
mode: single