RobHofmann / HomeAssistant-GreeClimateComponent

Custom Gree climate component written in Python3 for Home Assistant. Controls AC's supporting the Gree protocol.
GNU General Public License v3.0
311 stars 104 forks source link

Current Temperature is converted incorrectly #205

Open cj2quared opened 2 months ago

cj2quared commented 2 months ago

Describe the bug Temperature sensor's unit of measurement is Fahrenheit. The Gree component accepts the input as a Celsius value and converts the input to Fahrenheit. This results in values much higher value than actual labeled as Fahrenheit.

To Reproduce Steps to reproduce the behavior:

  1. Configure Home Assistant Unit System as US customary in GUI or configuration.yaml
  2. Configure temp_sensor in climate.yaml with existing temperature sensor
  3. Review current_temperature in Gree component created entity

Configuration climate.yaml

- platform: gree
  name: Mini Split
  host: 10.14.250.39
  port: 7000
  mac: "redact"
  target_temp_step: 1
  encryption_version: 2 
  uid: 0
  temp_sensor: sensor.kit_gove_sen_01_temperature
  lights: input_boolean.mini_split_lights
  xfan: input_boolean.mini_split_xfan
  health: input_boolean.mini_split_health
  sleep: input_boolean.mini_split_sleep 
  powersave: input_boolean.mini_split_powersave

configuration.yaml unit_system: us_customary

Expected behavior Current temperature displays correct value in correct temperature unit.

Screenshots Gree entity attributes

hvac_modes: auto, cool, dry, fan_only, heat, off
min_temp: 61
max_temp: 86
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: 159
temperature: 72
fan_mode: Auto
swing_mode: Swing in full range
friendly_name: Mini Split
supported_features: 425

Temp Sensor entity state: 70.3

Temp Sensor entity attributes:

state_class: measurement
unit_of_measurement: °F
device_class: temperature
friendly_name: kit-gove-sen-01 Temperature

Platform:

Additional context Problem is not corrected when changing temp sensor or configuration to Celcius.

Logs

2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] available(): Device is online
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] current_temperature(): 70.7
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 22
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Auto
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Swing in full range
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] name(): Mini Split
2024-07-31 22:00:27.782 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-07-31 22:01:27.690 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-07-31 22:01:27.691 INFO (SyncWorker_22) [custom_components.gree.climate] update()
2024-07-31 22:01:27.691 INFO (SyncWorker_22) [custom_components.gree.climate] Starting SyncState
2024-07-31 22:01:27.693 INFO (SyncWorker_22) [custom_components.gree.climate] Fetching(10.14.250.39, 7000, 10, {"cid":"app","i":0,"pack":"redact","t":"pack","tcid":"redact","uid":0,"tag" : "redact"})
CaliLuke commented 2 days ago

I'm seeing the same, this isn't getting fixed anytime soon uh?