Esp8266 --multiple flow heat meter for heat pumps and solar thermals

I inserted the wemos in my heatpump system. I use an FS400A flowmeter, formula is F=4.8*units of flow(L/min)*time(seconds. would be 288 pulses, I checked it and came to 260 pulses per liter. What kind of flowmeter did you use? I just use one set of sensors, thus two ds18b20 and the flowmeter. Now I must insert the data in Domoticz. I’ll try to do that in rednode. I have some experience with it.

similar to these:

Ok, that is the same flowmeter I use. I calibrate the complete heatmeter setup with my inline heatmeter from Elster a F90S, and came to a value of the flowmeter of 625 pluses

my power is now nearly the same as the Elster

Greetz, Peter

Serial.print("Flow 1 in Liters: ");

Serial.print(flow1count/625.0);  // adjust 625 to match the value of your flow metre for FS400A formule is F=4.8 * units of flow(L/min)* time(seconds)= 288 Verdubbeld, gecheckt met warmtemeter Elster F90S.
Serial.print("\tFlow 1 in pulses: ");
Serial.print(flowacount);
Serial.print(flow1count);
delay(500);
 Serial.print("Requesting temperatures...");
  sensors.requestTemperatures();
  Serial.println("DONE");
    printData(inputa);
  printData(outputa);
  
  t1 = (sensors.getTempC(inputa)+0.0);  //add error correction
  t2 = (sensors.getTempC(outputa)+0.25);// gecorrigeerd, gecheckt met gegevens van warmtemeter Elster F90S
dt = (t1 - t2); 
dta= (dta+dt); 

  if (!client.connected()) {
    reconnect();
  }

  client.loop();

  long now = millis();
  if (now - lastMsg > 5000) {   // 5 second sample
    lastMsg = now; 
    fa =((flowacount/625.0)/5);  //flow rate calulated at l/s
      dta=(dta/cnt);
  
    w=(((((flowacount/625.0)*1000)*dta)*4.188)/5);     // adjust last to match inteval of sampling sec

[Edited for format - Moderator (RW)]

1 Like

For future reference, when posting code or output, please put 3 ‘backticks’ (normally found at the top left of the keyboard) on a line of their own before the code, and 3 more backticks also on a line of their own after the code:

```
code
```

If it is something like php you can add a language identifier after the first 3 backticks: ```php or even ```text if you don’t want any language markup applied.

hi Stephan,
I am struggeling to get my data from the Esp8266 to domoticz by rednode,
I don’t know how to split the json string. I tried It with the Json node.
An other question, What is the use of the line

String payload = “{ “devices”: “B”,“payload”: {” + value + “}}”;

do I need “devices”:“B”,

I changes it in

String payload = “{ “payload”: {” + value + “}}”;

Can you give me an example how you use your program data in Rednode?

thanx, Peter

at the time I wrote this I was using freeboard now I do things much differently I use collectd to collect mqtt that sends it to influxdb or use wemos R3 and espeasy for pretty much everything

  • to send to domoticz using this sketch just send it directly just change the the MQTT format

https://www.domoticz.com/wiki/MQTT

example format :
mosquitto_pub -h localhost -m ‘{ “idx” : 1, “nvalue” : 0, “svalue” : “25.0” }’ -t ‘domoticz/in’

now personally to send to domoticz i use different hardware methods I use wemos R3’s
and this method

which in the case of the above sketch modify it to work with UNO and then pass the data to the built in ESP on wemos R3 using

Serial.print(“TaskValueSet,1,1,”); Serial.println(“DATA”);

and from there use that to send it to Domoticz

Hi Stephan,

I use ESPEasy also for a lot of different kind of sensors. But in ESP easy you can choose Domoticz MQTT in the controller settings and do not have to make use of rednode. Thanks for you example format. I will give it a try, I will buy some wemos R3 units to experimenting

I also make use of a lot of Shelly devices, for switching and dimming lights. See https://shelly.cloud. They work out of the box very nice for me.

I use something similar to the shelly format but using zigbee for my home automation…

it all basically plug and play to domoticz after you have zigbee2mqtt setup

if you want you can send it directly to domoticz with out mqtt if you like example how to do that is at the bottom of the page ESP8266 WiFi module - Domoticz

from the looks you have to send it to several different idx . (or you construct in domoticz a json function that works with temp, flow, energy )
example: ( in the sketch )

Energy( counter set to -1):
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=-1;USAGE

temperature:
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP

flow- there no json for that - custom:
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=VALUE

hello Stephan,

I have a post by the NodeRed forum, They gave me an solution, I will give it a try,

Greetz, Peter

1 Like


Hello Stephen,

this is how my heatpump setup looks like.
All the sensor are now inplace including your heatpump calculation,

Thanks very much,

Greetz, Peter

1 Like

looks very nice glad you got it working for you and that it was of some help to you–

for the heck of it, I updated the above to send data MQTT in JSON and MQTT for CollectD and directly to Domoticz by HTTP

espflowtempDomoticz.zip (3.6 KB)

I edited my LCD version to include Domoticz as well (the one I personally use, as it’s convenient to have the LCD right near the heat pump)
espflowtempLCD-Domoticz.zip (3.9 KB)

I will give this one a try, a lcd right at the heatpump is a good idea. I also wanted to do that but with an extra esp8266. But you solution is better.

The odd thing is that i see now stange readings in domoticz Dashboard screen, its not the actual power but the usage of the day. I think its a domoticz issue. And If I want to see the log of the values, I get a black screen,
in the Utility tab I can see al the values

there are a couple energy virtual switches one is cumulative the other is not in domoticz

while had my device apart today to update it, I decided to rework it a bit more.
i stopped using DallasTemperature.h and use another method that I use to use. as I like it more then Dallastemperature.h … but a little harder to work with
but now you have to set your romCode for the sensor which is T1, T2, T3 and T4 … and you can hotswap with the code ( as I have all my ds1820s on stereo plugs and cables so you can rearrange easily ) you can also hotswap in other DS without having to reprogram anything but they will publish to mqtt automatically using their romcode as the topic

example of a mqtt publish :
28af1243986056 18.56

instead of having another esp to measure my buffer tanks the one device does all
espflowtempLCD-DomoticzNew.zip (4.6 KB)

here my little device in a old router case - it has two stereo audio jacks on the side for temperature sensors and two stereo audio ports on the bottom for the flow sensors . and for extra ds I just use stereo branch cables or adapters to dived the cabling for more ports

here an example from the serial screen what going on - I use collectd so i disabled domoticz and json – there are the 4 tagged sensors for T1,T2,T3 and T4 – but also unlisted ones . that are published to mqtt

espflowtempLCD-DomoticzNew_1.zip (4.8 KB)

last update for it – I see when I had alot of temp sensors connected it would sometimes have bad read so I added an error trap that tosses that sample out … I also change the rate sampling and at boot gave it a bit more info

Ok thanks,
I already tested you new Sketch and they work ok.
But I also have seen some temperatures and sensors gave bad readings.
I will try your newest Sketch. The LCD and extra temperature are a nice extra.
Also the Domoticz add.

Greetz, Peter.

Hello, Stephan,

I used sketch espflowtempLCD-Domoticz, modified it for 2 temperatures and one flow,
works perfect, but I had to modify the number of pulses in the sketch. The flow was not the same as in the old sketch. I like the LCD and domoticz option. See pictures.

Now I want to make a heatmeter for mij floorheating, and solarboiler.

For the solarboiler I want to use the one with the extra temperatures, for logging the temp in the boiler
How did you calibrate the heatmeter?
I have an extra calibrated heatmeter in my heatpump system, so I used that one for calibrating,
but if I don’t have an heatmeter (floorheating and solarboiler) how do you do that??

Greetz, Peter


1 Like