Esp8266 and multiple ds18b20's with mqtt

yes i did that already , how do i add other wifi network
it will not talk to my mqtt right now because its not here. however .
i do have port forwarding to my raspberry pi, can it connect from outside the network?

go into configuration and change it from Sonoff Basic to Generic

Reboot

Go back into configuration and select the GPIO you will have your DS18B20s connected to

Craig

it is says pin 2 on the hat? how do i figure out wich gpio that is?

Probably not re port forwarding - and you really should not do that unless you know what you are doign security wise

In the config page there is an option for WIFI

There is an option to input 2 x WIFI networks

Craig

When you keep saying HAT i do not think that is right ? A HAT is for a Raspberry Pi, usually on an arduino etc they are called a shield

Can you confirm the HAT/Shield will plug directly into the ESP ?

Craig

there is no sensitive data on the ports have have port forwarding on.
its how i can turn a pump on and off and water supply on and off in the dashboard from anywhere.


when i made a keg washer i had issues and it was because of the push pin wires not having a good connection, so i use terminal blocks for everything now.

setting up mqtt screen,
i set up the ip i know the mqtt server is on.
what else on this screen should be changed?
it shows a login and pass, but i dont have logging in enabled on the mqtt server,, Should i change that to login?
and are the lower parts where i classify my "topic"


thanks again Craig your always full of great info and very understanding for the peeps wet behind the ears!

Yep thats fine - no problems with that unit it is not a HAT just a ESP Dev kit breakout board

It should have a diagram that shows what pins on the ESP map to the screw downs. You will then need to look at one of the online diagrams to see which pin that is in Tasmota terminology

So when you take the board back to work if it can not find a WIFI network it will create its own Access Point again and you can then go through the same process to set it up on the work wifi network.

Presumably you have something at work that provides a DHCP server so it can get an IP address.

Craig

yes, i do on dhcp,
to question of the topic and full topic is this ok?

You do not have to worry about changing any of that initially

The Topic is what will be sent to the MQTT broker and then end up in NR so make it something reasonable that relates to what this ESP will be used for - but whilst setting it up you can leave all as defaults and you will see what the messages look like coming in

(Not sure what the use of this is - something with brewing if i remember correctly ??)

Craig

Yep thats fine - as i say - once back on site - pipe the output from the mosquitto broker out to the console and you will be able to see the messages as the come in

Also by default Tasmota only sends messages every 5 minutes

to change this go to the console from the main menu and type

Teleperiod 10

Which will get it to do a temperature reading and send it every 10 seconds

You might also want to setup correct DST and timezone - these are also console commands on Tasmota

Craig

yes, brewing.
more so.
monitoring temperatures. using PWM to heat electric kettles,
and using standard gpios to open or close a circuit to turn on or off a solenoid valve for cooling ,
or in easier terms to turn a fan on and off for cooling. and a heat lamp on and off for heating.
i have cornhole league tonight, so off for some beer , playing cornhole, and then ill mess with it at brewery for a little bit. the dev board makes it easy to do some work at home where my recliner is way more comfortable then my bar stool! cheers

What the eff is Cornhole ?

Craig

Chucking bean bags around :wink:

At least we have another tasmota convert !

Seriously - and they have named it as well !!!

Probably see the Cornhole championships on ESPN soon - right along with the Esports etc !!

Yep it is pretty amazing how quick you can get someone up to speed with something like Tasmota as compared to coding it all yourself in the Arduino IDE or Platform IO etc

Craig

https://youtu.be/X4jD8k5aTGI
This is corn hole, it's better to do while drinking beers, (that way you have an excuse for being bad at it)

a couple of things to note when you are playing with this

  1. Tasmota only supports all sensors on a single Pin - so you have to connect all the DS18B20 together - i assume you know about the need for a Resistor between VCC and data - depending on your distances and number of sensors this can take a bit of fiddling

  2. The sensors only report back their serial number and this then becomes part of the data stream on NR so you have to 1) identify sensor by serial number and record that somewhere (i would also suggest putting some electrical/silicon tape on each unit to identify them 2) parse them by Serial number to get the readings from them

Here is snippet of a flow you can use for doing that

[{"id":"4cc4767a.b9df28","type":"mqtt in","z":"8984935e.96be9","name":"Incoming Tank Temperatures","topic":"tele/Tasmota_HTLT_Monitor/SENSOR","qos":"2","datatype":"auto","broker":"8c5be0a1.64904","nl":false,"rap":false,"x":260,"y":100,"wires":[["60b766af.c4e9a8","1be43427.36bd1c"]]},{"id":"60b766af.c4e9a8","type":"json","z":"8984935e.96be9","name":"","property":"payload","action":"","pretty":false,"x":410,"y":300,"wires":[["2b6d65e.88ea79a","b7b667ab.b81648","75d64782.378368","8aff4291.b307e","2818b975.0585c6"]]},{"id":"2b6d65e.88ea79a","type":"debug","z":"8984935e.96be9","name":"json","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":600,"y":360,"wires":[]},{"id":"b7b667ab.b81648","type":"debug","z":"8984935e.96be9","name":"Bottom Tank Sensor 0416220506FF","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[\"DS18B20-1\"].Temperature","targetType":"msg","statusVal":"","statusType":"auto","x":700,"y":400,"wires":[]},{"id":"75d64782.378368","type":"debug","z":"8984935e.96be9","name":"Top Tank Sensor  0416220506FF","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[\"DS18B20-2\"].Temperature","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":440,"wires":[]},{"id":"8aff4291.b307e","type":"debug","z":"8984935e.96be9","name":"Middle Tank Sensor 04162251F3FF","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[\"DS18B20-3\"].Temperature","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":480,"wires":[]},{"id":"2818b975.0585c6","type":"debug","z":"8984935e.96be9","name":"Power in use","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.ENERGY.Power","targetType":"msg","x":620,"y":540,"wires":[]},{"id":"1be43427.36bd1c","type":"debug","z":"8984935e.96be9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":120,"wires":[]},{"id":"8c5be0a1.64904","type":"mqtt-broker","name":"DevVM","broker":"172.16.100.36","port":"1883","clientid":"Dev_VM","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

Craig

Well so far I'm impressed with the ui, the next question is, can it handle pressure transducers!
Obviously I'm getting a head of myself, temps first, control of tennis second, other features planned after stage 1 and 2 are complete and reliable! Lol

Yes I did know 1 wire and a4.7k resistor, I have used a label maker and I have hooked up every ds18b20 I have(20) and labeled them right away so that is not a problem. Thanks for the sample code, I'll take a look at it when I get home.