Closed Koponyeges closed 5 years ago
pi@raspberrypi:~/domoticz/plugins $ /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON
Can you try to call from command line this? bash -c ./MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON
Have you corrected access to MyBulb.py?
bulb not on:
bulb on:
@Koponyeges If you make call as 'python ./MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON' will it be successful?
It looks like that sometimes bash doesn't want to run a python script. Hmm..
If you are ready to edit python script you can try to remove 69 and 70 lines from plugin.py (where the bash is added): https://github.com/deennoo/domoticz-Xiaomi-Led-Lamp/blob/315eeb0e77faa9b0fdcc01a3235d020052300df8/plugin.py#L69 https://github.com/deennoo/domoticz-Xiaomi-Led-Lamp/blob/315eeb0e77faa9b0fdcc01a3235d020052300df8/plugin.py#L70 And the same logic from lines 212 and 213: https://github.com/deennoo/domoticz-Xiaomi-Led-Lamp/blob/315eeb0e77faa9b0fdcc01a3235d020052300df8/plugin.py#L212 https://github.com/deennoo/domoticz-Xiaomi-Led-Lamp/blob/315eeb0e77faa9b0fdcc01a3235d020052300df8/plugin.py#L213 Or wait a day when I will test it on Linux and commit changes.
@Koponyeges please get the latest version of plugin. I hope this works.
It works! You are skilful! Thank you very much!
Hello I installed the script, the following error message is in the domoticz log: Get status failed: Command '['bash', '-c', './MyBulb.py', '192.168.11.245', '91a16af204463e97f429435cef6494e6']' returned non-zero exit status 2 2019-02-03 12:50:07.064 (P1) Update status failed: 'BulbStatus' object has no attribute 'color_temperature' 2019-02-03 12:50:07.082 (P1) Problem with P1 - CCCW 2019-02-03 12:50:07.089 (P1) Problem with P1 - Scenes 2019-02-03 12:50:07.089 (P1) Starting device update 2019-02-03 12:50:10.795 (P1) onCommand called for Unit 2 cmd 'On' Level '0' Color '' 2019-02-03 12:50:10.775 Status: User: Admin initiated a switch command (2/P1 - CCCW/On) 2019-02-03 12:50:12.711 Error: (P1) Call command failed: Command '['bash', '-c', './MyBulb.py', '192.168.11.245', '91a16af204463e97f429435cef6494e6', '--power', 'ON']' returned non-zero exit status 2
Device status is red.
Please help!
(sorry my english)