nick7zmail / MajorDoMo-dev_broadlink

MajorDoMo broadlink devices support
0 stars 3 forks source link

Help with new device ID:0x51E3 #18

Open vzorglub opened 4 years ago

vzorglub commented 4 years ago

Hi, I have purchased this device: https://www.bgelectrical.uk/smart-sockets

After a bit of digging, I found out that they use a broadlink chip:

https://community.home-assistant.io/t/uk-wifi-smart-socket-screwfix-testing/119995/5

I only found your repo after trying these things below with the python-broadlink library

So I tried connecting to broadlink-mqtt

Kind of works:

$ pi@piup:~/broadlink-mqtt $ python mqtt.py [2019-10-09 10:27:40,822] DEBUG Connected to 'Unknown' Broadlink device at '192.168.0.99' (MAC c8:f7:42:fc:e5:45) and started listening for commands at MQTT topic having prefix 'broadlink/' [2019-10-09 10:27:40,834] DEBUG Connected to MQTT broker, subscribing to topic broadlink/#

It connects, so there must be a way. I have a spare device that I can send by post I can also send debug logs or whatever is needed

also:

import broadlink print hex(broadlink.discover(timeout=10)[0].devtype) 0x51e3

How do I find out what commands it takes? It could be compatible with an MP1 device but only 2 sockets It is not. Defining the device as an MP1 type does not work

Your repo has many more devices than the python-broadlink library has. Are there any simililar devices where this device could be compatible with in your repo?

Thanks for your help

Thanks

nick7zmail commented 4 years ago

Hello. Now I can’t remember devices with 2 full control channels. You can try to identify the device as an SP3 socket. If at least 1 channel is controlled, this is good. To control the second channel, you can try controlling the nightlight on SP3. If this works, you will get a fully working device. I can add it to my database, and you in the python library for example.

vzorglub commented 4 years ago

The SP3 is a device type 1 same as the SP2 I have tried setting the device as an SP2 in the library and it didn't work How would I go about finding out the commands for this device?

nick7zmail commented 4 years ago

You can intercept the traffic of the e-control application, decrypt it and find the bytes that change when the status changes. This can be done through wireshark or through any other packet sniffer. You can directly on the phone https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en. To decrypt - to help in my module there is a file https://github.com/nick7zmail/MajorDoMo-dev_broadlink/blob/master/modules/dev_broadlink/broadlink_debug_scr.php. There is an approximate decryption algorithm. If you find the byte numbers, you can try to manage by forming a control packet.