zlangbert / ha-daikinone

Home Assistant integration for Daikin One HVAC systems and thermostats
14 stars 7 forks source link

Invalid sensor values reported when equipment is offline #22

Open zlangbert opened 8 months ago

zlangbert commented 8 months ago

When equipment stops reporting, for example due to being powered off, the values for at least some sensors go to their max values. I've seen outdoor unit temperature sensors at 215 after flipping the breaker.

We should likely return None from the sensor in these cases. The tedious part will be determining the max values for different API fields so they can be filtered out.

wirecuttr commented 8 months ago

I'm seeing this too. I'll try to help with finding the max values.

wirecuttr commented 8 months ago

Did some testing and it was kind of a bust.

Method was this... In Developer tools, Templates:

{% set attribs = ['preset_mode', 'min_temp', 'max_temp','current_temperature', 'temperature', 'target_temp_high', 'target_temp_low', 'current_humidity', 'hvac_action'] %}
{%- for att in attribs %}climate.main_basement_thermostat.{{ att }},{{ state_attr('climate.main_basement_thermostat',att) }}
{% endfor -%}
{% for state in states %}
  {%- if 'main_basement' in state.entity_id %}
    {{- state.entity_id + ","+ state.state }}
  {% endif %}
{%- endfor %}

ran 4 conditions and pasted the results of the above template into the attached spreadsheet. Conditions:

  1. Column B: All equipment ON
  2. Column C: turn OFF breakers to both heat pumps, wait 5-10 min
  3. Column D: All equipment ON, wait 5-10 min
  4. Column E: turn OFF breakers to both heat pumps AND both furnaces, wait >30min

DaikinOne Integration Power Loss testing.xlsx

When everything is off, the Daikin Android app showed the thermostats offline after 5 or so minutes. Surprisingly, the api is still showing as if online with most values looking normal when all breakers have been off for over 30 minutes. I highlighted in red a few high/suspect values in the file.

wirecuttr commented 8 months ago

OK, so took another look. What seems to happen is that there is a temporary spike in a lot of values when the equipment is powered ON or OFF. The values do not remain high while the equipment is powered off.

I looked at the history graphs for the 4 devices (Thermostat, Heat pump, Furnace, EEV). You can see the spikes in the images:

Thermostat EEV HeatPump1 HeatPump2 Furnace

You can't really tell from the pics which lines are spiking. The middle area of the graph between the spikes is when all the equipment is powered off (breakers off).

I went through each of the graphs and these are the ones that spike high temporarily at power on or off transitions: Heat Pump Total Runtime Heat Pump Compressor Speed Target Heat Pump Compressor Speed Heat Pump Outdoor Fan Speed Heat Pump Outdoor Fan Target Speed Heat Pump Suction Pressure EEV Coil Pressure Heat Pump EEV Opening Heat Pump Heat Demand Heat Pump Cool Demand Heat Pump Fan Demand Heat Pump Dehumidify Demand Heat Pump Fan Airflow Demand Heat Pump Air Temperature Heat Pump Coil Temperature Heat Pump Discharge Temperature Heat Pump Liquid Temperature Heat Pump Defrost Sensor Temperature EEV Coil Indoor Superheat Temperature EEV Coil Liquid Temperature EEV Coil Suction Temperature Heat Pump Power Usage Heat Pump Compressor Current Furnace Airflow Furnace Fan Demand Requested Furnace Fan Demand Current Furnace Heat Demand Requested Furnace Heat Demand Current Furnace Humidification Demand Requested Furnace Cool Demand Requested Furnace Cool Demand Current Furnace Dehumidification Demand Requested Furnace Power Usage

So the high values on those sensors should be ignored.

As for detecting when the devices have lost power (or internet), the other thing that happens is that there are actually no updates while the equipment is off. When I download the history graphs and look at the timestamps on each data point that is obvious. It looks like that if thermostat is powered on then Home Assistant gets updates from pretty much exactly once per minute. The other devices have more variable timing between updates. Perhaps you could do something like put in a timeout and just mark all of the devices/sensors Unavailable if the last thermostat update is more than a few minutes old?

alankfreeman commented 1 month ago

I’ve been seeing this behavior as well. I’m guessing the equipment has returning a value of -1, as all of the spiked values are 2^x -1. For example, several fields return 65535, or the max value in a 16 bit field. This makes several of my graphs useless for 24 hours until the spike leaves the default view. I agree that it would be great to show zero or none in place of the -1 / high value.