PeteRager / lennoxs30

Home Assistant Lennox S40 / S30 / E30 / M30 integration
MIT License
87 stars 12 forks source link

Setting Target Heat, then drops back #281

Open dresslerc opened 9 months ago

dresslerc commented 9 months ago

Describe the bug I have the S30 with the zoning panel which has 2 zones (Upstairs, and Downstairs). During heating season, sometimes I noticed when I try to increase the target temperature, it doesn't set. It looks like the temperature is changing and then it drops back.

I made a video showing the behavior (only happens on "Upstairs" zone).

https://github.com/PeteRager/lennoxs30/assets/375080/cf6c4f42-6c6a-4bc7-b931-b89744d45b6f

Same affect using the built in Thermostat card: https://github.com/PeteRager/lennoxs30/assets/375080/568b1ca4-6150-44d7-9534-53ffcc736520

I do have a dual fuel setup. Heat Pump and 2-Stage Furnace. In this case its set to Heat Pump only.

If I go into the official Lennox App, and change the temperatures (say to 63f), then Home Assistant updates, and I cant go above that temperature:

https://github.com/PeteRager/lennoxs30/assets/375080/acb2f080-f85c-4719-9eff-57bd195eee5a

To Reproduce Randomly this occurs. Havent found any kind of pattern. But only happens with HEAT. Cant recall if "Downstairs" zone is ever affected.

Expected behavior Changes target temp to whatever I set.

Screenshots/Logs Here is my setup:

image

Version

Integration Configuration

Additional context

PeteRager commented 9 months ago

That doesn't look right and it's strange that it works sometimes and not others.

Any errors in the log file?

Let's enable message logging, reload the integration and run it until you get a setpoint sequence that doesn't take and let me know what the high number was. Then we can look in the logs and verify if the message is being sent and see how the S30 responds.

Instructions are here in the second section.

https://github.com/PeteRager/lennoxs30#reporting-bugs

PeteRager commented 9 months ago

I believe what is happening is the error causes HASS to unload the integration. However, the start_client task is still in the process of setting up and becomes disconnected which causes an unhandled exception to be thrown. So I believe we just need to catch that exception in the start_client task so the integration unloads successfully.

However, I don't think that completely solves the problem as the root cause are values that the integration believes to be invalid and we may be in a loop of loading and unloading.

dresslerc commented 9 months ago

I'll get you a log dump tonight

dresslerc commented 9 months ago

Just tried and its working now unfortunately. Next time it shows up I'll enable logging and reload the integration.

PeteRager commented 9 months ago

Since it does work, the issue is intermittent and likely caused by some other factor.

  1. Communication Failure. WIFI connection is going down and up. If this was happening, I'd expect to see errors in the log and error counts reported in the lennoxs30.state entity.
  2. Speed of setpoints. Perhaps when rapidly changing setpoints some of them get dropped by the controller. This we could test by running a script that sets it quickly to different values - like 60,61,62,...70. The script should be able to set it a lot faster than pushing the UI button
  3. Schedule. If you are running a schedule, the process of doing the setpoint changes. First, the integration needs to create a schedule override, then do the setpoint. So it's possible there's a problem in this logic.
  4. The setpoint is never getting sent. Message log would show this, as would the send_count of the lennoxs30.state object.
dresslerc commented 7 months ago

Finally had this happen again. This time it was the downstairs zone (between 450 PM and 500 PM). Was trying to set the HVAC above 69 (I think) but it kept jumping down. Had to use the official iComfort app to change the temp.

s30error.txt

PeteRager commented 7 months ago

According to the log the system mode for the zone is off. Typically this is set to "Heat" or "Cool". When it is off the integration cannot perform a setpoint because it does not know which limit is being set - the cool setpoint or the heat set point.

Looking at the code I would expect an error to be logged by the integration. Is this happening?

Is your system in single setpoint mode - which means there is one setpoint that is used for both heat and cool? If so, there I may need to trace this branch of the integration to verify it is generating an error.

I do believe the underlying cause is the zone is set to off.

chris-mosley commented 6 months ago

So just to add on. I have experience this exact same bug.

I can change the temp on the thermostat itself, but if I adjust within HASS then it will jump back to the current set temp.

And it is frequent, it's not like once in a while. I think the only thing that really fixes it is maybe a thermostat or smarthub restart/reset?

