New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HX711 store sensor value in eeprom for power down and restore value on boot #5367
Comments
Hi, This behaviour can be easily achieved using rules. After you power your device, it connects to wifi, to mqtt and then it sends the weight in kg in the tele message, right? In that case (using latest Tasmota version v6.4.1.19) you can go to the console and type:
Please, tell us if this solves your issue. In that case, remember to close it. Thanks. |
I'm not sure if it's working correctly.
|
Are you using latest Tasmota version v6.4.1.19? |
I just update but now it get a fatal error and boot loop |
So, something went wrong in your update. |
flash erased and uploaded with precompiled bin. When I enable the rule I get a fatal error and boot loop |
it has something to do with the *1000 - If I remove that from the rule it works. I think the problem is that the actual scale resets to 0 on a reset. you can see that right after the item weight sets to 4 the next tele shows it at 0. `Rule1 on tele-HX711#weight do mem1 %value% endon on system#boot do sensor34 6 %mem1% endon 12:03:49 MQT: stat/test1/RESULT = {"Sensor34":{"WeightRef":3628,"WeightCal":25,"WeightMax":20000,"WeightItem":4.0}} 12:04:57 MQT: tele/test1/SENSOR = {"Time":"2019-02-28T12:04:57","HX711":{"Weight":0}}` |
Ok, try the following please:
|
The rule works and the weight gets assigned but the HX711 sensor reads zero when it powers back on, with the weight still on the scale. somehow it needs to take the remembered value and set it back on "HX711":{"Weight":XX}}
|
Ok, that is because Please try the following:
|
on reboot the weight from the HX711 shows 0. Now that I'm thinking about it. Saving the known value of weight won't matter. It's going to turn on send a weight and turn off. While it's off the gas will be used and the tank will be lighter that its previously known weight. So if its turning on after the gas was used its setting its weight back to the previous know weight, which means its always going to think its 4kg. Does this need to be set up in a different way? is there a way for the HX711 to turn on and know there is 4kg on it based on the calibrated numbers? or is the only way this works is when the sensor turns on there has to be no weight on it, and then weight placed on it, to correctly identify the weight. or the other option is that it needs to be powered on during the entire cooking process, to know the weight change? |
Ups. You are totally right. So, that means that as the HX711 requires to measure a differential weight, seems that is not possible to be used as you want. If you see, any weight meter need to start without anything on the measuring plate and then you can put things to measure. So, you are right and can't be used that way. Sorry. |
Thank you for your help! |
@ascillato what if i were to keep the HX711 powered on all the time off the vcc and ground terminals of that chip and have the D1 mini power down and up? |
It is the same. Sorry. |
just for the record: that it does not work is a software issue, not
hardware, means it is solvable: dont calibrate at startup, but on request
(button press, mqtt message, whatever) and permanently store the
calibration value for later use (in flash or retained mqtt).
--
iphone so i typo
|
If you have a workaround to make it doable, please explain |
@joba-1 If I don't calibrate it then the weight is incorrect? |
I don't have a readymade workaround and I did not look at the code (changes
could be needed in tasmota or the driver), but the sensor is just a bunch
of cleverly arranged variable resistors (wheatstone bridge) and an ad
converter measuring the varying voltage differences over these resistors.
There is nothing that varys between power cycles. Calibration is usually
done to accommodate for varying weight of your setup (scale + container).
But this does not change in your case. So calibrate once with an empty
container should be enough.
Ok, it will drift a bit depending on ambient temperature and maybe a bit
long term but that should not be too much to make it impossible to detect
an empty container. Just repeat the calibration at times and see how much
the values change with it.
Am Do., 28. Feb. 2019 um 23:27 Uhr schrieb WilldabeastHA <
notifications@github.com>:
… @joba-1 <https://github.com/joba-1> If I don't calibrate it then the
weight is incorrect?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5367 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ae8n-nAbv_P7BWBO4-GE0A6Ijz4eRcRYks5vSFfbgaJpZM4bXAJg>
.
|
@joba-1 how would I go about changing the tasmota code to accommodate this? |
Have you tried this (from the sensor code)? To me that sounds like it would already do what you want.
|
@joba-1 yes I have used the settings and calibration you have shared above. I can get the scale to function properly while its powered on. The issue is when the power is cut or the device restarts with the weight on the scale, it starts back at 0. It doesn't remember that there was a weight on the scale when it boots up. |
It seems to me that the Sensor34 6 command is not functioning at all, or is not functioning as expected. If I issue a sensor34 6 xxxx command, then the value red by the sensor never changes.
|
The command Sensor34 7 won‘t work. Everytime i Power off an on my nodeMCU, the weight stays on 0 Even the weight is on it |
Storing the sensor value is not the correct solution, since the weight may have changed while device is off. On calibration the offset shuld be saved and restored on power on. |
I would like tasmota to store a value from the HX711 senor, power down the D1 Mini, then recall that value as it boots back up.
Currently when the power shuts off the sensor/tasmota forgets how much is on the scale, when it reboots it starts at zero, with the original weight on it.
I'm using this to weigh my propane tank for my gas grill. It's battery powered so when I push a button, I want it to turn on and send the weight value, then turn off. Because this is a remote location there is no option to have this plugged into the wall.
Thank you!
The text was updated successfully, but these errors were encountered: