BroadLink MP1(2) is remote controlled power outlet with 4 independently controlled outlets, for MP1, one for MP2.
Using python-broadlink, I have already developed my own scripts for controlling those devices, so I can use them locally with command_line switch. (https://github.com/Paxy/IFTTT-broadlink-milight-smart)
My goal now would be to try to extend broadlink.py component to support MP1,2.
I would probably need some assistance as I have not involved with HASS project before.
So my thoughts are:
We should create an additional class inside switches/broadlink.py to support MP devices with a different number of sockets.
We should make functions for both set and get a state of the particular socket.
Probably new field ‘type’ should be added to YAML file to indicate is it RM or MP device (maybe even others in future).
Have not tested yet MP1 with individual sockets. It will arrive in next few days so I will check is current module compatible with MP1 controls and how can we access to different sockets.
MP1 just arrived.
Great news are that python-broadlink has just publish support for MP1 strip.
Just tested with python scripts, so individual sockets could be controlled.
Hi @Paxy, I have included MP1 support in broadlink python library and was planning to do a PR in home-assistant github, if you need some help please let me know!
I added MP1 compatibility to the HA broadlink.py. It is not the most elegant solution, but I started reading up on Python yesterday so please be kind. Basically, there are now four more types of broadlink devices, mp1-1, mp1-2, mp1-3 and mp1-4 for the four sockets of each MP1. I tested it and it seems to work so far and updates the state of the switch on the home assistant.
hi Kahthan - thank you so much for this much appreciated - I am so sorry to sound like a complete novice (which I am) but how would I test this? where would I add that code? thank you in advance