AMoo-Miki / homebridge-tuya-lan

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

Convector not working - add new device #62

Open sebcastrov opened 5 years ago

sebcastrov commented 5 years ago

Hi!

I have a convector/heater from a local brand, betterlife, this is the device https://www.betterlife.cl/product/estufa-electrica-infrarroja-con-wi-fi-bl2000w/

I managed to get the ID and Key with Charles and now have the config set on my config panel:

{ "platform": "TuyaLan", "devices": [ { "name": "Estufa", "type": "Convector", "manufacturer": "Betterlife", "model": "BL2000W", "id": "XXXXXXXXXXX", "key": "YYYYYYYYYYY", "cmdLow": "Low", "cmdHigh": "High", "minTemperature": 20, "maxTemperature": 30, "noChildLock": false } ] },

Problem is that when appears in home app it keeps in updating or can't connect, from terminal I can see this:

[6/19/2019, 2:06:08 PM] [TuyaLan] Ready to handle Estufa with signature {"1":false,"2":28,"4":"1","6":false,"11":0,"101":0}

Any ideas of what can be? Thanks!

AMoo-Miki commented 5 years ago

Can you post some more of the log, maybe grep by Tuya to see all the logs from this plugin.

sebcastrov commented 5 years ago

The status is this: can't make it on or off and once powered on any function is working,

this is the new signature that I get:

[9/6/2019, 4:27:45 AM] [TuyaLan] Ready to handle Estufa with signature {"1":false,"2":30,"4":"1","6":false,"11":0,"101":0} HAP Warning: Characteristic 00000012-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 00000036-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 000000A7-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 00000029-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway.

also I got the:

[TuyaAccessory] Odd message from Estufa with command 8: { cmd: 8, data: 'J~æ¾Zø\u0006ah§¸þ\u001bo\u001aeV+»®:ÀÊYôÎùµb7¶Î=×j~\u0012¦\u0005\u0002w1\u001c;Í\u0010´)ÆßO\#¼í+0®éG¯ð:\u001c' }

AMoo-Miki commented 5 years ago

There are two problems that I see:

  1. The HAP complaints indicate an outdated HAP which could be an indicator of an outdated Homebridge. Do you know what version of Homebridge you are running?
  2. The "Odd message" is the main problem preventing you from using your device. In non-3.3 devices, this indicates a wrong key. Follow the new Setup Instructions to get the key again. I have heard comments about some devices changing keys when they are reset, sent bad data, or change WiFi.

Either way, please update to the latest rc release to benefit from better log messages which will help us figure out what the root cause might be. Get it using npm i -g homebridge-tuya-lan@rc.

sebcastrov commented 5 years ago

For the point 1 I have I think the latest homebridge version 0.4.50, regarding point 2 this is the log:

[9/7/2019, 10:16:24 PM] [TuyaLan] Discovered Estufa (XXXX) [TuyaAccessory] Discovery ended. [9/7/2019, 10:16:24 PM] [TuyaLan] Connected to Estufa [9/7/2019, 10:16:24 PM] [TuyaLan] Ready to handle Estufa with signature {"1":false,"2":30,"4":"1","6":false,"11":0,"101":0} HAP Warning: Characteristic 00000012-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 00000036-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 000000A7-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway. HAP Warning: Characteristic 00000029-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway.

When I do any action (press power on, set temperature in24, then 30, then turn off) in the home app this is why I get:

[TuyaAccessory] Sending Estufa {"7":true} [TuyaAccessory] Sending Estufa {"7":true} [TuyaAccessory] Sending Estufa {"2":24} [TuyaAccessory] Sending Estufa {"2":30} [TuyaAccessory] Sending Estufa {"7":false}

none of the actions were performed, Ill check later tonight the key capture again and check back

sebcastrov commented 5 years ago

so update: it effectively changed the key, so looked again and now works, it didn't power on but after add "dpActive": 1, it works, the only thing that is not working is changing the mode between low, high and a eco mode that has.

Also have to think any alternative to merge with a thermometer to get the temperature of the device and not showed as 0,0 in home app, beside that two things works flawlessly.

thanks!

AMoo-Miki commented 5 years ago

First of all, I want to apologize; I confused you for someone else and didn't pay attention to a few details that you had already provided.

Your signature indicates that:

  1. 1 which I believe is power
  2. 2 the desired temperature
  3. The device doesn't report the current temperature
  4. I am not sure what 4, 6, 11, or 101 are.

Convector is a much more complex device. Yours would be great with SimpleHeater. Please use this configuration, substituting in your id and key.

{
    "name": "Estufa",
    "type": "SimpleHeater",
    "manufacturer": "Betterlife",
    "model": "BL2000W",
    "id": "*************",
    "key": "***********",
    "dpCurrentTemperature": 2,
    "minTemperature": 20,
    "maxTemperature": 30
}

Let me know how it goes.

sebcastrov commented 5 years ago

Works perfect! post you the new log:

9/8/2019, 1:16:21 AM] [TuyaLan] Connected to Estufa [9/8/2019, 1:16:21 AM] [TuyaLan] Ready to handle Estufa with signature {"1":false,"2":26,"4":"1","6":false,"11":0,"101":0} HAP Warning: Characteristic 00000012-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 000000BC-0000-1000-8000-0026BB765291. Adding anyway.

then at turn on and change temperature:

[TuyaAccessory] Sending Estufa {"1":true} [TuyaAccessory] Sending Estufa {"1":true} [TuyaAccessory] SimpleHeater changed: {"1":true,"2":26,"4":"1","6":false,"11":0,"101":0} [TuyaAccessory] Sending Estufa {"2":29} [TuyaAccessory] SimpleHeater changed: {"1":true,"2":29,"4":"1","6":false,"11":0,"101":0} [TuyaAccessory] Sending Estufa {"2":23} [TuyaAccessory] SimpleHeater changed: {"1":true,"2":23,"4":"1","6":false,"11":0,"101":0} [TuyaAccessory] Sending Estufa {"2":30} [TuyaAccessory] SimpleHeater changed: {"1":true,"2":30,"4":"1","6":false,"11":0,"101":0} [TuyaAccessory] Sending Estufa {"2":25} [TuyaAccessory] SimpleHeater changed: {"1":true,"2":25,"4":"1","6":false,"11":0,"101":0}

btw, I also have a Merkury camera (think that you also purchased one to try to add it), did you find any way? thx

AMoo-Miki commented 5 years ago

Wow. great. Sorry that it took me so long to realize I had you mixed up.

I have not been able to get the Tuya app to talk to the Merkury camera locally. If I can carve some time, I will try and play with it again. I saw something a few days ago which might lead to something.