Digital wifi scale Tasmota (ESP8266)

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
lazaruss72
Posts: 17
Joined: Thursday 14 December 2017 23:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Digital wifi scale Tasmota (ESP8266)

Post by lazaruss72 »

This forum has helped me countless times.
I hope this post will help someone as well.

I'm always looking for something new, especially now in lockdown time. For another project I needed a permanent weight monitor (not for the pounds I gain during Corona :-D ).
I didn't want to set up an extra system for that, so I looked at Domoticz to see if I could do it.

This digital wifi scale is the result:


Digital wifi scale

You need the following things:
- A smal wifi-borad ESP8266 (e.g. D1 Mini NodeMcu mit ESP8266-12F WLAN Module CH340G)
- A Load Cell with HX711 Board (e.g. Weight Sensor Set 1kg - 200kg + HX711 ADC)
- A USB Data Cabel (no charging-cabel)
Costs: ~ 10€ (only)

and a MQTT Broker

i already have a mqtt server in use, because i use it to import other things like my electricity meter, or current corona data to domoticz.

And Domoticz of course

Connect the load cell cables to the HX711 module as follows:
• Red on E+
• Black on E-
• White on A-
• Green on E+

Image

Image

And the amplifier board to the NodeMCU microcontroller.
HX711 amplifier NodeMCU board pin
GND GND
DT D6
SCK D5
VCC 5V

You can also use other ports (e.g D1 % D2)


Thats all

Now it's time to programm this little board.
Don't be affraid, you need no knowledge about Programing or Arduino

There is a great software for IoT to make such thing smart. And it's very easy:
The Software is called Tasmota

Downlaod the flashing-tool Tasmotizer: https://github.com/tasmota/tasmotizer
it brings everything you need

Connect the ESP8266 to your PC
Image

Start Tasmotizer:
Image

Select the COM Port
Select Image (Release --> tasmota-sensors)
Check Self-resetting device
-->Click Tasmotize!

After a few seconds:
Image

Send Config:
Image

Activate wifi and mqtt and fill in your Data

Done:
Image

After a few seconds , click on Get IP to get the IP-Address:
Image

Go to the device website and toggle on:
Image

Configure Module:
Image

Choose Generic (18) and save
Image

Go to configure module again and set up your input PINs:
In my case D6 (GPIO12) = HX711 DAT
And D12 (GPIO14) = HX711 SCK
Image
Image

Click Save

Now you see HX711 Weight in the Main Menu with some value:
Image

We have to configure and calibrate the settings:

Calibrate:
you need a known weight which fits to your scale. maybe a small water bottle or something similar
In my case i use a little bottle with 300gr

Click Console and type Sensor34 2 300 and follow the instructions
(2 = Calibrate)
(300 = 300 weight)

Maybe you need more then 1 try :-)
Image

Set up the resulution
Weightres 3
(for 3 decimal points)
Image

Now you get your weight:
Image


Domoticz:

Create a virtuell sensor (Typ: scale)
Image

Get the IDX from the Sensor:
Image


and now it is time to get the data from the scale in Domoticz.

Go again to the Tasmota Console:
Image
Image

And create a Rule to send the value via mqtt to domoticz standard topic

Rule1 on tele-HX711#Weight do publish domoticz/in {"idx":664,"nvalue":0,"svalue":"%value%"} endon

Use the idx from your fresh created virtual sensor
I think the standard update-interval is 20 sec. You can configure it with the command teleperiod x (x=seconds you want)

After a few seconds you get the value in your Domoticz!
Image


It's also possible to use a generic custom sensor. I think this one is better when you need a protocol


Attention:
If you power off the ESP8266, you have to calibrate the loadcell at the next start again

let me know what you think about it

best regards
lazarus
Arniatek
Posts: 2
Joined: Tuesday 20 July 2021 16:40
Target OS: Windows
Domoticz version:
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by Arniatek »

Ciao volevo chiedere una consulenza, ovvero questa soluzione qui funziona solo con wify locale, ovvero posso vedere i dati da remoto su un'altra wify?
E' possibile trasmettere i dati via MQTT ad un portale diverso .... io non riesco, ovvero ho creato dei feed su io.adafruit.com ma la trasmissione mi da errori
Arniatek
Posts: 2
Joined: Tuesday 20 July 2021 16:40
Target OS: Windows
Domoticz version:
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by Arniatek »

e' possibile poi impostare un fattore di calibrazione fisso in modo tale da non ripetere la calibrazione ogni volta?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by waltervl »

Sorry we only use English on this forum...
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by ssk17051980 »

is there any chance of not needing calibration after an accidental restart? (power failure, etc.)
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by ssk17051980 »

any news about the necesary of calibration after power lose ?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by waltervl »

If it needs to be done on the Tasmota side please check Tasmota support/forum. Not a lot of chance you will find the answer in Domoticz.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by waltervl »

Well helping you a little bit: Play with Sensor34 command. Option 7 will be a good candidate....
https://tasmota.github.io/docs/Commands/#sensors
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
schouw
Posts: 1
Joined: Thursday 26 October 2023 15:12
Target OS: Windows
Domoticz version:
Contact:

Re: Digital wifi scale Tasmota (ESP8266)

Post by schouw »

Don't you have to have an adress to publish? I have used your description and your rule (Rule1 on tele-HX711#Weight do publish domoticz/in {"idx":664,"nvalue":0,"svalue":"%value%"} endon) with my own idx but I'm not receiving any weight to my device.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests