Hello
I will also write some of my experiences after switching from LSPA9 Tuya software to BK7231N.
After the trial period on IoT Tuya expired, the integration with HA disappeared.
By Local Tuya I was not satisfied with the integration.
Now to the seat.
I had already dismantled the socket once, so after soldering the wires to the RS232, the programming went quite quickly.
Visually, the configuration is similar to the Tasmota.
First step - switching on the measurement:
issuing the "StartDriver Bl0942" command in "Change startup command text" - after restarting, the measurements will start automatically.
I also configured the Control Pins
I calibrated the socket by issuing commands in "Execute Custom Command":
- "VoltageSet 228"
- "PowerSet 100"
- "CurrentSet 0.42"
Please note that I calibrated with a 100W bulb (everyone enters their data)
I will also mention that for BL0937 the initial procedure is different - for BL0937 you need to select the BL0937 pins (CF, CF1 and SEL) and restart the device and then calibrate.
If someone enters it wrong, you can always clear the configuration in "Execute Custom Command" enter the "clearConfig" command.
After setting up the MQTT setup in HA, I have the measurements:
- electricity
- voltages
- power
- total record of kWh consumption.
Then, after being informed that the software supports NTP, I decided to enable the service.
Issuing the "StartDriver NTP" command in "Change startup command text" - after restart, time synchronization will start automatically.
You can enter your server "ntp_setServer 217.147.223.78"
Information about synchronization as well as other events can be viewed in the logs after going to "Launch Web Application" after issuing the command
Info:NTP:Server=217.147.223.78, Time offset=0
Info:NTP:Seconds since Jan 1 1900 = 3878791803
Info:NTP:Unix time : 1669803003
Info:NTP:Local Time : 2022/11/30 10:10:03
(the correct window is shown on Microsoft Edge and Chrome (Firefox has a small window - some scaling bug)
After adding the NTP server in autostart, the command "StartDriver Bl0942" was overwritten - no measurements.
Therefore, it is important to enter the command "backlog startDriver NTP; startDriver BL0942" in "Change startup command text"
After restart we have energy measurement and NTP synchronization running at the same time.
A big surprise for me was that after starting the time synchronization, new registers appeared in the MQTT logs:
- energy register of today's consumption.
- energy register of yesterday's consumption
- date of resetting energy registers
Integration with HA went smoothly after entering the appropriate configuration in configruratio.yaml, I only noticed that it refreshes the current value for quite a long time.
In HA, you only need to scale Wh to kWh.
Many thanks to the authors of the software, especially to p.kaczmarek2 for providing all the information while learning about the software.
Regards