gree-hvac-mqtt-bridge
gree-hvac-mqtt-bridge copied to clipboard
Add ability to receive current temperature from HVAC
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
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)
}
}
Ok, I've actually fixed it now, I think I can make a PR.
I made a PR for this now #78.