UI Logic and user interactions - Recording values / Blocking changes.-

Hi all ,

1st I want to clap my hands and recognise to you that NodeRed is an amazing , superpower software tool ! Many thanks for coding and mantaining it !

Go ahead with my problem.
I've been working in a AI Automation Domotic project. I kind of home made GoogleNest.

I need to program some logics for the user interface , my UI has very simple and intuitive inputs:

ATHOME (SWITCH) : whenever a user is at home (1/0)
AUTOMODE (SWITCH) : whenever to use the input from the AI using an API (1/0)
ECOMODE (SWITCH) : whenever eco mode is on/off (1/0)
SET_TEMP (SLIDER) : let the user control the temperature manually.

Nodered is performing well after some problems with loops , but I don't know how to implement the following functionalities.

1.- Recording user configuration options :

If the user go out, ATHOME=0 , ECO MODE will automatically go to ON and TEMP will be fixed at 18º.
if the user come back ATHOME=1, how can I retriebe previous TEMP and ECOMODE Configuration options ?

2.- Blocking a slider state :

If the user setup ECOMODE to ON ,the GAUGE and the SLIDER will show correctly the 18º information , but I'll still be able to move the slider and change it again while ECOMODE is ON , how can I block it till ECOMODE is again setup to OFF?

Thank you all , are great .-


1 I know from your previous thread that you are using MQTT, so a solution to issue 1 is to keep two values of the temperature setpoint in MQTT. One for normal mode and one for eco mode. Then when eco mode changes you just need to start using the alternative one. Similarly if you want to return to the previous eco mode setting when athome goes to 1 then keep an athome eco mode in mqtt and when arriving home restore the athome eco mode.

2 A good way to do this may be to disable the slider when ecomode is on. You can disable it by sending it a message with msg.enabled false, and enable it by sending msg.enabled true.

Clear as water Colin , thank you so much on how to handle this -

I always wondered what the opposite to 'clear as mud' was.. 'clear as water.'

I suppose it should really be 'opaque as water`.

LOL! Too funny!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.