Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quirk for CentraLite 3156105 thermostat #3706

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gmacon
Copy link

@gmacon gmacon commented Jan 12, 2025

Proposed change

This adds a quirk for the CentraLite 3156105 thermostat, which has the semantics of the Running Mode and the heat/cool bits of Running State swapped.

Additional information

I'm using this as a custom quirk with my thermostat, and it correctly reports Idle, Heating, and Fan states. It's freezing here, so I haven't tried cool, but I see no reason that it wouldn't work. Edit: It's warmed up, and I was wrong. See below for details.

This fixes the issue I originally reported on Discourse.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

Attention: Patch coverage is 34.78261% with 30 lines in your changes missing coverage. Please review.

Project coverage is 90.69%. Comparing base (d80730f) to head (8c8b5a9).
Report is 97 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/centralite/cl_3156105.py 34.78% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3706      +/-   ##
==========================================
+ Coverage   89.86%   90.69%   +0.83%     
==========================================
  Files         322      327       +5     
  Lines       10387    10637     +250     
==========================================
+ Hits         9334     9647     +313     
+ Misses       1053      990      -63     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gmacon gmacon force-pushed the centralite-3156105 branch from 39fcf85 to 376b3ec Compare January 13, 2025 22:26
@gmacon
Copy link
Author

gmacon commented Jan 13, 2025

OK, here's a slight modification. I noticed that the updates were instantaneous when the fan mode was "Auto", but delayed when it was "On" and realized this was because the incorrect running_state implementation in the thermostat resulted in no change to the running state when the system stopped. This updates both attributes whenever either is updated, which should prevent the delay.

@gmacon
Copy link
Author

gmacon commented Feb 9, 2025

It's gotten warmer here, and I no longer believe this is 100% correct. When the system is running in cooling mode, it's reporting heat. This makes me suspect that something unusual is happening related to my home having a reversible heat pump...

@gmacon gmacon force-pushed the centralite-3156105 branch from 376b3ec to 8c8b5a9 Compare February 10, 2025 01:07
@gmacon
Copy link
Author

gmacon commented Feb 10, 2025

Now I have no idea what the firmware developers were thinking. With my heat pump:

System Mode Fan Mode Running? running_mode running_state
Off Auto No Off (0) Heat (1)
Heat Auto No Off (0) Heat (1)
Heat Auto Yes Heat (4) Heat + Fan (5)
Heat On No Off (0) Heat + Fan (5)
Heat On Yes Heat (4) Heat + Fan (5)
Cool Auto No Off (0) Heat (1)
Cool Auto Yes Cool (3) Heat + Cool + Fan (7)
Cool On No Off (0) Heat + Fan (5)
Cool On Yes Cool (3) Heat + Cool + Fan (7)

Edited to add:

I know @bbenne10 has one of these thermostats and a conventional AC/furnace system. Can you chime in with the corresponding table for your system when you get a chance? Thanks!

@bbenne10
Copy link

@gmacon: How did you go about grabbing these values? As discussed (out-of-band, for anyone else watching), I'm happy to report back, but I'm not sure I see a way to grab these values through either a dashboard or log graph. Based on your table and reading the diff, some assumptions:

  • "system mode" is the explicitly user-set preferred heating mode (off, heat, cool)
  • "fan mode" is the explicitly user-set fan state (on, off)
  • "running" is...well, whether the unit has decided it should be running, given the user's preferred set-point, the temperature sensor's detected temperature, and the current system mode.
  • "running mode" is a bit-value representation of the current system mode.
  • "running state" is intended to be the bitmasked combination of system mode and fan mode (and is assumed to be zeroed when the unit is not running)

Is this right? Reading your table, I agree that it looks like the Heat bit is maybe being abused to indicate either "I am currently in heat mode" or "I am in heat pump mode"...

@gmacon
Copy link
Author

gmacon commented Feb 10, 2025

That's not obvious, is it?

With the quirk disabled, on the device page, in the three dots menu on the "Device info" card, select "Manage zigbee device". In the dialog, select the "Thermostat" cluster, then in the attribute menu select running_mode or running_state as appropriate, and push "Read Attribute". Here are the enum definitions for these two attributes:

https://github.com/zigpy/zigpy/blob/a082f1257c0acebcdb3cfa3a1bff7535c5a9fa12/zigpy/zcl/clusters/hvac.py#L310-L324

@bbenne10
Copy link

I should be able to get that to you shortly (likely over lunch today).
I'll have to disable the version of the quirk I have but that should be trivial.

Thanks for the hand-holding :)

@bbenne10
Copy link

bbenne10 commented Feb 11, 2025

Sorry for the delay. Thought I could do this during lunch, but life had other plans.

I thought this would be simple, but it is getting a bit more interesting.
Without the quirk, my unit refuses to stay in auto fan mode while running.
It immediately sets itself to On (maybe to report that it is, in fact, running?)
This leads me to question the entries below with fan mode as auto, but they do represent what I observed without manually changing the fan mode value to on.

Even still: this is about what I would expect given the enum definitions you linked (and a new working understanding of the two variables involved).

System Mode Fan Mode Running? running_mode running_state
Off Auto No Off (0) Off (0)
Heat Auto No Off (0) Off (0)
Heat Auto Yes Heat (4) Heat + Fan (5)
Heat On No Off (0) Fan (4)
Heat On Yes Heat (4) Heat + Fan (5)
Cool Auto No Off (0) Off (0)
Cool Auto Yes Cool (3) Cool + Fan (6)
Cool On No Off (0) Fan (4)
Cool On Yes Cool (3) Cool + Fan (6)

@gmacon
Copy link
Author

gmacon commented Feb 11, 2025

Interesting. It clearly is to do with being in heat pump mode. Except for Heat-On-No, your running_state looks like it's already correct.

Now that you've pointed it out, I've also noticed that HA displays the fan mode as "on" when the system is running... maybe there's another thing we need to override for that, too...

@bbenne10
Copy link

bbenne10 commented Feb 11, 2025

I have updated my table - you noticed a mistake (right around then was when I started noticing the fan mode switching in the UI, so I got distracted and didn't check the right table row). I tried again and - as you'd expect - it is actually Fan (4). These state transitions seem to work fine. The heatpump is clearly doing something weird to this device.

@gmacon
Copy link
Author

gmacon commented Feb 11, 2025

Based on that, I now speculate that I have bad hardware, specifically, the running_state bit 0 is stuck on! Does HA behave normally with the quirk disabled for you? (Other than the fan auto/on thing we previously mentioned, of course.)

@bbenne10
Copy link

Best I could tell it was working okay, but I didn't futz with it too much other than to generate the table. I'll have a go at it this evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants