steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Creating an Item that represents OFF, Heating, Cooling & Auto or a Switch representing Heating in OpenHAB2 #85

Closed notluwi closed 3 years ago

notluwi commented 3 years ago

Hello, I am very sorry for creating probably such a trivial issue but I just cannot figure out how or what kind of item I need to create to let homebridge know that my thermostat is Heating.

The error in Homebridge after checking the cache of my current "Thermostat Mode": Unable to transform NULL using transformation map {"ON":1,"OFF":0,"OPEN":1,"CLOSED":0}

My theory is that it just needs to be changeable by Homebridge to either 1 or 0.

If you can help me create a ThermostatMode Item that can change to all 4 states: OFF, HEATING, COOLING and AUTO that would be perfect! The fix for my issue is probably very simple but as I am a real newbie and have no experience in coding except for high school I cannot figure it out even after searching all around the internet for an example config or item configuration...

Thank you in Advance! Luis

steilerDev commented 3 years ago

Hi Luis, no worries.

It depends on how your item is shown in openhab. The easiest way is to use the modeItem, which needs to be a Number item, whereas 0 ≙ Off, 1 ≙ Heating, 2 ≙ Cooling, 3 ≙ Auto.

Otherwise just define heatingItem and coolingItem. If both are present the heating mode is deferred based on which of those items is active.

Regards,

Frank