Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get current temperature from internal sensor #89

Open
janmashat opened this issue Oct 27, 2020 · 35 comments
Open

Get current temperature from internal sensor #89

janmashat opened this issue Oct 27, 2020 · 35 comments
Labels
RFC Request for change (new feature/improvement/change of feature) unsupported model Unsupported Model

Comments

@janmashat
Copy link
Contributor

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
tomikaa87/gree-remote#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.

@RobHofmann
Copy link
Owner

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 RobHofmann added the RFC Request for change (new feature/improvement/change of feature) label Nov 3, 2020
@janmashat
Copy link
Contributor Author

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: inwaar/gree-hvac-client#11 (comment)

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).

@RobHofmann
Copy link
Owner

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 RobHofmann added the unsupported model Unsupported Model label Aug 18, 2021
@feng1126
Copy link

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

@janmashat
Copy link
Contributor Author

janmashat commented Jul 6, 2022

@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

@feng1126
Copy link

climate.txt

@alamoudimoh
Copy link

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

@janmashat
Copy link
Contributor Author

Consider what? I don't see a PR.

@alamoudimoh
Copy link

Consider what? I don't see a PR.

The current temperature from built-in sensor!!

@janmashat
Copy link
Contributor Author

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

@janmashat
Copy link
Contributor Author

janmashat commented Jul 14, 2022

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
Copy link
Contributor Author

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 😄

@edisonbar
Copy link

edisonbar commented Feb 21, 2024

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.

@rapi3
Copy link

rapi3 commented Mar 14, 2024

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.

@edisonbar
Copy link

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

What exactly do you need?

@rapi3
Copy link

rapi3 commented Mar 14, 2024

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

@edisonbar
Copy link

climate.txt

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

@rapi3
Copy link

rapi3 commented Mar 14, 2024

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

@WallK
Copy link

WallK commented May 10, 2024

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

@janmashat
Copy link
Contributor Author

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 }}"

@fliespl
Copy link

fliespl commented May 23, 2024

@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?

@edisonbar
Copy link

@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?

I use it on both, but app is pretty slow remotely, HA works great, no problem so far.Only missing humidity from built in sensor

@Machaeon
Copy link

Greetings, I seem to have gotten the internal sensor processing correct. I would like to create a PR, could you tell me how to do it? Thanks!

@RobHofmann
Copy link
Owner

PR can be found here #175

Can you guys please test this?

@rapi3
Copy link

rapi3 commented Jun 20, 2024

I ported original HA Gree Climate integration with patch from kspearrin to HA - OS as custom integration,
It use temp sensor from AC unit and AC can be located in another LAN segment than HA; have a look:
https://github.com/rapi3/HA-OS-Gree

edit:
now can be installed from HACS - custom repository - integration

@toughvj
Copy link
Contributor

toughvj commented Jul 4, 2024

@RobHofmann this can be closed, solved in #188

@Saxin
Copy link

Saxin commented Jul 10, 2024

I have x3 gree units, currently using HA Gree component, how can I check if my units support reporting current temp - TemSen property ? thanks guys

@jodewee
Copy link

jodewee commented Jul 10, 2024

I have x3 gree units, currently using HA Gree component, how can I check if my units support reporting current temp - TemSen property ? thanks guys

just remove this line from you config, reboot ha, and check in you climate entity if you see an attribute for the current temp.
image

@toughvj
Copy link
Contributor

toughvj commented Jul 10, 2024

climate.txt
@jodewee not exactly ;) v2.13 does not have this feature
first of all use attached file, then remove this line from your config and restart HA

@jodewee
Copy link

jodewee commented Jul 10, 2024

@toughvj idd correct, i already have the latest version of the py-file.

@toughvj
Copy link
Contributor

toughvj commented Jul 10, 2024

it looks like @RobHofmann is a bit slow with PR :)

@janmashat
Copy link
Contributor Author

My first question would be if "HA Gree component" is the core component - because that one displays the current temp (if the unit supports it, it shows the real temp - otherwise it just shows the set temp twice).

@Saxin
Copy link

Saxin commented Jul 10, 2024

thanks all, much appreciated.
@janmashat - yes I currently have the Gree core component (not this repo, HACS) installed.
So if I see the same temp double - my unit doesn't support it ?

@janmashat
Copy link
Contributor Author

That is my experience, yes.

@eimirae
Copy link

eimirae commented Jul 12, 2024

It seems my unit is reporting the temp in F instead of C :/. 78.80000000000001F being 26C.

24-07-12 10:33:37.637 INFO (MainThread) [custom_components.gree.climate] 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']
2024-07-12 10:33:37.637 INFO (MainThread) [custom_components.gree.climate] available(): Device is online
2024-07-12 10:33:37.637 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2024-07-12 10:33:37.637 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-07-12 10:33:37.638 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-07-12 10:33:37.638 INFO (MainThread) [custom_components.gree.climate] current_temperature(): 78.80000000000001
2024-07-12 10:33:37.638 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 27
2024-07-12 10:33:37.638 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Low
2024-07-12 10:33:37.638 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Fixed in the lowest position
2024-07-12 10:33:37.639 INFO (MainThread) [custom_components.gree.climate] name(): Split
2024-07-12 10:33:37.639 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-07-12 10:33:37.639 INFO (MainThread) [custom_components.gree.climate] should_poll()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request for change (new feature/improvement/change of feature) unsupported model Unsupported Model
Projects
None yet
Development

No branches or pull requests