Page 2 of 3
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 12:57
by Samael
If you make a call from the console "bash -c ./MyBulb.py <IpOfBulb> <TokenOfBulb>", will it be successful? You must be in catalog of the plugin and use corresponding IP and token of your lamp.
If you make a call from the console "python ./MyBulb.py <IpOfBulb> <TokenOfBulb>", will it be successful too?
Successful call will print something like that:
<PhilipsBulbStatus power=off, brightness=50, color_temperature=1, scene=3, delay_off_countdown=0>
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 15:51
by mgabor
Hi,
I have tried. Same problem, "MyBulb.py: error: the following arguments are required: IPaddress, token"
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 16:32
by Samael
What does it say 'python --version' ?
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 16:40
by mgabor
Python version 3.5.3
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 17:08
by Samael
I have no linux at this moment but this should work (you must use your own IP and token and be in /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp):
python MyBulb.py 192.168.10.102 89bedfa9123841a44030fd4ae2a0db09
When I call 'MyBulb.py 192.168.10.102 89bedfa9123841a44030fd4ae2a0db09' under Windows (without python) I get the same error 2. So I suppose that in your environment something is not configured right and command 'bash -c ./MyBulb.py 192.168.10.102 89bedfa9123841a44030fd4ae2a0db09' is failed because bash can not find the python. But I could be wrong. I do not have much experience with Linux.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 17:27
by mgabor
I tried from Python, but I have received same error.

. Thank you, that you try to help me.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 17:32
by Samael
Have you done this?
sudo chmod 777 /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 17:43
by mgabor
Nothing change, same error.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 17:51
by mgabor
I have found this error now:
Traceback (most recent call last):
File "MyBulb.py", line 11, in <module>
import miio.philips_bulb
ImportError: No module named miio.philips_bulb
Where is the module named miio.philips_bulb? I have not found.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 18:06
by mgabor
Samael wrote: ↑Sunday 03 February 2019 17:32
Have you done this?
sudo chmod 777 /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py
Dear Samael,
I have found this error now:
Traceback (most recent call last):
File "MyBulb.py", line 11, in <module>
import miio.philips_bulb
ImportError: No module named miio.philips_bulb
Where is the module named miio.philips_bulb? I have not found.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 22:18
by Samael
You have to install a python-miio lib.
sudo pip3 install python-miio
It is installed as site package into the Python.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Sunday 03 February 2019 22:41
by Samael
People, I see that there are some problems with running under Linux. I will conduct some experiments and make the necessary edits. Please be patient.

Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Monday 04 February 2019 0:12
by Samael
You can update plugin now.
And don't forget to change the file permissions.
sudo chmod +x MyBulb.py
sudo chmod +x plugin.py
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Monday 04 February 2019 15:14
by Samael
mgabor wrote: ↑Sunday 03 February 2019 15:51
Hi,
I have tried. Same problem, "MyBulb.py: error: the following arguments are required: IPaddress, token"
Please update plugin from git. It should work now.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Monday 04 February 2019 16:21
by mgabor
Dear Samael,
Thanks, thanks... it is working. Nice work!

Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Wednesday 06 February 2019 7:48
by Justintime
So this plugin is also for these lights?
€ 10,12 62%OFF | [HOT]riginal xiaomi mijia smart downlight work with mi home app smart remote control white & warm light phone change light
https://s.click.aliexpress.com/e/BOhOXFL
Does someone knows if you can "group" them?
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Wednesday 06 February 2019 13:12
by Samael
Yes, I think it should work.
To organize the group of lights you better read the manual (
http://www.domoticz.com/DomoticzManual.pdf) and
https://www.domoticz.com/forum/viewtopic.php?t=14903.
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Friday 01 March 2019 16:52
by salvacalatayud
Hi, when I try to update I get this error:
Your local changes to the following files would be overwritten by merge:
MyBulb.py
Please commit your changes or stash them before you merge.
Aborting
Need help.
Thanks
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Friday 01 March 2019 17:23
by Samael
salvacalatayud wrote: ↑Friday 01 March 2019 16:52
Please commit your changes or stash them before you merge.
This means that you have made some changes to the file. Do the next commands inside 'domoticz-Xiaomi-Led-Lamp':
ps:
https://stackoverflow.com/questions/140 ... ed-changes
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Posted: Friday 01 March 2019 22:43
by salvacalatayud
Worked, thanks
Enviado desde mi Mi A2 mediante Tapatalk