dresslerc commented 6 months ago

Sorry I forgot to reply. No I only have my unit in either heat or cool mode. I never have it in heat and cool mode.

PeteRager commented 6 months ago

@dresslerc the HVAC mode was set to off on all zones. We can see that in the log file.

  "systemMode": "off"

There was no entry in the log that shows is was in "heat" mode or "cool" mode.

PeteRager commented 6 months ago

@chris-mosley

please enable message logging and then post a copy of the message log when the problem occurs as well as the time the problem occurs. Please check the log also for warning messages.

PeteRager commented 6 months ago

When this happens also try to refresh the HA UI or reload the App. I have seen the UI get in a funky state where commands and state updates become erratic.

PeteRager commented 4 months ago

Stale

jstrot commented 4 months ago

I'm still experiencing this same issue about once a week and was subscribed to this issue in the hope of an eventual resolution.

Reloading the UI does not help and when it fails on one device it also fails the same on all devices (Android, MacOS, Web). Sometimes it will let you reduce the temperature target but not increase it over a specific degree. Sometimes it works in AC mode but not in heat mode. Sometimes it unblocks after 5-10 minutes of fiddling back and forth. Sometimes it just works the next day. Lennox's iComfort continues to work fine when HA fails.

I'm enabling debug logging in my Lennox integration. Is there anything I/we can do to help investigate this?

dresslerc commented 4 months ago

This only happens to me in Heat mode. Never in Cool mode.

Didn't happen very often this winter. Maybe 2-3 times.

PeteRager commented 4 months ago

There is no current action being taken. The message log that @dresslerc provided above showed that the hvac system was turned off (e.g not in heat mode)

We need to capture a message log when it happens. This will show the messages getting sent (e.g. setpoints) and the responses coming back.

https://github.com/PeteRager/lennoxs30?tab=readme-ov-file#reporting-bugs

Once is happens repeatedly, then try reloading the integration. And see if that fixes. Then post or email me the message log files. Also check the home assistant logs for warnings.

PeteRager commented 4 months ago

Sometimes it will let you reduce the temperature target but not increase it over a specific degree.

Not sure I understand this. What would be an example?

Reloading the UI does not help and when it fails on one device it also fails the same on all devices (Android, MacOS, Web).

That's good to know

Sometimes it unblocks after 5-10 minutes of fiddling back and forth. Sometimes it just works the next day.

By unblock, you mean eventually it will take the setpoint?

jstrot commented 4 months ago

Sometimes it will let you reduce the temperature target but not increase it over a specific degree.

Not sure I understand this. What would be an example?

Let's say I'm in Heat mode at 19C. I try to increase to 19.5C but it snaps back to 19C within 5 seconds. I can reduce the temperature to 18.5 or 18 and it will work, the desired target setpoint gets programmed properly and doesn't snap back. I can go up again to 19C. If I try again to go to 19.5C, no dice, it still snaps back.

Reloading the UI does not help and when it fails on one device it also fails the same on all devices (Android, MacOS, Web).

That's good to know

Yeah, it probably eliminates local UI issues.

Sometimes it unblocks after 5-10 minutes of fiddling back and forth. Sometimes it just works the next day.

By unblock, you mean eventually it will take the setpoint?

Correct: Sometimes it accepts the setpoint after 5-10 minutes of fiddling back and forth.

Thanks for taking the time to look into this again! Cheers.

jstrot commented 4 months ago

This only happens to me in Heat mode. Never in Cool mode.

Didn't happen very often this winter. Maybe 2-3 times.

Too bad you're still seeing the issue. I'm confident we'll get to the bottom of this.

I'm not 100% sure I've seen it in Cool mode myself. I think I remember my wife saying so but we're not certain. Last time it was definitely in Heat mode. I tried to switch to Cool mode and it was working fine, went back to Heat mode and the same issue could be experienced again.

chris-mosley commented 4 months ago

Sorry I've been out of pocket here. my area got warm and so i stopped seeing the issue as I wasn't in heating mode as often. But the issue is very much still there.

One thing I'm not sure i mentioned or if anyone else did. Is that I do have mine set to diagnostic level 2 so that I can log all those stats. I know the OP stated theirs was not but idk. More info more better.

@jstrot I don't think I've seen it in cooling mode.

Something else that might be relevant is I have a heatpump with dual fuel. So maybe there's some addtional complication there?

