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

Power/Ampere/Current Support #5

Open
loglux opened this issue Jan 21, 2019 · 7 comments
Open

Power/Ampere/Current Support #5

loglux opened this issue Jan 21, 2019 · 7 comments

Comments

@loglux
Copy link

loglux commented Jan 21, 2019

I have a tuya smart plug with energy meter.
https://www.amazon.co.uk/gp/product/B07K24QZHN/ref=ppx_yo_dt_b_asin_title_o00__o00_s00?ie=UTF8&psc=1

I managed to get work this plugin in Domoticz but it can only turn off and on and doesn't provide information from the meter.

The get_dps.py request returns info from the meter, I guess:

`domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'1': False, '5': 0, '2': 0, '6': 2385, '4': 0}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$`

@tixi
Copy link
Owner

tixi commented Jan 30, 2019

When the plug is on should be more useful.

@loglux
Copy link
Author

loglux commented Feb 1, 2019

I'll try to plug it again under the real load and see again what happens.

@loglux
Copy link
Author

loglux commented Feb 1, 2019

Just a laptop

domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'5': 0, '1': False, '2': 0, '4': 0, '6': 2403}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'devId': '11444708600194c04232', 'dps': {'1': True, '5': 224, '6': 2400, '2': 0, '4': 160}}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'devId': '11444708600194c04232', 'dps': {'1': True, '6': 2400, '4': 181, '2': 0, '5': 267}}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'2': 0, '1': True, '5': 236, '4': 169, '6': 2400}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$

@loglux
Copy link
Author

loglux commented Feb 1, 2019

about 2KW Oil Radiator:

domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'devId': '11444708600194c04232', 'dps': {'4': 8739, '6': 2373, '1': True, '5': 20433, '2': 0}}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'6': 2373, '5': 20433, '2': 0, '1': True, '4': 8739}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'6': 2373, '4': 8739, '2': 0, '5': 20433, '1': True}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'1': True, '6': 2373, '5': 20433, '4': 8739, '2': 0}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'1': True, '5': 20433, '2': 0, '6': 2373, '4': 8739}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$ sudo python3 get_dps.py 192.168.10.172 11444708600194c04232

Plug State Information:
{'dps': {'1': True, '2': 0, '4': 8739, '5': 20433, '6': 2373}, 'devId': '11444708600194c04232'}

Plug DPS List:
1
domoticz@housespririt:~/domoticz/plugins/Domoticz-Tuya-SmartPlug-Plugin$

@loglux
Copy link
Author

loglux commented Feb 1, 2019

So,
'6' is Voltage - 2385
'5' is Power - 20334
'4' is obviously Current - 8686

Of course, we must take into considiration that there is must be a coma, which is missing here.

20334 (Voltage) / 2385 (Power) = 8.525786163522013 (Current)
20334 / 8686 = 2.341008519456597 (Voltage)

2385 * 8686 = 20716110 (Power)

@dorenberg
Copy link

I have a lonsonho plug where DPS is:

104 = current in mA
105 = power in W (has to be divided by 10)
106 = voltage (has to be divided by 10)

I don;t know how to check for the cumulative usage of the plug in kWh for the day and in total. So maybe good to make the input variable.

@dorenberg
Copy link

historical information is also found in the json output. 0.02 is in kWh of today. 0.43 is total. Can we use this too for domoticz?

{
"result": {
"thisDay": "0.02",
"sum": "0.43",
"years": {
"2019": {
"02": "0.43"
}
}
},
"t": 1549792047291,
"success": true,
"status": "ok"
}

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

No branches or pull requests

3 participants