msvisser / remeha_home

Remeha Home integration for Home Assistant
60 stars 14 forks source link

Feature request - adaptation from older Baxi integration #9

Closed Gyosa3 closed 1 year ago

Gyosa3 commented 1 year ago

Hi, thanks a lot for this integration with the new app, I was very worried to loose remote control via Home Assistant.

I wanted to share how I tweaked my boiler controls, based on the earlier Node-Red version of Domaray's Baxi integration, if you wish to integrate some of the ideas (it's really adapted to my situation, but some things may still be useful).

1/ I run an automation which triggers on several options. If criteria are fulfilled, it switches the boiler to "schedule 1" mode (i.e. in winter), if not, it switches to "manual" mode and sets the target temp to 9°C (i.e. the rest of the year), because I never got the API call for the "anti-frost" mode and always thought that there was no "off" mode (i.e. "off" for heating but "on" for hot water). Now I see an "off" option in the new Remeha app, so...

2/ I added a sensor to know if the boiler was still connected to the cloud (therefore if the other values are meaningful) by querying https://ruapi.remoteapp.bdrthermea.com/v1.0/system/gateway/connection with the properly authenticated header. Normal result should be "connected_to_appliance". I find it is a useful sensor, e.g. I trigger a notification when I loose connection with my boiler.

3/ For controling the status message of the "thermostat" of the boiler, I introduced a bit of translation of the attributes.

I'm currently running the boiler in "manual" mode at 9°C and that's how it shows: image

For me it's not totally accurate. If I take separately the left part and right part of the text below the set temp, as well as the icon below the text, I'd propose something in this manner (this is amended extracts of the javascript code I used in NodeRed):

Left part of the text, if it is "action":

if(connectionStatus == "connected_to_appliance"){
    if(setpoint > temp){
        action = "heating";
    } else {
        action = "idle";
    }
} else{
    action = "offline";
}

Right part of the text and icon are both based on a calculation of the "real_mode" the thermostat is into (maybe modes names have changed in the new app):

if(current_mode == "temporary-override"){
    real_mode = next_mode + " (TO)";
} else{
    if(current_mode == "schedule") {
        real_mode = current_mode + " (" + program_number + ")";
    } else {
        real_mode = current_mode;
    }
}

Form which you could derive the right side of the text as "status" like:

if(connectionStatus == "connected_to_appliance"){
    if(real_mode == "manual"){    (or "anti-frost", etc.)
        status = "Summer idle";    (or anything alike, but not "Clock program 1" as shown in the picture above)
    } else{
        status = real_mode;
    }
} else{
    status = "";    (will only show left text "offline" then)

And you can derive the icon to activate:

if(connectionStatus == "connected_to_appliance"){
    if(filtered_mode == "manual"){   (and/or "anti-frost", etc.)
        icon = "cool";
    } else {
        icon = "heat";
    }
} else{
    icon = "off";
}

For me it is either "heat", "cool", "off" or "schedule", "cool", "off" combinations. the "schedule" icon can be used if the mode is "schedule" or the "heat" icon is used if the action is "heating", it's a matter of taste, but I don't see the purpose of "schedule" and "heat" at the same time.

4/ for changing the mode in the thermostat Lovelace card, I coded 2 options:


A few last things: 
- the flow temperature used to be there: https://ruapi.remoteapp.bdrthermea.com/v1.0/system/flow-temperature not sure if it still exists.
- nobody could query the consumption history curves with the old API, that's a shame, would be great to integrate in the energy dashboard, maybe it would be achievable in the new API, who knows...

Good luck with this integration and hope my request will help you with new ideas.
Gyosa3 commented 1 year ago

Hi again, I've been through your code and the new app, and I realise that what I did before is obsolete now that Remeha is calling "off" the anti frost mode.

So the only thing that I'd see could be double-checked is why it always displays "clock program 1" even when the mode is "manual" or "off". The rest, I'll have to adapt my own automations.

Gyosa3 commented 1 year ago

I posted a pull request to change the display: https://github.com/msvisser/remeha_home/pull/10

While testing this change I spotted another issue with the presets, I'll open a separate issue for it.

Thanks!

msvisser commented 1 year ago

I agree with you that displaying the clock programs when you are in "manual" or "off" mode is a bit weird. I will have a look at your pull-request for changing that.

Is there anything else in this issue that needs my attention?

Gyosa3 commented 1 year ago

No that's ok, the pull request should fix this issue. I've opened another issue for the preset switching. This one can be closed when you've reviewed the pull request.