asantaga / wiserHomeAssistantPlatform

Platform and related climate/sensors to support the Drayton Wiser Home Heating System
MIT License
217 stars 43 forks source link

HW Climate Functionality Review #481

Open msp1974 opened 1 month ago

msp1974 commented 1 month ago

@markchalloner , hope you are well.

I am doing some significant rework of this integration to reduce the code base and make easier to maintain. As part of this, I am reworking some of your code for the hotwater climate entity.

There is one piece, I am struggling to understand in terms of the logic of how this is supposed to function. If I lay out below, how I think it should work and where I am struggling, perhaps you can shed some light for me.

Hot Water Auto Mode (hub is in follow schedule mode)

Normal - This works to follow the schedule on and off but override to off when current temp reaches target temp and then cancel the override to turn back on when current temp is below target temp. Keeps doing this aslong as schedule is HW on. QUESTION: Should there be a delta value that it has to below target by X before it turns back on to prevent constant on/off around the target temp?

Once - Same as above except once target temp reached, uses override to turn off until next scheduled on event.

Hot Water Heat Mode (hub is in manual mode)

Normal - This works when the hotwater is manually turned on (when follow schedule is off) to heat the water to the target temp and then turn off.

Override - ??? This is the one I do not get. What is it trying to achieve?


QUESTION: Should the heat mode be more akin to the auto mode in that it has the following function?

Hot Water Heat Mode (hub is in manual mode)

Normal - Heat the water to target temp and then turn off. Never turn back on.

Continual - Maintains the water temperature all the time by turning on and off as it reaches target temp/goes below target temp (again, should we have some delta on this?)

It could be that it should follow the Auto mode settings and call them Normal (keep turning on and off to maintain temp), Once (heat once and then turn off again), but there is a risk that this is non intuative and leaves people with constantly running HW by mistake.

Then also have an Off mode which sets the HW to manual, cancels any override and turns off. Obviously any change (either in HA or in the Wiser app) to turn the water on, will set it to Heat mode in the climate entity.


I know that a lot of your code is addressing some missing functionality from the api, but I am looking to add that in to make it much simpler in the HA code but also maintain the off status and target temp between HA reboots.

If you can answer the use case for the Heat Mode override and also your thoughts on my suggested Heat Mode functionality. I'll also need you to help test when ready if that is ok too?

Thanks Mark

markchalloner commented 1 month ago

@msp1974. All good here thanks, same to you.

To answer your questions:

Hot Water Auto Mode (hub is in follow schedule mode)

Normal ... QUESTION: Should there be a delta value that it has to below target by X before it turns back on to prevent constant on/off around the target temp?

Yes, agreed...

... but what should the delta default to? I did a bit of research into standard (non-smart) hot water cylinder thermostats:

Maybe a user-configurable with a default of 8°C and the wiki updated with the reasoning for this wide differential?

Hot Water Heat Mode (hub is in manual mode)

Normal ... Override - ??? This is the one I do not get. What is it trying to achieve?

Your description of Continual below summarises this pretty well. I've added more details in the Appendix at the bottom of this reply.

QUESTION: Should the heat mode be more akin to the auto mode in that it has the following function? Normal ... Continual - Maintains the water temperature all the time by turning on and off as it reaches target temp/goes below target temp ...

Yes, agreed, Continual is a much nicer term. I would also rename Normal to Once here.

should we have some delta on this?

Yes. It would make sense to apply the same delta across both Auto and Manual modes.

It could be that it should follow the Auto mode settings and call them Normal (keep turning on and off to maintain temp), Once (heat once and then turn off again), but there is a risk that this is non intuative and leaves people with constantly running HW by mistake.

Agreed it would be nice to have consistency between the Auto and Manual modes. We can probably do this by updating the naming. If the naming is consistent then perhaps the default should be too.

I suggest we replace Normal in all cases with something more descriptive and to avoid implying this is the recommended or default state. Continual and Once work well for both Auto and Manual modes. Collecting this all together in your own words:

Regarding defaults, some considerations (highest priority first):

I'll also need you to help test when ready if that is ok too?

Yes definitely

Regards

Appendix

Hot Water Heat Mode: Normal vs Override

The Wiser app Hot Water control behaves differently to Room controls. Unlike Rooms, Hot Water doesn't natively have the concept of On and Idle (i.e. not currently heating but can start heating if the temperature drops below X°C). It can only be fully On (and Heating) or Off, stored in the WaterHeatingState field as On or Off. See the app screenshots below for how this is reflected in the UI.

Normal

In Normal mode the Climate's hvac_mode returns HVACMode.HEAT if WaterHeatingState = On and HVACMode.OFF if WaterHeatingState = Off.

✅Pro: The state matches the Wiser app. ⛔Con: Once the temperature rises above the set point the Climate entity will turn fully off and cannot turn itself back on.

Override

In Override mode the missing On and Idle state is tracked in Wiser by abusing the OverrideType field (i.e. is_override). The Climate's hvac_mode returns HVACMode.HEAT if it has an override. As overrides are only used by Wiser in Auto mode, this is a fairly safe hack, though it breaks the usability of the app somewhat (see con below).

✅Pro: Can turn on and off around the temperature set point ⛔Con: The on and idle state is not visible in the Wiser app and overrides are not cleared when moving to Auto mode in the Wiser app meaning the water could start heating outside of the schedule.

Note the override issue could be avoided by either finding another way to track the On and Idle state in Wiser or persisting it it only in Home Assistant.

Wiser App Hot Water control

Screenshot_20240513-220312

Wiser App Room control

Screenshot_20240513-220326

msp1974 commented 1 month ago

Thanks for your reply. I think i have found a way to not use overrides for managing both continual and once in manual mode and obviously use overrides in auto mode. It needs more testing by me to make sure the logic is right and also handle what happens when advance schedule (which itself uses the same overrides) and boost is used.

I need to think about advance schedule but what do you think of the below for boost?

Should we just have a single boost preset for hw that heats water to target temp once and then cancels. This is the same as turning the water on in manual heat once mode.

Or do we have different time period boosts that maintains the target temp for that period?