MikeJMcGuire / hass-actronque

Actron Que/Neo Air Conditioner Add-On for Home Assistant
GNU General Public License v3.0
13 stars 5 forks source link

Missing current operating mode in zones entities #17

Open DanielNagy opened 6 months ago

DanielNagy commented 6 months ago

Since adding the heat cool points in #13, I've only just noticed that in the history view of each zone, it no longer "shades" based on the current operating mode.

Ie. highlighted, the main controller is (cooling)

image

Ie, the main control unit shows blue shading for (cooling)

image

But a zone, because HA doesn't know the current mode isn't shading.

image

DanielNagy commented 6 months ago

I assume that each zone entities could just simply reference the main controllers mode topic?

DanielNagy commented 6 months ago

I think Zone entities should reference this main controllers action.

image

DanielNagy commented 6 months ago

Ok, Just done some testing. I've add "action_topic" referencing a new topic in theatre zone 2

IE - my homeassistant/climate/actronque/zone2 / config now looks like this,

image

image

Since doing that with mine, the History graph is now correctly shading the Theatre zone Blue (indicating cooling action)

image

However, we can't just mirror the main controller actronqueXXXXXXX/compressor topic. When you turn the Zone off, the action needs to also be turned off, or else the graph will still continue to "shade" the blue for cooling.

image

So each zone will need new topic for action_topic, if a zone is turned on, it should mirror the actronqueXXXXXXX/compressor value. If a zone is turned off, the zones new action_topic should be set to "off"

image

DanielNagy commented 6 months ago

FYI - playing with the actions, "cooling" "heating" "off" and seeing how the history graph responds. image

cooling shades blue, heating shades red, off removed shading, idle also removes shading

The "idle" action, doesn't get shown on the Sensor view when the zone is turned off. It only shows "heating" "cooling" and "off" (yes, "Off (Auto)" which is weird) when the zone is switched on) When the zone is turned off, it removes the action from the text and just shows Off. image

The only use case I see fit for a zone to use the "idle" action, is when the zone is turned on, and the damper "position" is 0%. That way the graph Shading will only show blue when the zone actively cooling or shaded red, if the zone is actively heating (ie, the zone damper position > 0%).

DanielNagy commented 4 months ago

Hey Mike.

Gave it an attempt myself. My code here - https://github.com/DanielNagy/hass-actronque

Learnings. The Que CompressorMode API, only appears to show HEAT or COOL. (Whilst in AUTO climate mode) The QUE Master screen will show Heating /Cooling / Standby. When the Master screen is showing Standby, the compressor state reverts to COOL. As a result, I was seeing this in my AC graph when the Que went to standby. (this is based on your code - compressor action)

Ie, Unit hit Heating set point, went to standby, but because it was reporting COOL, the Graph shaded Blue. image

So I added logic to determine idle/standby state to incorporate the Compressor Capacity to see if it is 0% to determine Standby. This value is saved as a new action topic for the main unit.

// HVAC Action based on Compressor State and Capacity (Que doesnt appear to show "IDLE" whilst in AUTO mode)
if (unit.Data.CompressorCapacity != 0)
{
    // Que Compressor State only shows Heating / Cooling
    switch (unit.Data.CompressorState)
    {
        case "HEAT":
            MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "heating");
            break;

        case "COOL":
            MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "cooling");
            break;

        case "IDLE": // Never actually seen IDLE whilst in AUTO state. Leaving this code just incase for now.
            if (unit.Data.On)
                MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "idle");
            else
                MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "off");
            break;
    }
}
else
{ // Standby on que master screen. api compressorstate does not show standby. 
    if (unit.Data.On)
        MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "idle");
    else
        MQTT.SendMessage(string.Format("actronque{0}/action", unit.Serial), "off");
}

For the individual zones i'm looking at the Zone damper "position" to determine if a zone is heating/cooling/idle, and created a new action topic

if (unit.Zones[iIndex].Position != 0)
{
    MQTT.SendMessage(string.Format("actronque{0}/zone{1}/action", unit.Serial, iIndex), unit.Data.CompressorState);
    switch (unit.Data.CompressorState)
    {
        case "HEAT":
            MQTT.SendMessage(string.Format("actronque{0}/zone{1}/action", unit.Serial, iIndex), "heating");
            break;

        case "COOL":
            MQTT.SendMessage(string.Format("actronque{0}/zone{1}/action", unit.Serial, iIndex), "cooling");
            break;
    }
}
else
{
    if (unit.Zones[iIndex].State)
        MQTT.SendMessage(string.Format("actronque{0}/zone{1}/action", unit.Serial, iIndex), "idle");
    else
        MQTT.SendMessage(string.Format("actronque{0}/zone{1}/action", unit.Serial, iIndex), "off");
}

So now you can see the states of the main control unit, as well as the individual zones. image

And more importantly, the colour shading for each zone is now functional, and will only shade when the Zone Damper position is open. (2.14pm is when i added the per zone action). So at a glance at that graph, you can see when the unit is actively heating/cooling. specifically at 2:22pm, the zone went to idle for a short period.

image

DanielNagy commented 4 months ago

image

Cooling blue shade working as expected :D