deennoo / domoticz-Xiaomi-Led-Lamp

Domoticz Plugin for Philips ZhiRui E27 bulb aka Xiaomi Philips LED Ball Lamp
9 stars 2 forks source link

Get status failed #5

Closed Koponyeges closed 5 years ago

Koponyeges commented 5 years ago

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)

Koponyeges commented 5 years ago

pi@raspberrypi:~/domoticz/plugins $ /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON

pi@raspberrypi:~/domoticz/plugins $ /home/pi/domoticz/plugins/domoticz-Xiaomi-Led-Lamp/MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power OFF pi@raspberrypi:~/domoticz/plugins $
SamaelRanger commented 5 years ago

Can you try to call from command line this? bash -c ./MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON

SamaelRanger commented 5 years ago

Have you corrected access to MyBulb.py?

Koponyeges commented 5 years ago
  1. bulb not on: image

  2. bulb on: image

SamaelRanger commented 5 years ago

@Koponyeges If you make call as 'python ./MyBulb.py 192.168.11.245 91a16af204463e97f429435cef6494e6 --power ON' will it be successful?

SamaelRanger commented 5 years ago

It looks like that sometimes bash doesn't want to run a python script. Hmm..

SamaelRanger commented 5 years ago

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.

SamaelRanger commented 5 years ago

@Koponyeges please get the latest version of plugin. I hope this works.

Koponyeges commented 5 years ago

It works! You are skilful! Thank you very much!