Thermostat with up/down buttons

Begonnen von malc_b, 27 Dezember 2016, 19:12:29

Vorheriges Thema - Nächstes Thema

malc_b

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.

setstate

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.

malc_b

Thanks.

I've come up with an alternate solution which I've described here.  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.