Multi sensor ds18b20 on Tasmota firmware

Everything about esp8266 and more.

Moderator: leecollings

jordantheripper
Posts: 6
Joined: Sunday 17 December 2017 16:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9208
Location: Italy
Contact:

Multi sensor ds18b20 on Tasmota firmware

Post 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
multi ds18b20.jpg (56.47 KiB) Viewed 12255 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. :roll: :roll:
thanks in advance
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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!!! :D :D

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
The most dangerous phrase in any language is:
"We always done this way"
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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.
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post by Derik »

Someone have multiple dallas working on the tasmota?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post by Derik »

Kick
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
gj23
Posts: 2
Joined: Monday 19 February 2018 15:58
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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 ;)
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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.
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post by xury »

I can use a NodeRed and resend to domoticz/in
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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 ?
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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
tasmota.png (12.55 KiB) Viewed 7990 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": ""
    }
]
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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 ?
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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.
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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?
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post by xury »

I use Tasmotizer
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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 ?
xury
Posts: 48
Joined: Monday 10 December 2018 23:32
Target OS: Linux
Domoticz version:
Location: Poland
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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.
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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
McRMX
Posts: 7
Joined: Saturday 21 March 2020 18:42
Target OS: -
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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 !
borgy
Posts: 1
Joined: Sunday 05 April 2020 22:48
Target OS: Windows
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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":""}]
Image
Knipsel2.PNG
Knipsel2.PNG (38.33 KiB) Viewed 7772 times
Attachments
Knipsel.PNG
Knipsel.PNG (53.4 KiB) Viewed 7772 times
Deali
Posts: 3
Joined: Thursday 25 June 2020 3:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Multi sensor ds18b20 on Tasmota firmware

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests