gazoodle / gecko-home-assistant

Home Assistant integration for spas equipped with Gecko Alliance in.touch2 modules
MIT License
68 stars 23 forks source link

Economy mode turns off randomly #75

Open llamafilm opened 1 year ago

llamafilm commented 1 year ago

Since discovering this plugin a few weeks ago, I'm trying to keep my spa on economy mode most of the time when I'm not using it. I notice economy mode turns itself off occasionally. I don't see any errors in the log, but here's a screenshot of the issue in the log book. Today I have enabled debug logging for homeassistant.component.gecko so I will share more details next time it happens. Is there any other logger component I should enable?

Screen Shot 2023-01-27 at 12 44 13

Component version 0.1.8 Home Assistant version 2023.1.7

llamafilm commented 1 year ago

This happened again, and this time I noticed at the same moment, the current temperature dropped to 32ºF and the pump turned on. The temperature came back to normal after about 1 minute. Here are logs from 1 minute before and after this event, which occurred at 19:19:04.

Screen Shot 2023-02-03 at 19 37 11
gazoodle commented 1 year ago

Interesting. Obviously the real water temp isn’t freezing, but for some reason the spa pack thinks it is. Maybe faulty probe on the heater, or loose connection?

I can confirm that no logic exists in either the geckolib driver nor the integration to turn pumps on in response to temp changes, so the activity must be down to the spa pack making this call … obvious it would want to do something if it felt the water was that cold.

I’m not sure what technology is used for the temp sensor. A common one is an NTC thermistor. This will decrease its resistance the higher the temp, and conversely increase its resistance as the temp drops. A faulty sensor or loose connection is going to look to the control circuit like the lowest temp. Either way, this event will panic the control system and it’s going to come out of eco mode, and start moving the water around to prevent any damage to the spa.

Hope that helps.

llamafilm commented 1 year ago

Thanks. So from the log, can you confirm the in.touch2 module is actually receiving that value of 32ºF? I was wondering if it's some kind of data parsing error in the code. It sounds like this may be a hardware fault in the spa. I wonder how long this has been occurring. The spa is about 1 year old, and I just installed the in.touch2 module a few weeks ago. So before that, I never used economy mode at all. I guess it's possible this has been happening all along and I never noticed. I setup a notification in HA for this, so next time I'll try to run out and quickly look at the LCD display on the spa to see if it matches.

gazoodle commented 1 year ago

I can confirm that, yes.

These lines from the log show that …

2023-02-03 19:19:04.789 DEBUG (MainThread) [geckolib.driver.async_spastruct] Status block segments complete, update and complete 2023-02-03 19:19:04.790 INFO (MainThread) [geckolib.driver.accessor] Value for RhWaterTemp changed from 103.5 to 32.0 2023-02-03 19:19:04.790 DEBUG (MainThread) [geckolib.driver.observable] GeckoTempStructAccessor 'RhWaterTemp': 32.0 changed from 103.5 to 32.0

There is more in there too. You can see the Eco mode get disabled, P1 get powered up, and indeed the display temp for the panel, so yes I expect that to show 32. There is also an error state variable TempNotValid that I’ve not seen in logs before (perhaps because I wasn’t looking) that seems to indicate that the temp value is in error. This strongly suggests the pack knows there is a sensor fault.

As you say, this event clears itself after about a minute when the status returns to normal, and the log shows this too.

Some existing future tasks for me included exposing the error state variables which I can probably do at the next update as I have to do some work on the driver before HA 2023.3 as I’m using a to-be-deprecated API. See Issue #76

gazoodle commented 1 year ago

Actually, the latest version should have extra info to check if the spa pack reports that error too, which I expect it to do now

llamafilm commented 1 year ago

It looks like the spa provides 2 different temperature values: DisplayedTempG and RhWaterTemp. They tend to be similar but not exactly the same. I think I read somewhere that the spa only samples water temperature when the pump is running. Maybe it gets weird values for a moment each time the pump turns on. Should we ignore the temperature reading as long as TempNotValid is true? I'm just guessing here.

llamafilm commented 1 year ago

I've been monitoring that new error entity and it hasn't shown anything in the past 2 days, while this error has happened twice.

gazoodle commented 1 year ago

Hmm, ok I’ll take a look to see if there might be a reason why the sensor wouldn’t update if the pack still detected the fault (I’m assuming the logs indicate that the TempNotValid error still shows in the log, but not in the error sensor?)

llamafilm commented 1 year ago

Yes, TempNotValid appears in the log every time but not in the error sensor entity.

llamafilm commented 1 year ago

So far the only thing I’ve seen the error sensor is OverTemp when the temp goes over 104. That’s correct, matching the warning shown on the LCD screen. Maybe warning would be a better label for this.

While I don’t fully understand the meaning of TempNotValid, what do you think about ignoring temperature changes any time it’s in that state, and instead hold the last valid temperature value.