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
adding CSL (aplic WDP 303075) Socket #3991
Comments
Hi, The HLW8012 is used in the Sonoff POW, not the POW R2. So it might be possible to create a new template based on the original POW as it uses the HLW8012 which is PWM based. The POW R2 uses a different chip.` |
Please, Try first to adapt the sonoff pow template (sonoff_template.h file) to your device to test the measurements. |
Ok, thanks I'm gonna try to adapt the sonoff pow to the device. Thanks for the hints. |
So were you talking about just to add the template? I already did that locally. But the values I get from the HLW are just not plausible... |
For testing proposes, will be better just to change the GPIO definition of the sonoff pow template to match your device. |
try in the console |
OH. I think I found the issue. It seems like Voltage and current are just swapped! I dont know exactly what tasmota is calculating or how the values are proccessed, but it seems like it just shows some weird voltage when nothing is connected / relais is open, because of the wrong signals it gets from the HLW when expecting the volatage signals... I just have to figure out how do I swap the values of GPIO_HLW_SEL? so it gets the right values when expecting voltage / current. |
To test it, I just changed HLW_SEL_VOLTAGE 1 to HLW_SEL_VOLTAGE 0 in xnrg_01_hlw8012.ino, and checked that firmware. It now shows the correct values. I might need some help to change the code properly to fit the conventions.
Might check if that works, but also might need someone to check where I might have to change other stuff in case those values are used somewhere else... |
What happens if you just swap the pins on the template? |
Nah, the pins on the template are for the two datapins of the HLW, so either for Power measurement (CF) or for voltage/current (CF1). So swapping CF and CF1 would just result in power data going to be interpreted as voltage. |
With the info here I will make changes and release tomorrow. Thx flr testing. |
Oh, I was just trying to create a pull request, but I still fight with git and the pull request feature 😕 |
Do you have photos from the Smart plug where the PCB and the AC part can be seen? |
No, I dont have any pics of that part atm. |
Added a wiki page |
Closing issue as PR #3996 was merged and now it is part of Tasmota. Thanks a lot for all the contributions. |
The fix is a bit refurbished to accommodate future changes. Could you be so kind and test if it still does what it should do and report back please. |
I tested it and it works as expected. No problems with that build. |
Hello, I received a CSL wifi smart plug https://www.amazon.de/dp/B07CNWVNJ2, which is based on a ESP8266.
It is pretty similar to the sonoff devices.
I already made some pictures of the pins and successfully flashed tasmota on that socket. Via the 'generic' Module I could already check the relais, button and LED functions.
I also added the module locally to tasmota and flashed the firmware update, and almost everything works as expected, but not the build in HLW8012, which is used to measure current, voltage and power.
The device reads some values, but they are totally implausible. I tried to calibrate the device as described in https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Pow-and-Pow-R2 but the values are still not correct.
I add some pictures for the pins of the ESP8266 Module, and can describe the proccess of flashing the device also might create a PR, but the software part isn't done yet, at least if the power monitor should also work (everything else works as the LED, the Button and toggeling the Relais).
Since I am totally new to tasmota and don't know the full source code, I don't know where to find stuff about the HLW8012, which if I am informed correctly is also used in the sonoff POW 2. I am reading some information about the HLW8012 rn, and might measure values and stuff as far as possible, but might need some hints where to look for calculation part in the software.
I also add a screenshot of 'generic' module configuration (which doesnt support HLW pins), for those who just want to use the relais, button and LED.
PCB-Pins
'generic'-Module config
The text was updated successfully, but these errors were encountered: