For the night-time automation to work, it has to have a time based trigger to force it to evaluate the room temperature against the new thresholds, otherwise it’ll do nothing since the thermostat is above the new lower setpoints.
Eg, this trigger fires just at 9pm with id 9pm:
- at: "21:00:00"
id: 9pm
enabled: true
trigger: time
The action that fires is the one with id 9pm and it’s job is to check to see if the temperature is above the setpoint. If so, turn off the heating:
Modulation is available from 1 to 10 and this adjusts how much of an offset the Madoka will apply at each 0.5c step. 10 results in roughly a 3c change, 1 would be a fraction of that and then you have all the steps in between.
In the installer ref guide, search for ‘Leaving water temperature: Modulation’.
There it states the value is 0-10c but my testing shows at value 10, it operates in ~3c steps. Perhaps there are three steps making 10c in total. I found a value of 8 similar to my 2c steps in the HA automation.
Thanks @chrisg , yes it makes sense but what I am trying to convey (not very well) is that it should work because the day time one works whenever disabled/enabled - and this is just a copy with lower values.
At night when this hearing automation is turned off, and I enable the night automation, the room sensor (it’s not a thermostat but a separate Bluetooth room temp sensor) will drop in reading over time to below the new lower setpoints and hence the automation should be triggered as it cascades down these values ultimately passing below the floor-threshold of 18C and start warming up to 19C.
But none of the triggers/conditions seem to be invoked.
understand?
EDIT:
going to give this a go…much simpler than daytime as modulation not needed.
This also solves the problem of low LWT sub 30C causing problems becuase no offset is used that drags the LWT below 30…the WD curve min value is 30C so this will just heat the home until 19C is reached and cut out at 18.5C This time of year the house is around 18.2-18.6 at 3am anyway so thats the coldest it is getting. I may tweak these down a bit until it’s comfy but I’ll start with 19C tonight, my comfy temp is 20.5-21C in daytime
alias: Heating - Night
description: >-
Control Heat Pump, maintain GF max 19c at night allowing floor value of 18.5. Works around the Madoka 2c
hysteresis, sun hitting it etc by using switchbot thermostats.
triggers:
- alias: First-run
at: "22:05:00"
id: First-run
enabled: true
trigger: time
- alias: Above-temp
entity_id:
- sensor.meter_plus_da53_lounge
for:
hours: 0
minutes: 5
seconds: 0
above: 19.0
id: Above-temp
enabled: true
trigger: numeric_state
- alias: Below-temp
entity_id:
- sensor.meter_plus_da53_lounge
for:
hours: 0
minutes: 5
seconds: 0
id: Below-temp
below: 18.5
enabled: true
trigger: numeric_state
conditions: []
actions:
- alias: Heating ON
continue_on_error: true
if:
- condition: trigger
id:
- Below-temp
then:
- alias: Turn on heating with repeat
repeat:
sequence:
- alias: Turn on Heating
action: climate.set_hvac_mode
continue_on_error: true
target:
entity_id: climate.heating_leaving_water_offset
data:
hvac_mode: heat
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
until:
- condition: state
entity_id: climate.heating_leaving_water_offset
state: heat
for:
hours: 0
minutes: 0
seconds: 0
- alias: Heating OFF
continue_on_error: true
if:
- condition: trigger
id:
- Above-temp
- First-run
then:
- alias: Turn off heating with repeat
repeat:
sequence:
- alias: Turn off Heating
action: climate.set_hvac_mode
continue_on_error: true
data:
hvac_mode: "off"
target:
entity_id: climate.heating_leaving_water_offset
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
until:
- condition: state
entity_id: climate.heating_leaving_water_offset
state: "off"
for:
hours: 0
minutes: 0
seconds: 0
mode: single
Chris, wondering… why would he want modulation if he’s going to use HA to modulate - which is what we are doing, and modulation is effectively integral to the automation code. I have disabled Madoka and use WD Curve in Control menu (instead of Room Thermostat) and there is zero modulation (disabled) in this mode.
Yes, you’re right, one wouldn’t need (indeed couldn’t use) modulation in LWT mode.
For your proposed config, you might want to consider an additional condition for the ‘Heating Off’ action, to verify the room temp really is above 19.0 when the time trigger fires. Just on the off chance that it’s below that temp at 22:05. It probably won’t ever be that way, but just something to bear in mind as you evolve your automations. Similarly for the complimentary time trigger in your daytime automation that might fire up the heating in the morning but if the house is already warm enough, you don’t want it to fire blindly just because a time trigger fired.
p.s.
spotted the err in my ways…
I was using an obsolete automation entity ID…all good now. I had turned off logging in the configuration.yaml and only log for stuff I’m working on and forgot to enable it for automation, Then it picked up the automation config error. I dont use the GUI much so was restarting the instance from docker in a ssh shell, otherwise I could have used the check-config button , duh!
All good now and we shall test tonight
EDIT
also put this in the nighttime automation where the heating off is triggered
So modulation modulates LWT. . I feel like I am in kindergarten all over again. Consequence of having the heat pump for only a month. Thanks again for the precise explanation and the link to the installer guide section.
not directly but ultimately that’s what the effect is
modulation cycles the pump , a power on power off cycle. This is generally bad for pumps because of the startup and the wear and tear so you don’t really want to be doing that in short succession which is where you’ll hear rapid cycling being mentioned It’s ok if you doing it once or twice every hour or something but you wouldn’t want it every 10 minutes. i
Ideally a heat pump should run continuously on the lowest possible LWT for 24/7 but of course that’s not practical when ambient temperatures rise and the home starts to heat through things like solar gain. I need to turn the pump off, and when you want to cool the house down with night time for sleeping. This is dissimilar to gas boilers which are intended to fire up, heat the home and then turn off, and cycle regularly although newer boilers are more efficient. air source heat pumps are about three times more efficient than a boiler which is reassuring to a point given the electricity is about 3 or 4x more expensive than gas.
@chrisg thanks so much for sharing the automation. I’ve tried the following but cannot get the automation to run, even after restarting HA. Any idea where I’m going wrong?
No worries. Firstly, in the automation list, does it show when it last fired, or was it never?
If never, that means none of the triggers fired which means none of the thresholds were crossed, either because the temperature didn’t change or the signal from the sensor didn’t reach HA.
If the automation did run, open it and check ‘traces’ to see what happened, which trigger was fired and whether an action fired as a result and ‘related logbook entries’ may help.
Yes, a manual run of the automation won’t ever fire an action because all the actions fire based off the unique ID of one of the triggers. The design idea was to have one convenient automation that contained multiple triggers and multiple actions. So the only things that can actually fire an action are one of the triggers.
That said, you can manually fire the actions to test them. For example, in the ‘Then do’ section where the actions are, you can expand one of them, click on the triple dots as indicated and ‘run action’. This would test what would happen if the relevant trigger fired it.
@chrisg I returned to this and got it tuned pretty well using helper entities for the various temp ranges , and a setpoint. great. it maintained a fairly equal room temp.
however this only works where the heating is on most of the time and LWT is around the curve value given it take 1 or 2C
Of late the house is heating as ambient is 10C+ so the heating is off for 2 to 4 hours as temps are 22C and my setpoint is 20.5 . I envisage this will get more pronounced as summer approaches
Consequently when temp does drop below the setpoint, the LWT is down to less than 15C and we want max LWT to reheat home , quickly . however the algorithm dials in an offset of -3 when temp falls below the setpoint because of the 19.9 trigger. So what would be max LWT is reduced .
So in essence how can we recalibrate this so that when the heating has been off for I don’t know maybe half an hour an hour or 2 hours whatever…to where the LWT goes really low… how do we remove that -3 offset in fact we probably won’t +3 to heat up quickly
some intelligence in algorithm is needed because that half an hour , 1 , 2 hrs … could be longer if it’s warmer , could be short of its colder. essentially what we’re saying is that when the heat has been off for a period of time when the LWT goes really low ,THEN, when the heating comes on again we need a plus offset not a negative because it’s not been oscillating around that set point for some time.
My approach to this is if the heating goes over the top threshold and shuts down, we probably have a sunny day, probably a mild one as well. That being the case, the sun is heating the fabric of the building. In my case, the exterior is brick and it warms easily in the sun. So my design intent was that when the interior temperature starts to drop, it drops slowly and we only need a little heat to keep up with it. The full flow temp isn’t needed because we’re still getting some residual warmth that the sun imparted into the building.
That said, at your place, you may have different solar gain effects and the time that lasts might be shorter. So you could elect to run the ‘reset to 0c’ action when the temperature drops below whichever point you deem is right. You can edit the ‘reset to 0c’ action which I think you’ve called ‘Offset for steady’ and add the additional trigger ID you want which matches the temperature threshold ID. Of course, as the temp internally drops, it will probably fire the below highpoint threshold and fire the -3.
I’d be inclined to let it drop through the thresholds naturally and see how you go. I’m not sure what your temperature thresholds are but if its still narrow like the original code, then you don’t want to pump in a lot of heat quickly as you might find it overshooting and shutting down and cycling.
Btw, I like your trigger IDs, they make so much more sense than mine (in my defence, they did evolve over time from just a couple of threshold triggers to many more). I might adopt your naming convention.
thanks for that @chrisg
not sure I explained very well so I’ll try again
I do let it go through the thresholds
What I find is that once it’s gone above the setpoint and the heating turns off you’re right it’s solar gain and milder ambient , the house heating up.
And then the early evening it starts to go cold and the -3 offset it’s just not enough to heat the home, It definitely doesn’t overshoot, so it’s not a gradual heat it’s just not heating at all really, well not until 4 hours or so which is clearly not good enough.
So what we need is some way for a zero offset when it’s gone through the set point and turned off. I don’t know maybe time duration -based or something So when it comes back on it’s on the normal heat zero offset
incidentally the fact that it’s turning off is an ideal somehow needs all the settings adjusted so that it modulates a bit more around the setpoint rather than going above it but that’s another issue I need to do with I’ve adjusted the weather curve In the MMI that just makes things worse.
Unrelated but JFI…
I’m also considering running the pump without the Daikin weather curve, and instead in Fixed setpoint mode
Here I just run at fix set point of 30c and then using home assistant to apply positive offsets to that depending on the outdoor temperature. In HA I would set LWT temperatures for each ambient temperature , say from -5 to 15… I’ve noticed the linear curve in the MMI isn’t that good because the leaving water temperature needs to be slightly different for different ambients such as the table below, where the LWT isn’t linear, rather it varies slightly across the range and some are even the same value. these are the LWT temperatures that keep this house a steady comfortable 20.5C. Values taken from my probably daily analysis over the last year
I suspect this nonlinear leaving water temperature is due to the thermal heat loss of the house being faster on cold ambients and slower at warmer temperatures.
So effectively a weather curve inside home assistant but not a linear one as Is in the the Daikin MMI.
This is in addition to your thermostatic modulating code, but you get the idea and it may even with not require the HA thermostatic control anyway eventually. The handy failsafe is it hope HA fails then LWT defaults to 30C which isn’t too bad a condition At the moment , if HA fails my heating raises to about 25C which is "uncomfortable …evidence that the MMI heat weather curve isn’t that good But adjustments affects other curve values so It’s just not a good system hence why I want to do it inside HA and have specific LWT values for specific ambienta with the resolution of 1⁰C
You can absolutely add an action to reset the offset back to 0c when the heating is turned off but your other thresholds may fire back to -3 on the way back down.
Ultimately, you can take this automation and have it do whatever you want but I would be concerned about hitting the API limit if it’s doing a lot of calls. It’s an interesting idea to have HA set flow temps based on outside temps, but I sorta think that’s reinventing the wheel. For me, at least, the Daikin WD curve should get you 90% of the way there to a steady indoor temperature.
For the last 10%, Madoka modulation (for RT mode) or this automation fine tunes the flow temp to keep the heat pump producing just enough heat to avoid shutting down (with the exception of the shoulder months where it’s inevitable that the heat pump will stop).
I’m finding that in the depths of winter, the automation sits at 0c or +2c but now it’s milder and we’re getting solar gain, it’s sitting more at -2c or -4c. If it’s cloudy, it tends to sit at 0c, so very little required from the cloud.
I’m intrigued to see how you go with the non-linear curve idea - particularly if you run out of API requests or not. I’d also be wary of reliance on the cloud - if the Internet goes down, Daikin do maintenance or has some temporary outage, your automations will stop and your system may not provide anything close to what your home needs. That said, it seems pretty reliable so maybe it’ll work. Keep us posted!