Added define to adjust calibration parametrs for bl09xx
Description:
Related issue (if applicable): fixes #<Tasmota issue number goes here>
Checklist:
- [x] The pull request is done against the latest development branch
- [x] Only relevant files were touched
- [x] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.7
- [x] The code change is tested and works with Tasmota core ESP32 V.3.0.4
- [x] I accept the CLA.
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass
Why?
Why?
I design devices that use the BL0940 chip. When monitoring consumption with a current transformer or current shunt, different calibration values need to be used in the xnrg_14_bl09xx.ino file. This pull request allows entering calibration values in the user_config_override.h file, which is much more convenient as it eliminates the need to fork the Tasmota repository.
A result of changing the default calibration offsets is that no pre-compiled Tasmota OTA binary can be used.
Can't you just use the current offsets and then configure the correct VoltageSet, CurrentSet and PowerSet? What's the issue here other than one time conveniently no calibration needed but scewing up any future updates?
A result of changing the default calibration offsets is that no pre-compiled Tasmota OTA binary can be used.
I don't understand so deeply the nuances of Tasmoto firmware, but similarly the possibility to specify calibration parameters in ade7880 module is already involved. Also BL09XX_WRITE_COMMAND and BL09XX_READ_COMMAND differ from the operating values specified in BL0940 datasheet. I just didn't want to create a repository fork for my devices just because of this. Thanks.
@arendst I don't see that PR breaking anything and changing any default values used in pre-built Tasmota It only allows default values to be overriden in 'user_config_override.h' for a custom build which makes sense for someone manufacturing his own device in reliable way that makes manual calibration not needed.