menahishayan / HomeScript

Python script for command line control of HomeBridge (HomeKit)
GNU General Public License v3.0
94 stars 16 forks source link

Error executing script #1

Closed vzlgdu closed 5 years ago

vzlgdu commented 5 years ago

Hi, I'm executing your script but I'm receiving some errors.

following the setting in the script:

**url = 'http://homebridgea.local:51827/'

headers = {'Content-Type': 'Application/json','authorization': '031-45-154',}**

(fyi I can ping "homebridgea")

and following the first lines in config.json:

**"bridge": {

"name": "Homebridgea",

"username": "xx:xx:xx:xx:xx:xx",

"port": 51827,

"pin": "031-45-154"

},**

I'm receiving the following error also executing the script with the "list" parameter: pi@homebridgea:~ $ python homescript.py list Traceback (most recent call last): File "homescript.py", line 88, in getAccessories() File "homescript.py", line 24, in getAccessories accessories.update({str(item['services'][1]['characteristics'][0]['value']) : {'aid':item['aid'],'iid':item['services'][1]['characteristics'][1]['iid'],'type':item['services'][0]['characteristics'][2]['value'],'value':item['services'][1]['characteristics'][1]['value']}}) IndexError: list index out of range

Please, let me know.

Thanks

PS: I'm executing HB in insecure mode: HOMEBRIDGE_OPTS=-I -U /var/homebridge

menahishayan commented 5 years ago

HomeScript v3.0.1 includes a debug mode. Please update to v3.0.1 and attach debug log and exception log of the command you're trying to run. In your case: python homescript.py debug list

vzlgdu commented 5 years ago

ok, but in this moment it is not available...

vzlgdu commented 5 years ago

Hi, updated to new version and now all works fine! Great job! Thanks for your support!