No,
I found that define ONE_Wire_BUS 2 didn’t work for me, I changed it to GPIO 12 instead.
so now I am using GPIO 12 not GPIO 2 and now it works, strange…
I checked the sensors on the same ESP8266 WEMOS D1 board and on GPIO2 with some example programs, and that worked with the GPIO 2 pin. I don’t know why this happend. But it now ok for me. I use GPIO 12 in your program.
great good that you got it working – was always abit of a pet peeve of mine why they changed funtions with updates and then you sit forever trying to figure what changed and how the format changed…
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.
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
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
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
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.
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¶m=udevice&idx=IDX&nvalue=0&svalue=-1;USAGE
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
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