Bramco
(Simon)
6
Mark hi,
My starting point was the code from MartinR but really it was only the timing loops for reading the sensors and sending the data. From memory, his code uses interrupts to manage this so that it doesn’t trip up the main code to read the CTs and control the triac for the diverter. On an ESP8266 without the diverter, you can use the Ticker library to effectively set up the triggers to read the DS18B20s and to do the send of the data to emoncms and MQTT.
I can send you my code (pretty messy) to do this but it’s very specific to managing my backup boiler and heat bank.
Thinking abut things this morning though, why don’t you use Tasmota or ESPHome. There are several threads on here about getting Tasmota to send data to emoncms for example → Tasmota integration with EmonCMS Input REST API.
It might be easier to go down this route with MQTT and node-red than to create your own code.
But, as I said, I can send you my code if that’s your preferred route. I’d also stick with an ESP8266 rather than a pico, mainly because there’s lots of information and experience with using the ESP devices to read DS18B20s.
Simon