EcoNet - current_temperature attribute is null for tankless water heaters

Tags: #<Tag:0x00007f3262ae1550> #<Tag:0x00007f3262ae1488> #<Tag:0x00007f3262ae1398>

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 to current_temperature when the sensor representing temperature changes or at startup (to seed the value of current_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

Sounds like you have a solution to your issue, but wanted to provide some details on the econet API.

No water heaters that I have had the option to review send back current temperature tank or tankless. I could see setting the temp to the current set point but that would kinda be a lie.

On the tank versions there is a sensor for available hot water in a percentage, I believe this is econets way of abstracting the temperature away from the user.

Interesting about you not ever seeing current_temperature get set. If I wasn’t using HomeKit this wouldn’t be an issue at all, but with current_temperature being null:

  • Home app always reports the temperature as 122F/55C.
  • Siri always says it’s going from 122 to {new_temp} when I change the temp.
  • Siri always reports the current temperature as 122.

While I agree that reporting temp as current_temp is a lie, within HomeKit I’m also being lied to. I think an argument could be made that this should be fixed within the HomeKit integration in that appears to be assuming that all devices reporting a temperature will also report current_temperature.

I did not mean to suggest that the EcoNet integration make current_temp = temp by default, just that there be an option. In retrospect, focusing on a workaround in the HomeKit integration may be more appropriate. Or none of the above because I’m probably one of very few people who are encountering this issue.

Regardless, yes, I did want to document what I found and did in case someone else with HA + EcoNet + HomeKit ever runs in to this issue and hopefully finds this post.

Regards,
-Jason

1 Like