PeteRager commented 4 months ago

I reviewed the code this morning. There are several different operating modes, and it would be good to understand what modes you are running in to see if it's a problem related to a specific mode.

a) Fahrenheit vs Celsius b) Single Setpoint Mode (when in heat/cool there is only one setpoint) c) Running using schedules on the panel

Also it'd be helpful to have at least "info" level debugging turned on, in addition to message logging.

logger:
  default: warning
  logs:
    custom_components.lennoxs30: info
    lennoxs30api: info

Getting it to happen with the info and message logging turned on is what we need to diagnose.

jstrot commented 4 months ago

a) Fahrenheit vs Celsius

Celsius

b) Single Setpoint Mode (when in heat/cool there is only one setpoint)

Single Setpoint Mode

c) Running using schedules on the panel

No schedules configured.

Also it'd be helpful to have at least "info" level debugging turned on, in addition to message logging.

Yes. I turned on "debug" level, as per Reporting Bugs

jstrot commented 4 months ago

One thing I'm not sure i mentioned or if anyone else did. Is that I do have mine set to diagnostic level 2 so that I can log all those stats. I know the OP stated theirs was not but idk. More info more better.

@chris-mosley, where is this "diagnostic level 2" configured?

@jstrot I don't think I've seen it in cooling mode.

OK, thanks for confirming.

Something else that might be relevant is I have a heatpump with dual fuel. So maybe there's some addtional complication there?

For comparison, my system has only a gas furnace + A/C. No heatpump.

jstrot commented 4 months ago

@chris-mosley, where is this "diagnostic level 2" configured?

I found it: After enabling "Diagnostic sensors" in the HA integration configuration and reloading, I now see a new "System_diagnostic_level" sensor and set it to 2.

Thanks.

chris-mosley commented 4 months ago

I reviewed the code this morning. There are several different operating modes, and it would be good to understand what modes you are running in to see if it's a problem related to a specific mode.

a) Fahrenheit vs Celsius b) Single Setpoint Mode (when in heat/cool there is only one setpoint) c) Running using schedules on the panel

Also it'd be helpful to have at least "info" level debugging turned on, in addition to message logging.

logger:
  default: warning
  logs:
    custom_components.lennoxs30: info
    lennoxs30api: info

Getting it to happen with the info and message logging turned on is what we need to diagnose.

a) Fehrenheit b) Single setpoint c) no schedules

additionally I do have one other modification I just remembered. I have it set to not do half degrees.
Before if I hit the up arrow on the app/webui it would go 70 -> 70.5 -> 71.
As far as I know it doesn't actually support half degrees in F. So mine the step is set to a full degree per tap.

chris-mosley commented 4 months ago

OK so while I was writing the last comment I decided to test it out. And I remembered one more behavior I don't know if anyone else had mentioned. It seems like its always when i go above some temperature. It was 71, I could modify the set temp to my hearts content as long as it was under 71. over 71 gets pulled back. but then I restarted the container and the new number was 69.

I enabled debug logging but I don't see anything obvious in it.

2024-05-06 00:04:51.947 DEBUG (MainThread) [custom_components.lennoxs30] messagePump host [lennox-s30.th.local] running
2024-05-06 00:04:53.979 DEBUG (MainThread) [custom_components.lennoxs30] messagePump host [lennox-s30.th.local] running
2024-05-06 00:04:53.988 DEBUG (MainThread) [custom_components.lennoxs30] messagePump host [lennox-s30.th.local] running

Is there a particular line I should be looking for? I've got all the sensor data mixed in there too

PeteRager commented 4 months ago

The panel has a maximum heat setpoint that is configured for it, which should be captured in the max_temp attribute of the climate entity. If the setpoint gets sent to the integration there will be a message logged. Try with a lower setpoint like 65 and see if this message gets logged. That way we will know the logger config is working properly. If you see it for 65 and not for 71, that would indicate the setpoint is being filtered out / lost somewhere in HA.

The HA UI sometimes seems to not reconnect completely after it's been sleeping for a while (using the app on iPad), and I have to reload it before it works again.

        _LOGGER.info(
            "climate:async_set_temperature zone [%s] hvacMode [%s] temperature [%s] temp_high [%s] temp_low [%s]",
            self._myname,
            r_hvacMode,
            r_temperature,
            r_csp,
            r_hsp,
        )

IMG_3147