Page 1 of 2
Multi sensor ds18b20 on Tasmota firmware
Posted: Tuesday 20 February 2018 18:00
by jordantheripper
Hi people, this is jordan from italy.
first of all I have raspberry pi 3 with domoticz on board.
I have a little question for you. Yestarday I flash tasmota firmware on nodemcu v3 using arduino ide. It really works fine.
i decided to put temperature sensor that consists of three DS18B20 sensors wired in parallel (sharing the same digital serial data bus) to digital pin 4 on the ESP8266. Infact, as you can see, it works great

- multi ds18b20.jpg (56.47 KiB) Viewed 14020 times
to do this I change line in USER_CONFIG.H:
#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
but in tasmota, i can just use one idx of domoticz to see temperature. so, how i can see other temperature sensor in domoticz?
may be i have to write idx in USER_CONFIG.H just before flshing tasmota, but I don't know why.
thanks in advance
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Tuesday 20 March 2018 8:30
by emme
Ciao,
I had to many problems using DS18b20 on NodeMCU due to the fact that is does not well supports 1wire bus...
I'm quite curious about your code... would you mind to share it?
Instead of flashing nodeMCU firmware I used MySensors WiFi Gateway on the device and have splitted the DS18B20 on a ATMega128 using the NRF24PA radio... but of course if there is a way to use it.. I would prefer!!!
Ciao
M
P.S.
in the code of your formware you have to specify the http request to update the right temp sensors in domoticz...
or at leat have domoticz gather the info form a specific page (API-JSON) on the NodeMCU web server.
the second way is preferred, but depending on your code, the api/page address could change
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Wednesday 21 March 2018 23:45
by kimot
I do not know Tasmota,
but if you flash ESPeasy firmware, you can send as many temperatures as number of sensors you can connect.
At least with rules.
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Saturday 25 August 2018 20:58
by Derik
Someone have multiple dallas working on the tasmota?
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 23 September 2018 13:52
by Derik
Kick
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Tuesday 15 January 2019 20:16
by gj23
hey guys,
i had it done and because of a few inquiries i did an update a while ago for tasmota 5.14.0a.
so you can download it
here and take it to change it for the newest version of tasmota

Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Saturday 21 March 2020 18:45
by McRMX
Hi!
Have you solved you problem.
I have the same one with the new version of tasmota 8.1.0
The files are differents with the last solution!
Please help me.
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Saturday 21 March 2020 20:22
by xury
I can use a NodeRed and resend to domoticz/in
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Saturday 21 March 2020 20:53
by McRMX
The better way is to tasmota can do it! Maybe I don’t know the method / parameters !
If I don’t find a easy solution if you think it’s a solution! Why not
Have you some tutoriel to explain how do this ?
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Saturday 21 March 2020 21:17
by xury
I use four DS18B20 sensors on One ESP8266 device with tasmota firmware.
To send all four values without recompiling own Tasmota. I use node red as an intermediary between Domoticz and Tasmota.

