HomeAssistant-GreeClimateComponent icon indicating copy to clipboard operation
HomeAssistant-GreeClimateComponent copied to clipboard

Get current temperature from internal sensor

Open janmashat opened this issue 3 years ago • 26 comments

First off, great job on this project!

I've noticed this in your README:

Gree unfortunately doesnt support a "current temperature" on its own.

However I found:

some ACs report current room temperature with the TemSen property https://github.com/tomikaa87/gree-remote/issues/31

Have you considered adding support for this?


OFF-TOPIC: I needed to add another generic_thermostat (actually dualmode_generic in my case) to switch your component on/off because your thermostat doesn't seem to turn off the AC after reaching the desired temperature - but I guess that's because you designed your thermostat to work in the same manner as the official remote (which doesn't turn the unit on/off automatically) - and that's fine.

janmashat avatar Oct 27 '20 12:10 janmashat

I haven't seen/considered this, nor do I have the devices to test this with. But feel free to implement support for this and make a PR 👍 .

Regarding your offtopic: Correct. Climate control is made to set to a certain temperature and get & stay at that temperature by itself.

RobHofmann avatar Oct 27 '20 13:10 RobHofmann

When you say you don't have any devices to test this with, do you mean that you don't have a TEMP button on your physical remote (to let you see the current temp on the digital display)? Because otherwise (if you are able to see the current temp) it may be necessary to downgrade the firmware in order to get the TemSen property to return proper data: https://github.com/inwaar/gree-hvac-client/pull/11#issuecomment-652371700

I haven't yet attempted the firmware downgrade myself as I still have a couple sonoffs that include temp sensors.

Regarding the offtopic: I guess you mean that your component is only able to set a target temperature but it is the AC unit's job to maintain that temperature. So basically, if only your component is used, it's best to set the fan mode to Auto. Otherwise, setting a different fan mode over a longer duration remains efficient only if another thermostat component is added to maintain the temperature (by turning your component on/off).

janmashat avatar Nov 08 '20 11:11 janmashat

Ah, I dont want to do any downgrading or fiddling on those devices. They work fine right now as they do exactly what I want.

And yes, its the unit's job to maintain a certain temperature. Getting the room to a certain temperature takes a significant amount of energy, but keeping it at that temperature does not (or at least its more efficient). So on extreme hot or cold days I automatically turn the AC's on when we are home and let them run until the heat/cold period is gone or we leave the house.

This might different for each type of unit, but I always set my units to low fan speed. It will get colder/warmer anyway :).

RobHofmann avatar Nov 08 '20 14:11 RobHofmann

you can modify this code ,add TemSen in code , them you can get current temperature from internal sensor like this optionsToFetch = ["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","StHt","TemUn","TemSen","HeatCoolType","TemRec","SvSt","SlpMod"] hvac_modes: auto, cool, dry, fan_only, heat, off min_temp: 16 max_temp: 30 target_temp_step: 1 fan_modes: Auto, Low, Medium-Low, Medium, Medium-High, High, Turbo, Quiet swing_modes: Default, Swing in full range, Fixed in the upmost position, Fixed in the middle-up position, Fixed in the middle position, Fixed in the middle-low position, Fixed in the lowest position, Swing in the downmost region, Swing in the middle-low region, Swing in the middle region, Swing in the middle-up region, Swing in the upmost region current_temperature: 30 temperature: 28 fan_mode: Auto swing_mode: Default friendly_name: air1 supported_features: 41

feng1126 avatar Jun 22 '22 05:06 feng1126

@feng1126 can you please open a PR with your change?

BTW I got a new Gree A/C installed today and it returns the temp (with a +40 offset):

$ python gree.py get TemSen -c 192.168... -i ... -k ...
Getting parameters: TemSen
TemSen = 66

janmashat avatar Jul 06 '22 13:07 janmashat

climate.txt

feng1126 avatar Jul 13 '22 05:07 feng1126

my a/c has a built in temp. if i understand this correctly, this would be very helpful, please consider @RobHofmann

