arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.05k stars 4.78k forks source link

Sensor34 7 not behaving as expected #6115

Closed ceesnz closed 5 years ago

ceesnz commented 5 years ago
### BUG DESCRIPTION My first issue report so please be gentle. Sensor34 7 expected behaviour, as far as I can tell, is to store the current weight and upon reboot (after power loss for example) to read this stored weight from memory and set this as the current weight. Instead Sensor34 7 results in doubling of the current weight and upon reboot the current weight is reset to zero. ### REQUESTED INFORMATION _Make sure these boxes are checked before submitting your issue. Thank you_ **FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED** - [x ] Read the [Contributing Guide and Policy](https://github.com/arendst/Sonoff-Tasmota/blob/development/CONTRIBUTING.md) and [the Code of Conduct](https://github.com/arendst/Sonoff-Tasmota/blob/development/CODE_OF_CONDUCT.md) - [x ] Searched the problem in issues (https://github.com/arendst/Sonoff-Tasmota/issues) - [x ] Searched the problem in the wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting) - [x ] Searched the problem in the forum (https://groups.google.com/d/forum/sonoffusers) - [x ] Searched the problem in the chat (https://discord.gg/Ks2Kzd4) - [x ] Device used (i.e. Sonoff Basic) : Sonoff Basic - [x ] Tasmota binary firmware version number used : 6.6.0 pre-compiled / (pre-compiled or self-compiled ?) - [na ] Development IDE - Compiler / Upload tools used : ____ / ____ - [na] Provide the output of command ``status 0`` : ``` STATUS 0 OUTPUT HERE: ``` - [ ] Provide the output of console when you experience your issue if apply : _(Please use_ ``weblog 4`` _for more debug information)_ ``` CONSOLE OUTPUT HERE: ``` ### TO REPRODUCE Calibrate scale as usual Sensor34 2 Place weight on scale Issue Sensor34 7 -> weight displayed doubles. It should stay the same reboot device -> weight is reset to zero it should however read the stored weight and display this. ### EXPECTED BEHAVIOUR See above. ### SCREENSHOTS _If applicable, add screenshots to help explain your problem._ ### ADDITIONAL CONTEXT It is my understanding that this feature was introduced for those situations where constant monitoring of the weight is desired such as gas bottle weight or beehive weight. Sensor34 7, in my understanding, designed to deal with power failure etc by usinga rule to store weight on every update. There is I think a much simpler way to deal with this. I'm not yet familiar with the Tasmota code, just a user at the moment but from a quick glance I think this might be doable. When constant monitoring of the weight of an object is desirable than after proper calibration (data is stored permanently) upon a reboot boot the scale should not be reset but should just continue to measure and report based on the calibration values. In other words do not tare (reset to zero) the scale. Only tare the scale when required by issuing sensor34 1. As an aside I noticed that tasmota does not allow for negative weights. Negative weights are however perfectly valid. E.g. with a gas bottle on the scale a sensor34 1 command (effectively a tare) would reset scale to zero. Any subsequent weight loss by gas consumption would be recorded as negative weight and is in some circumstances the desirable behaviour. **(Please, remember to close the issue when the problem has been addressed)**
arendst commented 5 years ago

I have a look at it.

Resetting is currently needed to have the loadcell(s) calibrated due to drift and temperature. Doing it this way keeps code as simple as possible.

Regarding the negative values, that's a choice I made. It makes code easier and a simple solution is to do the reset when the scale is empty. Then add the gas bottle and enjoy the decrease if gas is flowing out.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.