- tasmota.png (12.55 KiB) Viewed 9755 times
Code: Select all
[
{
"id": "4dc31f8a.b4d0b",
"type": "mqtt in",
"z": "361da2b3.1527de",
"name": "",
"topic": "strych/tele/SENSOR/#",
"qos": "2",
"datatype": "auto",
"broker": "9748a36f.44bdd",
"x": 280,
"y": 280,
"wires": [
[
"fdbcab3.28aba58"
]
]
},
{
"id": "fdbcab3.28aba58",
"type": "json",
"z": "361da2b3.1527de",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 450,
"y": 280,
"wires": [
[
"2f400adb.82bdc6"
]
]
},
{
"id": "2f400adb.82bdc6",
"type": "function",
"z": "361da2b3.1527de",
"name": "Split key value",
"func": "var keys = Object.keys(msg.payload);\n\nvar msgs = keys.map(function(key) {\n return { topic: key, payload: msg.payload[key] };\n});\nreturn [msgs];",
"outputs": 1,
"noerr": 0,
"x": 600,
"y": 280,
"wires": [
[
"e795a78e.355998"
]
]
},
{
"id": "e795a78e.355998",
"type": "switch",
"z": "361da2b3.1527de",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "DS18B20-1",
"vt": "str"
},
{
"t": "eq",
"v": "DS18B20-2",
"vt": "str"
},
{
"t": "eq",
"v": "DS18B20-3",
"vt": "str"
},
{
"t": "eq",
"v": "DS18B20-4",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 770,
"y": 280,
"wires": [
[
"60a83551.9b506c"
],
[
"60a83551.9b506c"
],
[
"60a83551.9b506c"
],
[
"60a83551.9b506c"
]
]
},
{
"id": "60a83551.9b506c",
"type": "function",
"z": "361da2b3.1527de",
"name": "prepare to send",
"func": "\nif ( msg.topic == \"DS18B20-1\" ) \n{\n wartosc = msg.payload.Temperature;\n msg.payload = {};\n msg.payload.idx = 94;\n msg.payload.nvalue = 0;\n msg.payload.svalue = String(wartosc);\n \n}\nelse if ( msg.topic == \"DS18B20-2\" ) \n{\n wartosc = msg.payload.Temperature;\n msg.payload = {};\n msg.payload.idx = 96;\n msg.payload.nvalue = 0;\n msg.payload.svalue = String(wartosc);\n \n}\nelse if ( msg.topic == \"DS18B20-3\" ) \n{\n wartosc = msg.payload.Temperature;\n msg.payload = {};\n msg.payload.idx = 95;\n msg.payload.nvalue = 0;\n msg.payload.svalue = String(wartosc);\n \n}\nelse if ( msg.topic == \"DS18B20-4\" ) \n{\n wartosc = msg.payload.Temperature;\n msg.payload = {};\n msg.payload.idx = 97;\n msg.payload.nvalue = 0;\n msg.payload.svalue = String(wartosc);\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 940,
"y": 280,
"wires": [
[
"816b0a0d.2c4b98"
]
]
},
{
"id": "816b0a0d.2c4b98",
"type": "mqtt out",
"z": "361da2b3.1527de",
"name": "",
"topic": "domoticz/in",
"qos": "2",
"retain": "",
"broker": "9748a36f.44bdd",
"x": 1110,
"y": 280,
"wires": []
},
{
"id": "9748a36f.44bdd",
"type": "mqtt-broker",
"z": "",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 7:54
by McRMX
Thanks I will try today.
You say you install tasmota on esp8266
I fail all install in esp8266
This model in the link
https://en.m.wikipedia.org/wiki/File:ESP-01.jpg
I try the last versus of tasmota 8.1.0
Have you already load on it and success ?
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 8:43
by xury
Yes. You can be able to upload standard Tasmota binary to any Esp8266 device with minimum 1Mb flash memory size.
For Esp-01 you have to manually connect gpio-0 to GND while starting upload process.
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 10:07
by McRMX
Ok i just read a tutorial and a I see I do a confusion between esp8266 and esp01!
Now sure I know I have a esp01. I make gpio on gnd when I plug usb adaptateur And unplug 3 sec later but I have always fail!
What software do you use to do this with esp01?
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 17:52
by xury
I use Tasmotizer
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 18:27
by McRMX
Same for me!
I don't understand, I think I make a mistake but I don't know where
This is my error: Failed to connect to ESP8266: Timed out waiting for packet header
Can you explain me step by step how you do please ?
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 19:28
by xury
What UART cable you use? Some dedicated USB -ESP-01 devices not entering flash mode properly. So sometimes needs to manually connect GND to reset pin while GPIO-0 is connected to GND and flashing software tries to start flash.
Instructions are here:
https://github.com/jandelgado/NodeMCU/w ... structions.
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 22 March 2020 21:58
by McRMX
i just success the loading
i put RST and CH_PD on 3,3v without resistance like the schema on your link. i see after
the load is a success but i don’t see the wifi network. i try tomorrow again
thanks for your help
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Wednesday 25 March 2020 8:42
by McRMX
Like I say you up, the flash mode is a success. ( Different program tell me) but no wifi available after reboot !!
I Don't understand why.
There is a specific manipulation to reboot ?
I unplug and plug again USb after flashing !
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 05 April 2020 23:01
by borgy
Here is how i solved the node red problem.
Copy the node-red code below
Code: Select all
[{"id":"8dbe92d9.7ab8b","type":"mqtt in","z":"7d09664b.2c8b18","name":"","topic":"zoltest/tele/SENSOR","qos":"2","datatype":"utf8","broker":"11bf038c.8e615c","x":110,"y":280,"wires":[["85e1e4c6.51d758"]]},{"id":"85e1e4c6.51d758","type":"change","z":"7d09664b.2c8b18","name":"-/_","rules":[{"t":"change","p":"payload","pt":"msg","from":"DS18B20-","fromt":"str","to":"DS18B20_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":280,"wires":[["8f38ad0f.40858"]]},{"id":"8f38ad0f.40858","type":"json","z":"7d09664b.2c8b18","name":"","property":"payload","action":"","pretty":false,"x":410,"y":280,"wires":[["1c9434b7.85ef9b"]]},{"id":"c8fdfb84.807008","type":"debug","z":"7d09664b.2c8b18","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":280,"wires":[]},{"id":"1c9434b7.85ef9b","type":"function","z":"7d09664b.2c8b18","name":"","func":"var j, newmsg;\n\n\nvar j_list = (msg['payload']);\nfor (var j_index in j_list) {\n j = j_list[j_index];\n newmsg={};\n newmsg['payload'] = j;\n flow.set('last', (flow.get('current')));\n flow.set('current', (newmsg['payload']));\n node.send([newmsg]);\n}\n","outputs":1,"noerr":0,"x":530,"y":280,"wires":[["4a4dd53c.fe929c"]]},{"id":"4a4dd53c.fe929c","type":"function","z":"7d09664b.2c8b18","name":"","func":"if (msg.payload.Id !== undefined){\n msg1 = {};\n msg1.payload = msg.payload.Temperature;\n msg1.topic = msg.payload.Id;\n return msg1;\n}","outputs":1,"noerr":0,"x":690,"y":280,"wires":[["c8fdfb84.807008"]]},{"id":"11bf038c.8e615c","type":"mqtt-broker","z":"","name":"PI2","broker":"192.168.178.23","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]

- Knipsel2.PNG (38.33 KiB) Viewed 9537 times
Re: Multi sensor ds18b20 on Tasmota firmware
Posted: Sunday 19 July 2020 20:50
by Deali
First of all, i started using Domoticz a few weeks ago. It is a realy shining solution.
First i started with some SonOFF devices. It worked fine. But these Boxes are realy big.
I bought some ESP8266 Boxes from China and flashed them with Tasmota.
Now i took A ESP01 and soldered 2 DS18B20 to it. This is really small.
I want to install them inside my Solar-Converters, one Sensor inside, the other outside.
On Tasmota i used Generic(18) and on D4 GPIO2 DS18x20 (4)
I get the following MTTQ String:
Client mosq-3RIP7OnZeBI7vSLND6 received PUBLISH (d0, q0, r0, m0, 'tele/DualTemp/SENSOR', ... (151 bytes))
{"Time":"2020-07-19T19:43:21","DS18B20-1":{"Id":"3C01A8164016","Temperature":29.2},"DS18B20-2":{"Id":"3C01A8168455","Temperature":29.8},"TempUnit":"C"}
I am unable to get this two Sensors to show up in Domoticz. Only the first is showing up.
Ist it possible to get it working?
After extensive search i did not find a solution and i ask here for help
Best regards
Deali