Skip to content
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

Adaptation of a new socket (Girier JR-ZPM01) #2545

Open
GitJa21 opened this issue Oct 24, 2022 · 1 comment
Open

Adaptation of a new socket (Girier JR-ZPM01) #2545

GitJa21 opened this issue Oct 24, 2022 · 1 comment
Labels

Comments

@GitJa21
Copy link

GitJa21 commented Oct 24, 2022

Device

Girier JR-ZPM01

Version

1.14

Question

Hello!
Once I bought a Girier JR-ZPM01 smart socket.
It contained an unsupported and non-flashable module from TUYA CB2S.
After doing some research, I came to the conclusion that the module can be replaced with ESP-01M with espurna from SonOff Pow R1.
In general, it worked great. The only thing that did not work is the measurement of power consumption.
Surely, the values of the resistors did not match.
Is there some way to tune in measurement? The measuring chip is BL0937.

Table of matching pins:
Pins
Approximate scheme:
MySocket
Old WiFi module:
OldModule (CB2S)
Web interface (400W heater)
WebInterface
Appearance of the socket (With my mod):
1
2
3

P.S.
Due to some bugs in version 1.15, I'm use version 1.14
I wanted to download and edit the source code by myself but nothing succeeded. There are a lot of compilation errors due to the lack and mismatch of libraries. :(

@mcspr
Copy link
Collaborator

mcspr commented Oct 24, 2022

Build options are prefixed with HLW8012_..., see sensor .h; both resistance it ratio should be there. hardware .h includes overrides, so you could check out the values used on Blitzwolf devices.
Usually, default resistance is used to generate the ratio value which we later adjust. I think WebUI has 'expected' current / voltage / power form somewhere on the SENSOR page?

(just note that 1.14.1 settings may cause everything to read zeroes if ratios accidentally switch to 0 when settings reload)

For older version specific settings are - pwrRatioC (current), pwrRatioV (voltage) and pwrRatioP (power) control ratio. A more recent version switches to currRatio0, voltRatio0 and pwrPRatio0.

I wanted to download and edit the source code by myself but nothing succeeded. There are a lot of compilation errors due to the lack and mismatch of libraries.

If you are building with PlatformIO, there should be no library mismatch. Also note you don't have to get VSCode and / or extension, just have a Python installed and do a pip install platformio. After that, just use pio / platformio cli command.

Arduino IDE is technically supported, but it may break from time to time since it does not have a way to store library info for IDE to use besides storing .zip as-is in the repo
(which sort-of works for PIO side, with yet another set of quirks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants