eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
224 stars 61 forks source link

BG1 Socket Dosn't respond to commands #79

Closed matt01 closed 4 years ago

matt01 commented 4 years ago

Hi,

I have recently purchased two of the double gang wall mounted BG1 sockets and have attempted to get them to work with this code.

When I run the mqtt.py script and send it some messages I get the following output,

(testenv1) iot1 ~/broadlink-mqtt # ./mqtt.py 
[2020-07-27 01:10:39,696] DEBUG Connected to 'BG1' Broadlink device at '192.168.51.104' (MAC 24:df:a7:a4:d7:21) and started listening for commands at MQTT topic having prefix 'broadlink/a4_d7_21/' 
[2020-07-27 01:10:39,700] DEBUG Connected to MQTT broker, subscribing to topic broadlink/#
[2020-07-27 01:10:44,747] DEBUG Received MQTT message broadlink/a4_d7_21/power/1 on
[2020-07-27 01:10:44,747] DEBUG Setting power state of socket 1 to True
[2020-07-27 01:10:44,752] DEBUG Received MQTT message broadlink/a4_d7_21/power/2 on
[2020-07-27 01:10:44,753] DEBUG Setting power state of socket 2 to True

However, the socket never switches on. This is the same for both of them. The android app works without any issues and I have updated the firmware on one of the socket. I am also using the barnybug/python-broadlink@add_bgelectrical_sockets version of the python-broadlink library.

Does anybody know why this might not be working?

Here is a dump of the network traffic on port UDP/80.

Thanks,

Matt.

ElectricImpossible commented 4 years ago

I had slight issues getting a single BG1 working initially but worked well until I added a second device!

Have you managed to get a single socket working yet? If not then I would recommend focusing on that first.

Im using firmware 57053 (hopefully this shows that recent firmware still works) and was able to see similar debug output when using the Android app or MQTT topic to toggle the sockets. When adding the second socket it seemed to add it to the original socket as a slave and this broke my setup.

I used @cgorms's advice here to break them up.

https://www.reddit.com/r/HOOBS/comments/g8fhvn/no_json_response/fowb02u?utm_source=share&utm_medium=web2x

matt01 commented 4 years ago

Setting up the sockets using the broadlink-cli makes them work for me, it also makes them all work, at the same time :+1:

I do have another socket, which is one of these: https://www.bgelectrical.uk/wiring-devices/moulded/smart-sockets#AHC/U-01 , which doesn't work but I think this is a different issue as the product id its returning is different to the other sockets.

Thanks @ElectricImpossible