Strange question perhaps... Do you guys take care to properly initialize values when your miniserver boots up and let it wait? Let me explain.
A simple example is a radio button to set the input of my amplifier: AIs on the Radio Button takes the current source of the amplifier (from a virtual input), the different Qi's trigger different sources (to a virtual output). The AIs only gets a signal when the amplifier changes source or is queried, so when the miniserver reboots, it does not get a signal of the current amplifier input, and just sets the first input and sends this to the amplifier, causing it to change. I know I can set "remanence" to make it remember the last setting on the radio button, which would be wrong if the amplifier changes in the mean time (but we can assume that if the miniserver is down for long enough for me to change the amplifier, there will be bigger issues

A more complicated example, where I'm unable to do this is with my thermostats: I have both an operation mode (home/night/away, each of which has its own default temperature) and a setpoint shift (to deviate from the default temperature). For some reason, when the miniserver boots, my setpoint shifts are all over the place. I suspect the cause is in the incorrect order of initialization which triggers the miniserver to change the setting of the thermostat. I'm not sure my problem is related to the startup initialization order of different variables, but I have no other idea what it could be so for now I'm just forcing the miniserver to set default values, 10s after boot, to just have a reasonable fallback (e.g. not to have room temperatures suddenly at 30°) in the event the miniserver reboots.
To make it possible for the miniserver to first learn the situation (e.g. in my case: thermostat operation mode, setpoint shift), it would require quite some elaborate logic just to make sure the miniserver first queries everything but at the same time waits with applying its logic and prevent it from changing settings until it has read all relevant data. At the moment, I don't see the point of doing so in normal situation if default values suffice (I noticed the issue as now I'm changing a lot in the config and testing, so my miniserver often loads a new config).
How do you guys do it?
My miniserver is not on a UPS, so a powerfailure could trigger a reboot which could yield uncomfortable settings.
Is there an easy way, or you also just revert to default values?
Thanks!
Kommentar