cdjackson / HABmin

A web admin console for openHAB home automation
http://www.cd-jackson.com/index.php/openhab/habmin
217 stars 51 forks source link

Sitemap "Mapping" field strips necessary quote marks #301

Open brianhanifin opened 8 years ago

brianhanifin commented 8 years ago

I know you have directed your efforts towards HABmin 2, but I discovered an issue that doesn't allow me to use HABmin for fear of breaking my OpenHAB functionality every time I open HABmin.

I have my Nest thermostat setup on OpenHAB 1.8.1. The thermostat recognizes 4 mode states:

  1. cool
  2. heat
  3. heat-cool
  4. off

I found the dash in the "heat-cold" parameter to be problematic in the mapping field (the button displays "%label%" and pressing that button causes the Nest to send a "heat" mode command instead of a "heat-cool" command.

The solution to this is simple, place quote marks around "heat-cool" in the mappings property. For example.

mappings=[cool="Cool", heat="Heat", "heat-cool"="Heat + Cool", off="Off"]

Unfortunately, HABmin 0.1.3-snapshot strips the quote marks (both double and single quote marks) from the property field when I exit and reopen HABmin.

I have discovered another binding that requires quote marks on the property names is the Logitech Harmony Hub. HABmin also loses the mapping field quote marks on reload. In fact this one does something a little more drastic.

PowerOff=PowerOff, "Watch TV"="Watch TV", "Use Apple TV"="Use Apple TV" becomes PowerOff=PowerOff, Watch=Watch TV, Use=Apple

This appears to be loosely related to Issue #177, but I believe warrants a separate issue. I hope you agree with me.

brianhanifin commented 8 years ago

I haven't see a solution to the Nest "heat-cool" mode property. But I found a workaround for the Harmony issue after reading this Makeuseof article. Apparently the Harmony Hub has unique identifiers for each activity and device.

So putting this in the mapping field works for the Harmony.

PowerOff="Power Off", 18768212="Watch TV", 18768213="Use Apple TV", 18768216="Play Wii U", 18768214="Watch Blu-ray", 18768215="Play Xbox 360"