Python Plugin : Xiaomi Philips LED Ball Lamp Topic is solved
Moderator: leecollings
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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>
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>
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Hi,
I have tried. Same problem, "MyBulb.py: error: the following arguments are required: IPaddress, token"
I have tried. Same problem, "MyBulb.py: error: the following arguments are required: IPaddress, token"
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
What does it say 'python --version' ?
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Python version 3.5.3
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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.
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.
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
I tried from Python, but I have received same error.
. Thank you, that you try to help me.
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Have you done this?
sudo chmod 777 /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py
sudo chmod 777 /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Nothing change, same error.
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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.
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.
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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.
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
You have to install a python-miio lib.
sudo pip3 install python-miio
It is installed as site package into the Python.
sudo pip3 install python-miio
It is installed as site package into the Python.
Last edited by Samael on Monday 04 February 2019 0:13, edited 1 time in total.
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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. 

-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
You can update plugin now.
And don't forget to change the file permissions.
sudo chmod +x MyBulb.py
sudo chmod +x plugin.py
And don't forget to change the file permissions.
sudo chmod +x MyBulb.py
sudo chmod +x plugin.py
-
- Posts: 15
- Joined: Friday 01 February 2019 7:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Dear Samael,
Thanks, thanks... it is working. Nice work!
Thanks, thanks... it is working. Nice work!

-
- Posts: 228
- Joined: Thursday 21 May 2015 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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?
€ 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?
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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.
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.
-
- Posts: 112
- Joined: Monday 26 June 2017 21:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Spain
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
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
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
-
- Posts: 27
- Joined: Saturday 12 January 2019 11:48
- Target OS: Windows
- Domoticz version: 4.9701
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
This means that you have made some changes to the file. Do the next commands inside 'domoticz-Xiaomi-Led-Lamp':salvacalatayud wrote: ↑Friday 01 March 2019 16:52 Please commit your changes or stash them before you merge.
Code: Select all
git reset
Code: Select all
git checkout .
-
- Posts: 112
- Joined: Monday 26 June 2017 21:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Spain
- Contact:
Re: Python Plugin : Xiaomi Philips LED Ball Lamp
Worked, thanksSamael wrote:This means that you have made some changes to the file. Do the next commands inside 'domoticz-Xiaomi-Led-Lamp':salvacalatayud wrote: ↑Friday 01 March 2019 16:52 Please commit your changes or stash them before you merge.Code: Select all
git reset
ps: https://stackoverflow.com/questions/140 ... ed-changesCode: Select all
git checkout .
Enviado desde mi Mi A2 mediante Tapatalk
Who is online
Users browsing this forum: No registered users and 1 guest