Greetings. I’m running the EcoNet integration with a Rheem tankless water heater and Home Assistant 2021.2.3. I’m also using the HomeKit integration.
I’ve noticed that there are two temperature related attributes for my water heater entity: temperature
, and current_temperature
. Temperature
tells the water heater what to heat the water to when hot water is flowing. Current temperature
is always null
for my tankless. Presumably it’s the temperature of the water being stored in a tank-based system. It makes sense as the goal of the tankless is to produce water at the temperature I specify so temperature
(what I set) is (more or less) the current temperature of the water flowing from the unit. I can set the temperature attribute via Home Assistant, the wired remotes that came with the tankless, and HomeKit and have that value properly reflected in the wired tankless remotes.
That being said, the HomeKit experience has a minor bug for me: it always reports the current temperature as 122F. 122F/55C seems to be the default temperature somewhere. What I see in the Home App the widget for the water heater with a yellow badge that reads 122F and at the bottom of the widget it will read “Heating to {temperature}
…”. Siri will also always respond that it’s changing the temp "from 122 to {temperature}
". I understand that this is perfectly normal for a tank-based system or at the very least a system that reports separate temperature
and current_temperature
values for the EcoNet integration to consume. My tankless seems to lack a sensor for current_temperature
.
It would be nice to have an EcoNet integration option that would simply report the current_temperature
attribute as the current value of the temperature
attribute. Since there isn’t, I used the following work-around:
- A template sensor to track the
temperature
attribute of the tankless water heater entity since there isn’t a direct way to trigger a automation on an entity’s attribute change. - An automation that calls a python script to sync the
temperature
attribute tocurrent_temperature
when the sensor representingtemperature
changes or at startup (to seed the value ofcurrent_temperature
). - A python script that does the actual attribute value copying since there’s currently no way to do this natively within Home Assistant.
First, the template sensor configuration for the temperature
attribute:
- platform: template
sensors:
water_heater_temp:
friendly_name: "Water Heater Temp"
value_template: "{{ state_attr('water_heater.tankless_water_heater','temperature') }}"
Second, the automation:
- id: '1613316881400'
alias: Water Heater - Sync Temp to Current Temp Attribute
description: Sync set temp to current temp on change or HA startup.
trigger:
- platform: state
entity_id: sensor.water_heater_temp
- platform: homeassistant
event: start
condition: []
action:
- service: python_script.sync_tankless_current_temp
data:
entity_id: water_heater.tankless_water_heater
mode: single
Third, the script:
entityId = data.get('entity_id')
if entityId is None:
logger.warning("===== entity_id is required =====")
stateObject = hass.states.get(entityId)
state = stateObject.state
attributesObject = stateObject.attributes.copy()
newCurrentTemp = attributesObject['temperature']
if newCurrentTemp is not None:
attributesObject['current_temperature'] = newCurrentTemp
hass.states.set(entityId, state, attributesObject)
With these three components in place, any change to the temperature setpoint, whether changed via physical controls, Home Assistant app/web, or HomeKit, will change the value of the temperature
sensor, which triggers the automation, which runs the python script. All of this happens very quickly and is working well.
Regards,
-Jason