@Buckskin With JSON - I seem to hit a brick wall, or at least, get taken out of my comfort zone! I seem to ge ton well, and then have a horrendous crash, which knocks my confidence! BUT, your's and Bart's observation regarding JSON from the inject Node looks good. I will have to try it.
I did experiment with a CRON PLUS job as an 'active' driver to adjust temperature, but ended up 'developing my own' as I was not 100% sure about CRON after a power off. (I say my own, but it is not rocket science!! ) That is a solution that I know works, and can easily be included in a 'parameter refresh' loop but now I can see the logic behind your comments with regard to JSON. Don't like fetching files anyway if I can help it, always seems a bit clunky!
Agreed, the schedule_profile_names
does not add anything other than convenience of identification.
@BartButenaers Thank you, always worried at what people will say with regard to code, but I also treat it as 'Training Opportunity' for someone to 'hedjucate' me!!
The function node you have indicated injects the current value for the desired temperature of the Living Room into context without accessing the TRV. This is then used by the rest of my flow to
- Switch the boiler ON/OFF
- Control the Diverter Valve
I used HTTP as I could not find the equivalent MQTT command string. iirc, all Shelly API calls for the TRV were developed for HTTP and MQTT has gradually caught up, but the documentation has been well behind the curve either incorrect (thermostat/s). Now, maybe, you can find something I missed, in which case, please let me know. (Would JSON work?)
I don't know that MQTT is better than HTTP from a power standpoint, I would assume yes, but don't know.
The idea is to load all the profiles onto the TRV and let that run autonomously, then be able to select the profile by changing the Profile Number. That then requires the Boiler to know what is going on, I pull the current profile into a function node (without communicating with the TRV) to strip out the current required temperature so that I can control the boiler and the Diverter Valve.
I will look at a way of using the cronplus node to load the profile schedules so that I can get the current data, but only send those schedules to the TRV if there is a change. Or, more likely, use the above, but instead of using a file, use JSON.
My concern is that after a Power Cut, the Boiler Control flow needs to hit the ground running with the correct values and maintain them as each step of the schedule changes and account for any change in profile. No good having a power cut for a couple of days and then Boiler operating in 'Night Mode' while the Radiator is running in 'Day Mode'.
Thanking you for your comments and observations, Any questions, ask away!