Xenomes / Domoticz-TinyTUYA-Plugin

A bridge between Tinytuya and Domoticz
12 stars 7 forks source link

Add PJ2101A 1P WiFi Smart Meter (If possible) #58

Closed Nonoose closed 1 year ago

Nonoose commented 1 year ago

Hello, I've read the dump, and I think it will be very difficult whith values it sends, but if it's possible, can you add the "PJ2101A 1P WiFi Smart Meter", an Amperometric bidirectionnal sensor. Here is the dump : dump.json.txt Thanks a lot for all your work and your support, Regards, Nonoose

Xenomes commented 1 year ago

Hi Thanks for the Dump. Your device is added to the Develop.

cd ~/domoticz/plugins/Domoticz-TinyTUYA-Plugin
git pull
git checkout Develop
sudo systemctl restart domoticz.service

To revert to the Master, change Develop to Master

Nonoose commented 1 year ago

It works like a charm, thanks a lot from France ;)

Xenomes commented 1 year ago

Perfect! I will add it to the master.

Nonoose commented 1 year ago

Sorry to reopen the case, I don't know if it's in your hands, but when I send electricity to the Grid, it's shown as electricity consumed from the grid. On the app, I see the correct current way by looking at the last digit of the live current value (1 for production, 0 for consumption) Is there a way to program this on the plugin ?

Xenomes commented 1 year ago

Can you send a visual of what you see and create a new 'dump.json' when it's producing? I need only the value of phase_a.

    {
      "code": "phase_a",
      "value": "CNwAIbYAB3k="
    }
Nonoose commented 1 year ago

Hello, Sorry for my late answer, it was not very sunny last days :) Here is the value when I produce :

 {
      "code": "phase_a",
      "value": "CQ0AA10AAHM="
    }

Hope it will help you

Xenomes commented 1 year ago

No problem, thanks for the value.

Nonoose commented 1 year ago

Hello, I've made 2 printscreens of the Tuya app : Screenshot_20230923_163630_Tuya Smart Screenshot_20230927_145128_Tuya Smart The one where "Current" ends by 1 is when I produce (last digit is always 1) The one where it ends by 0 is when I consume (always ends with 0) Hope it may help you. Regards

Xenomes commented 1 year ago

That is a strange way of showing a negative value. I will try to make that for this device only.

Xenomes commented 1 year ago

Can you checkout the develop version.

Nonoose commented 1 year ago

Done, I need to wait until the next day for sun, but I think it's inverted, as it shows me now, when I'm consuming power (0 at the end) : image Tell me if I can do anything to help you, Regards

Xenomes commented 1 year ago

Oeps, You are correct i turn it around in the code. You can pull a new one.

Xenomes commented 1 year ago

Added to the Master!

Nonoose commented 1 year ago

Everything is fine, thanks for everything