AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
204 stars 52 forks source link

Teckin SP22 Outlet doesn't show current power #168

Open marceldenzer opened 4 years ago

marceldenzer commented 4 years ago

Hello,

i'm using the Teckin SP22 with this Plugin. I got the key and id with your instructions, but i used the "Ucomen Home App". The outlets show the current voltage and power consumption in the Ucomen App, but there is no value in the signature, but in the scheme.

scheme:

schema: '[{"mode":"rw","code":"switch_1","name":"\\u5f00\\u51731","property":{"type":"bool"},"iconname":"icon-dp_power2","id":1,"type":"obj","desc":""},
{"mode":"rw","code":"countdown_1","name":"\\u5f00\\u51731\\u5012\\u8ba1\\u65f6","property":{"unit":"s","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_time2","id":9,"type":"obj","desc":""},
{"mode":"rw","code":"add_ele","name":"\\u589e\\u52a0\\u7535\\u91cf","property":{"unit":"","min":0,"max":50000,"scale":3,"step":100,"type":"value"},"iconname":"icon-battery","id":17,"type":"obj","desc":""},
{"mode":"ro","code":"cur_current","name":"\\u5f53\\u524d\\u7535\\u6d41","property":{"unit":"mA","min":0,"max":30000,"scale":0,"step":1,"type":"value"},"iconname":"icon-Ele","id":18,"type":"obj","desc":""},
{"mode":"ro","code":"cur_power","name":"\\u5f53\\u524d\\u529f\\u7387","property":{"unit":"W","min":0,"max":50000,"scale":1,"step":1,"type":"value"},"iconname":"icon-dp_tool","id":19,"type":"obj","desc":""},
{"mode":"ro","code":"cur_voltage","name":"\\u5f53\\u524d\\u7535\\u538b","property":{"unit":"V","min":0,"max":5000,"scale":1,"step":1,"type":"value"},"iconname":"icon-a_function_turbo","id":20,"type":"obj","desc":""},
{"mode":"ro","code":"test_bit","name":"\\u4ea7\\u6d4b\\u7ed3\\u679c\\u4f4d","property":{"unit":"","min":0,"max":5,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_direction","id":21,"type":"obj","desc":""},
{"mode":"ro","code":"voltage_coe","name":"\\u7535\\u538b\\u6821\\u51c6\\u7cfb\\u6570","property":{"unit":"","min":0,"max":1000000,"scale":0,"step":1,"type":"value"},"iconname":"icon-gaodiyin","id":22,"type":"obj","desc":""},
{"mode":"ro","code":"electric_coe","name":"\\u7535\\u6d41\\u6821\\u51c6\\u7cfb\\u6570","property":{"unit":"","min":0,"max":1000000,"scale":0,"step":1,"type":"value"},"iconname":"icon-gaodiyin","id":23,"type":"obj","desc":""},
{"mode":"ro","code":"power_coe","name":"\\u529f\\u7387\\u6821\\u51c6\\u7cfb\\u6570","property":{"unit":"","min":0,"max":1000000,"scale":0,"step":1,"type":"value"},"iconname":"icon-gaodiyin","id":24,"type":"obj","desc":""},
{"mode":"ro","code":"electricity_coe","name":"\\u7535\\u91cf\\u6821\\u51c6\\u7cfb\\u6570","property":{"unit":"","min":0,"max":1000000,"scale":0,"step":1,"type":"value"},"iconname":"icon-gaodiyin","id":25,"type":"obj","desc":""},
{"mode":"ro","code":"fault","scope":"fault","name":"\\u6545\\u969c\\u544a\\u8b66","property":{"label":["ov_cr"],"type":"bitmap","maxlen":1},"id":26,"type":"obj","desc":"ov_cr\\uff1a\\u8fc7\\u6d41\\u4fdd\\u62a4"}]',
   extras: '[{"id":1,"inputStyle":"","inputType":" "},{"id":9,"inputStyle":"","inputType":" "},{"id":17,"inputStyle":"","inputType":" "}]',

My current config for the outlet:

"name": "Fernsehbeleuchtung", 
"type": "Outlet", 
"manufacturer": "Teckin", 
"model": "Wohnzimmer",
"id": "***", 
"key": "***",
"ip": "192.168.178.29", 
"wattsId": 19

I use the Eve App to monitor the power consumption.

I tested it with the SimpleLamp, but just got {"1":true}

Is this a common problem?

mrmaximas commented 4 years ago

something went wrong. i'm using same config and always ok "name": "Yandex", "type": "Outlet", "manufacturer": "Yandex", "model": "Yandex Outlet", "id": "xx", "key": "yy", "voltsId": 20, "ampsId": 18, "wattsId": 19, "voltsDivisor": 10, "ampsDivisor": 1000, "wattsDivisor": 10, "dpPower": 1 D30AA0DD-566A-4E36-8CB8-880875D53EE2_1_105_c

adnanshah87 commented 4 years ago

Hi, not sure how you managed to get ID and device key, however whener i try the "handshake" with my SP22 it says the following:

Intercepted certificate request Error: ERR_SSL_WRONG_VERSION_NUMBER [Error: 3069503952:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355: ] { library: 'SSL routines', function: 'ssl3_get_record', reason: 'wrong version number', code: 'ERR_SSL_WRONG_VERSION_NUMBER'

would you know why?

marceldenzer commented 4 years ago

Hi @adnanshah87 ,

did you try it with the "Ucomen"-App?

Btw im using this plugin now: https://github.com/iRayanKhan/homebridge-tuya-platform

The homebridge-tuya-lan stopped working for me...

adnanshah87 commented 4 years ago

Hi Marcel, thank you for your fast reponse. With the Ucomen App it indeed has worked - thank you very much!! :)