alamoudimoh avatar Jul 13 '22 16:07 alamoudimoh

Consider what? I don't see a PR.

janmashat avatar Jul 13 '22 17:07 janmashat

Consider what? I don't see a PR.

The current temperature from built-in sensor!!

alamoudimoh avatar Jul 13 '22 17:07 alamoudimoh

Yes that would be great...I'll try to test out @feng1126's file and create a PR.

janmashat avatar Jul 13 '22 17:07 janmashat

I've tested it and it works, so I created PR #129 - but the change in line 294 seems unnecessary/incorrect, can you confirm @RobHofmann?

janmashat avatar Jul 14 '22 07:07 janmashat

As I mentioned above my TemSen has a 40 degree offset so I tried to account for that adding

template:
  - sensor:
      - name: ac_temp
        state: '{{ state_attr('climate.ac', 'current_temperature')|float - 40 }}'
        unit_of_measurement: "°C"

and then adding this to the gree config:

    temp_sensor: sensor.ac_temp

but the gree current_temperature went crazy into the negative thousands and kept decreasing...looks like I created a loop 😄

janmashat avatar Jul 14 '22 16:07 janmashat

Well I managed to display temperature from internal sensor but with offset of +40,how to modify code to display temperature with a offset ?My AC is Gree Clivia. edit: I also managed do display temperature with an offset of -40,If somebody needs any help I 'll be glad to help.

edisonbar avatar Feb 21 '24 17:02 edisonbar

Well I managed to display temperature from internal sensor but with offset of +40,how to modify code to display temperature with a offset ?My AC is Gree Clivia. edit: I also managed do display temperature with an offset of -40,If somebody needs any help I 'll be glad to help.

Can you help with more details how/where to change ? Thank you.

rapi3 avatar Mar 14 '24 08:03 rapi3

Can you help with more details how/where to change ? Thank you.

What exactly do you need?

edisonbar avatar Mar 14 '24 08:03 edisonbar

I'd like to have display of current temp from Gree AC internal sensor with this integration.

rapi3 avatar Mar 14 '24 08:03 rapi3

climate.txt

this is my config.Try with this one and give me a feedback.

edisonbar avatar Mar 14 '24 09:03 edisonbar

Thank you, it work.

Target temp set depend of external sensor from config.yaml: temp_sensor To depend only of internal Gree AC ( no need of external sensor ) I think we need to disable external sensor from config.yaml

is this correct ?

p.s. I also patched here:

def SendStateToAc(self, timeout): _LOGGER.info('Start sending state to HVAC') statePackJson = '{' + '"opt":["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","StHt","TemUn"," TemSen"...

attached file climate2a.txt

rapi3 avatar Mar 14 '24 10:03 rapi3

My Gree Airy GWH09AVCXB reports current temperature in the default HA Gree integration

WallK avatar May 10 '24 07:05 WallK

My Gree Airy GWH09AVCXB reports current temperature in the default HA Gree integration

Good catch! I'll need to give that a try...

In the meantime this is how I solved it with this integration (utilizing gree-remote):

climate:
  - platform: gree
    name: downstairs_ac
    host: 192.168.90.28
    port: 7000
    mac: '50:XX:XX:XX:XX:9C'
    target_temp_step: 1
    temp_sensor: sensor.tempdown

sensor:
  - platform: command_line
    name: tempdown
    command: "python /config/submodules/gree-remote/PythonCLI/gree.py get TemSen -c 192.168.90.28 -i 50xxxxxxxx9c -k 5uxxxxxxxxxxxx6R | grep 'TemSen =' | awk '{print $3}'"
    unit_of_measurement: "°C"
    value_template: "{{ value | float - 42 }}"

janmashat avatar May 10 '24 14:05 janmashat

@edisonbar slightly offtopic, but do you recommend Clivia model for homeassistant integration? Do you mind sharing if you use it using local network or cloud?

fliespl avatar May 23 '24 20:05 fliespl