dave-code-ruiz / uhomeuponor

Custom Component to connect Home Assistant with Uhome Uponor Smatrix App
MIT License
19 stars 7 forks source link

Bug: All thermostats are shown as "heating" #6

Closed LordMike closed 4 years ago

LordMike commented 4 years ago

As I read it, all thermostats get an HVAC mode from the UHome device itself, which can be either "cool" or "heat". But, as all thermostats get the same value, they're all shown like this:

image

There is a property on each thermostat (addr 95), for Room in demand. For me, that would mean it's heating (I don't have cooling), but I could assume that maybe it means "UHome HC Mode is active".

So this could be changed to HVAC mode being "cool" if UHome's HC Mode is "cool" and the thermostat is in demand.. ?

LordMike commented 4 years ago

I have confirmed that making hvac_mode() on UHomeClimateThermostat look more like hvac_action() has an effect on the Thermostat widget with regards to the display.

image

I am unsure why the "CURRENT_*" are not used ...

dave-code-ruiz commented 4 years ago

Can you expose your code in a Pull requests ?

Thnks

LordMike commented 4 years ago

Pushed. Don't merge it. I still don't know what the correct way is.

LordMike commented 4 years ago

There's a hint here.

https://developers.home-assistant.io/docs/en/entity_climate.html#properties

hvac_mode -- The current operation (e.g. heat, cool, idle). Used to determine state.

So state is probably what's depicted on the widget. Meaning hvac_mode must go to "idle" (can't find that constant, can only find "off")..

LordMike commented 4 years ago

I've found this tidbit in the U@Home JS. This could indicate my approach was correct.

The hcMode is 0 for heating and 1 for cooling.

RoomScreen2.prototype.setDemandIcon = function(roomInDemand, hcMode) {
  if (utils.isEnabled(roomInDemand)) { //
    if (hcMode == utils.hcMode.cool) {
      this.demandIcon.removeClass('img-heating').addClass('img-cool');
    } else {
      this.demandIcon.addClass('img-heating').removeClass('img-cool');
    }
    this.demandIcon.show();
  } else {
    this.demandIcon.hide();
  }
}
dave-code-ruiz commented 4 years ago

Pushed. Don't merge it. I still don't know what the correct way is.

Confirm me you want to merge it

LordMike commented 4 years ago

I think what I have works. You can merge it.

dave-code-ruiz commented 4 years ago

I revert your changes,

I think you mitake modes with actions,

https://developers.home-assistant.io/docs/en/entity_climate.html#hvac-modes

https://developers.home-assistant.io/docs/en/entity_climate.html#hvac-action

I think Mode off is used to "unplugg" thermostat, and with actions you can see if it is "heating/cooling" or off (not working mode)

LordMike commented 4 years ago

I'm inclined to say you are right, but, then this issue is still present.

image

bouwew commented 4 years ago

Hi, I came across this discussion by accident. Just adding my 2 cents...

My idea is that there is too less separation between the HVAC modes and the HVAC actions.

The problem is the inclusion of the AUTO mode.

My idea: Either you have something like this: HVAC Actions; CURRENT_HVAC_OFF, CURRENT_HVAC_ON, CURRENT_HVAC_IDLE HVAC Modes: HVAC_MODE_OFF, HVAC_MODE_FIXED_HEAT, HVAC_MODE_FIXED_COOL, HVAC_MODEFIXED_HEAT_COOL, HVAC_MODE_AUTO_HEAT, HVAC_MODE_AUTO_COOL, HVAC_MODE__AUTO_HEAT_COOL, HVAC_MODEDRY, HVAC_MODE_FAN_ONLY

Or, something like this: HVAC Actions; CURRENT_HVAC_OFF, CURRENT_HVAC_HEAT, CURRENT_HVAC_COOL, CURRENT_HVAC_DRY, CURRENT_HVAC_IDLE HVAC Modes: HVAC_MODE_OFF, HVAC_MODE_FIXED, HVAC_MODE_AUTO, HVAC_MODE__DRY, HVAC_MODE_FAN_ONLY

In this case FIXED means the mode never changes until the user makes a change manually. Auto means it on a preprogrammed schedule ("AI").

My proposal is not complete, but I hope you understand what I mean?

LordMike commented 4 years ago

@bouwew thanks. But I'm not sure I follow. I might need a few examples to understand it.

I've asked on the HA docs github for clarification.

dave-code-ruiz commented 4 years ago

I've asked on the HA docs github for clarification.

Ok, i wait for response HA docs.

I think now is correct way.

You can see your mode in heat icon and cool icon. You can see too current operation mode like a text, heating or cooling or off You can see too Eco/Confort mode

but it is only my opinion , if in HA docs say something different , i dont have any problem to change code.

thanks for your comments

dave-code-ruiz commented 4 years ago

Reading HA docs question, i think this issue is closed

Balloob say: Your expectations differ from how the system works.

I think too now is correct way.

thanks for your comments

bouwew commented 4 years ago

Thanks for chasing this! When I have time I will read all myself. I am developing/maintaining the Plugwise component so I need to understand this in detail as well.