{"action":"created","issue":{"url":"https://api.github.com/repos/nfarina/homebridge/issues/818","repository_url":"https://api.github.com/repos/nfarina/homebridge","labels_url":"https://api.github.com/repos/nfarina/homebridge/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/nfarina/homebridge/issues/818/comments","events_url":"https://api.github.com/repos/nfarina/homebridge/issues/818/events","html_url":"https://github.com/nfarina/homebridge/issues/818","id":180041476,"number":818,"title":"Help with getting second accessory working... (IndexOf Error)","user":{"login":"mehtaman","id":16583136,"avatar_url":"https://avatars.githubusercontent.com/u/16583136?v=3","gravatar_id":"","url":"https://api.github.com/users/mehtaman","html_url":"https://github.com/mehtaman","followers_url":"https://api.github.com/users/mehtaman/followers","following_url":"https://api.github.com/users/mehtaman/following{/other_user}","gists_url":"https://api.github.com/users/mehtaman/gists{/gist_id}","starred_url":"https://api.github.com/users/mehtaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehtaman/subscriptions","organizations_url":"https://api.github.com/users/mehtaman/orgs","repos_url":"https://api.github.com/users/mehtaman/repos","events_url":"https://api.github.com/users/mehtaman/events{/privacy}","received_events_url":"https://api.github.com/users/mehtaman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-29T12:55:51Z","updated_at":"2016-09-29T13:57:14Z","closed_at":null,"body":"What am I doing wrong...\r\n\r\n**Steps carried out:**\r\n\r\n> sudo apt-get update\r\n> sudo apt-get upgrade\r\n> sudo apt-get install git make\r\n> curl deb.nodesource.com/setup_6.x | sudo bash\r\n> sudo apt-get install nodejs\r\n> sudo npm install -g --unsafe-perm homebridge hap-nodejs node-gyp\r\n> cd /usr/lib/node_modules/homebridge/\r\n> sudo npm install --unsafe-perm bignum\r\n> cd /usr/lib/node_modules/hap-nodejs/node_modules/mdns\r\n> sudo node-gyp BUILDTYPE=Release rebuild\r\n> sudo npm install -g --unsafe-perm homebridge\r\n> sudo npm install -g homebridge-pi\r\n> sudo su\r\n> cd /root/.homebridge\r\n> sudo nano config.json\r\n\r\n```\r\n{\r\n    \"bridge\": {\r\n        \"name\": \"Homebridge\",\r\n        \"username\": \"CC:22:3D:E3:CE:30\",\r\n        \"port\": 51826,\r\n        \"pin\": \"031-45-154\"\r\n    },\r\n    \r\n    \"accessories\": [\r\n        {\r\n            \"accessory\": \"PiTemperature\",\r\n            \"name\": \"Raspberry Pi Temperature\"\r\n  \t}\r\n    ]\r\n }\r\n```\r\n\r\n> Ctrl+O\r\n> Enter\r\n> Ctrl+x\r\n> sudo homebridge\r\n\r\nThis seems to load as I see the PIN code box + message to say \"Homebridge is running\"\r\n\r\n**Point of failure:**\r\n\r\n> npm install -g homebridge-people\r\n\r\nupdate config.json to:\r\n\r\n```\r\n{\r\n\t\"bridge\": {\r\n\t\t\"name\": \"Homebridge\",\r\n\t\t\"username\": \"CC:22:3D:E3:CE:30\",\r\n\t\t\"port\": 51826,\r\n\t\t\"pin\": \"031-45-154\"\r\n\t},\r\n\r\n\t\"accessories\": [{\r\n\t\t\"accessory\": \"PiTemperature\",\r\n\t\t\"name\": \"Raspberry Pi Temperature\",\r\n\r\n\t\t\"accessory0\": \"people\",\r\n\t\t\"name0\": \"People\",\r\n\t\t\"people\": [{\r\n\t\t\t\"name\": \"Pete\",\r\n\t\t\t\"target\": \"PetesiPhone\"\r\n\t\t}],\r\n\t\t\"threshold\": 15\r\n\r\n\t}]\r\n}\r\n\r\n```\r\nThe above complies on [jsonlinet.com](https://jsonlint.com/)\r\n\r\nWhen I restart my Pi and type:\r\n\r\n>  sudo homebridge\r\n\r\n I get an error - TypeError: Cannot read property 'indexOf' of undefined\r\n\r\n\r\nCan someone help please?? (i am a bit of a linux/pi n00b)\r\nIs it even possible to have more than one accessory at a time?\r\nWhen I compile just using 'accessory' I get a warning about duplicate names, that's why I am trying 'accessory0' & 'accessory1'."},"comment":{"url":"https://api.github.com/repos/nfarina/homebridge/issues/comments/250473289","html_url":"https://github.com/nfarina/homebridge/issues/818#issuecomment-250473289","issue_url":"https://api.github.com/repos/nfarina/homebridge/issues/818","id":250473289,"user":{"login":"mehtaman","id":16583136,"avatar_url":"https://avatars.githubusercontent.com/u/16583136?v=3","gravatar_id":"","url":"https://api.github.com/users/mehtaman","html_url":"https://github.com/mehtaman","followers_url":"https://api.github.com/users/mehtaman/followers","following_url":"https://api.github.com/users/mehtaman/following{/other_user}","gists_url":"https://api.github.com/users/mehtaman/gists{/gist_id}","starred_url":"https://api.github.com/users/mehtaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehtaman/subscriptions","organizations_url":"https://api.github.com/users/mehtaman/orgs","repos_url":"https://api.github.com/users/mehtaman/repos","events_url":"https://api.github.com/users/mehtaman/events{/privacy}","received_events_url":"https://api.github.com/users/mehtaman/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T13:57:14Z","updated_at":"2016-09-29T13:57:14Z","body":"Found the error...\r\n```\r\n{\r\n\t\"bridge\": {\r\n\t\t\"name\": \"Homebridge\",\r\n\t\t\"username\": \"CC:22:3D:E3:CE:30\",\r\n\t\t\"port\": 51826,\r\n\t\t\"pin\": \"031-45-154\"\r\n\t},\r\n\r\n\t\"accessories\": [{\r\n\t\t\"accessory\": \"PiTemperature\",\r\n\t\t\"name\": \"Raspberry Pi Temperature\"\r\n\t**}, {**\r\n\t\t\"accessory\": \"people\",\r\n\t\t\"name\": \"People\",\r\n\t\t\"people\": [{\r\n\t\t\t\"name\": \"12345\",\r\n\t\t\t\"target\": \"12345\"\r\n\t\t}],\r\n\t\t\"threshold\": 15\r\n\r\n\t}]\r\n}\r\n```\r\n\r\n"}}
{"actor":{"display_login":"mehtaman"}}