FHEM Forum

FHEM => Frontends => TabletUI => Thema gestartet von: malc_b am 27 Dezember 2016, 19:12:29

Titel: Thermostat with up/down buttons
Beitrag von: malc_b am 27 Dezember 2016, 19:12:29
I posted a question (last Christmas) in the English forum on this

https://forum.fhem.de/index.php/topic,47804.0.html

And then answered my own question with some code if anyone find that helpful.  What I never got to fixing was the problem that each up/down button push sent a MAX message which could easily use up all the credits so blocking further messages.

What I reckon it needs to do is to update the thermostat value on the screen but delay sending the updated value until the user has stopped pressing buttons.  This needs to be done in the thermostat widget but I could do with some help on what code to add/change in that widget.
Titel: Antw:Thermostat with up/down buttons
Beitrag von: setstate am 27 Dezember 2016, 21:00:38
Have a look at the code of the spinner widget. There I use timer delays to figure out if the user has finished to change the value. Only after then last change, the final value gets send to FHEM once.
Titel: Antw:Thermostat with up/down buttons
Beitrag von: malc_b am 29 Dezember 2016, 18:26:30
Thanks.

I've come up with an alternate solution which I've described here (https://forum.fhem.de/index.php/topic,63649.0.html).  Rather than using buttons and a mid size thermostat this uses a small thermostat but expands it to fill a tablet screen when you tap it.  That way you can easily change the temperature, even with big fingers, and because it only updates the max radiator valve when you release it then it doesn't have the issues a button has.