iobroker-community-adapters / ioBroker.iqontrol

Fast Web-App for Visualization.
MIT License
64 stars 25 forks source link

iQontrolHomematicIpThermostat doesn't set the control mode correctly #251

Closed tehXor closed 1 year ago

tehXor commented 2 years ago

Describe the bug
Switching from manual to automatic control mode does not work.

To Reproduce
With a HmIP-WTH-2 which has the role iQontrolHomematicIpThermostat:

  1. Go to extended dialog
  2. Switch from the default automatic mode to manual (which works)
  3. Switch from manual mode back to automatic (this does not work and it also tries to trigger boost)

Expected behavior
Switching back to manual mode should work.

Screenshots & Logfiles
n/a

Versions:

Workaround In index.js change: Line 9784

var value = $("input[name='DialogThermostatControlModeCheckboxradio']:checked").val();

to

var value = parseInt($("input[name='DialogThermostatControlModeCheckboxradio']:checked").val());

and

Line 9799

var setValue = setValues[index] || true;

to

var setValue = setValues[index]
if (setValue === undefined) setValue = true

(Not sure if the workaround covers all cases, I just tried for my specific case which does not include boost for example.)

sbormann commented 2 years ago

Hi, I am currently working on this - sorry for the long delay. Could you please send me the RAW of CONTROL_MODE? I have no HM-IP-Thermostat so it is difficult for me to figure out the problem. Many thanks!

tehXor commented 2 years ago

Hi, I am currently working on this - sorry for the long delay.

Thanks and no worries. My workaround is doing fine and if I don't have to maintain it at some point in future since you fix it upstream, too I'm already more than happy. You're project is so very functional and time saving for building web app interfaces that even living with some of those bugs long term would still be no problem. So thanks a lot for your work :)

Could you please send me the RAW of CONTROL_MODE?

Anyways, I hardly have any experience with ioBroker and HM devices yet so I'm not exactly sure what you mean with RAW... Regarding the workaround I just had a quick look at the dev tools and saw that at https://github.com/sbormann/ioBroker.iqontrol/blob/e2afa70e0ca0bed7b7167867d08681edf6810ad9/www/index.js#L9784 a string was returned while I assumed an integer is what we actually wanted. So I added the parseInt here also I'm not entirely sure if it would have been required. And than what ultimately caused the problem in my case was that at https://github.com/sbormann/ioBroker.iqontrol/blob/e2afa70e0ca0bed7b7167867d08681edf6810ad9/www/index.js#L9799
setValue will fall back to true in case setValues[index] is 0 and that is the case for AUTO-MODE. This is why I changed it like described in my first post.

And here is the ioBroker object data for CONTROL_MODE in case that helps. But if you need more, just tell me where to find it and I'll post it!

{
  "type": "state",
  "common": {
    "name": "CONTROL_MODE",
    "role": "indicator",
    "def": 0,
    "type": "number",
    "read": false,
    "write": true,
    "min": 0,
    "max": 3
  },
  "native": {
    "MIN": 0,
    "OPERATIONS": 2,
    "MAX": 3,
    "FLAGS": 1,
    "ID": "CONTROL_MODE",
    "TYPE": "INTEGER",
    "DEFAULT": 0,
    "CONTROL": "HEATING_CONTROL_HMIP.CONTROL_MODE"
  },
  "from": "system.adapter.hm-rpc.0",
  "user": "system.user.admin",
  "ts": 1663187584916,
  "_id": "hm-rpc.0.000A9FXXXXXXXX.1.CONTROL_MODE",
  "acl": {
    "object": 1636,
    "state": 1636,
    "owner": "system.user.admin",
    "ownerGroup": "system.group.user"
  }
}
sbormann commented 2 years ago

Would it be possible for me to connect to your system (via Anydesk or RustDesk) and see what exactly happens when you change modes? Maybe next weekend?

frankhetterich commented 1 year ago

Any Progress on that topic? I´m experiencing the same issues

sbormann commented 1 year ago

I got a HM-IP Thermostat to test it - but my old HM-Addon for Raspi does not connect to it (does not support HM-IP i think...). I need to add an HM-IP Accesspoint first. I am working on it, but i need a little more time, sorry.

sbormann commented 1 year ago

@frankhetterich as an alternative i could offer to connect to your sytem via Anydesk or RustDesk and have a look, what is happening if you press the buttons. I think, it would not take much time to understand why the bug happens - but i need to see it.

frankhetterich commented 1 year ago

@sbormann Shure, i´m happy to help. How we can get in direct contact?

sbormann commented 1 year ago

Hi, sorry, was first on holiday and then ill. Do you have time tomorrow? We could use Anydesk or Rustdesk if you want. By the way: are you german? :)

hetti72 commented 1 year ago

Hallo, ja ich spreche Deutsch und habe auch morgen Zeit. Wenn ich mir deine Webseite im GitHub Profil anschaue, wohne ich nicht weit von dir. Wie kommen wir in direkten Kontakt? Ich hab bis jetzt weder anydesk noch rustdesk installiert, ist aber kein Problem. Gruß Frank

sbormann commented 1 year ago

Hi, am besten Du installiertst Anydesk und schickst mir dann Deine Anydesk-Nummer. Wollen wir einfach eine Zeit ausmachen, z.B. 14 Uhr? Bin aber zeitlich flexibel, hab nur abends keine Zeit.

hetti72 commented 1 year ago

Meine Anydesk ID ist xxxxxx. 14 Uhr passt heute bei mir auch.

sbormann commented 1 year ago

So, hat geklappt, neue Version ist auf Github und ich hoffe, dass jetzt endlich auch HM-IP fehlerfrei läuft!! Danke für die Zusammenarbeit!!