gree-hvac-mqtt-bridge icon indicating copy to clipboard operation
gree-hvac-mqtt-bridge copied to clipboard

Add ability to receive current temperature from HVAC

Open aivus opened this issue 4 years ago • 3 comments

Hey.

I've noticed that HVAC may return current room temperature in TemSen property.

It may be backported to this project from https://github.com/inwaar/gree-hvac-client/pull/11

aivus avatar Jun 05 '20 14:06 aivus

I was able to get the current temperature back into HASS in my fork. I just don't know how to deal with the +40 offset yet.

I tried dealing with it in the publishIfChanged function like this, but it doesn't seem to work.

const publishIfChanged = function (stateProp, newValue, mqttTopic) {
  if (newValue !== deviceState[stateProp]) {
    // I have no idea where else to subtract 40 so I just do it here
    if (mqttTopic == '/curtemperature/get') {
      deviceState[stateProp] = newValue - 40
    }
    else {
      deviceState[stateProp] = newValue
    }
    client.publish(mqttTopicPrefix + mqttTopic, newValue)
  }
}

k8ieone avatar Aug 09 '21 01:08 k8ieone

Ok, I've actually fixed it now, I think I can make a PR.

k8ieone avatar Aug 10 '21 08:08 k8ieone

I made a PR for this now #78.

k8ieone avatar Apr 02 '22 08:04 k8ieone