Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

crashes upon adding to config.json #78

Closed
lagunacomputer opened this issue Nov 27, 2016 · 9 comments
Closed

crashes upon adding to config.json #78

lagunacomputer opened this issue Nov 27, 2016 · 9 comments
Labels

Comments

@lagunacomputer
Copy link

lagunacomputer commented Nov 27, 2016

Homebridge crashes on load everytime I add/replace the platforms statement in config.json, any ideas?

{"platforms": [
  {
    "platform": "HomeAssistant",
    "name": "HomeAssistant",
    "host": "http://192.168.1.109:8123",
    "password": "pi",
    "supported_types": ["binary_sensor", "cover", "fan", "input_boolean", "light", "lock", "media_player", "scene", "sensor", "switch"]
  }
]}

I have spent hours and tried everything, thanks (commas, adding to the EOF, replacing existing0

@kolossboss
Copy link

Looks ok.
How did you start homebridge?
Nothing in the log?

@saisupriyacv
Copy link

saisupriyacv commented Dec 6, 2016

Homebridge fails to load home assistant every time It says

/usr/local/lib/node_modules/homebridge-homeassistant/accessories/sensor.js:44
class HomeAssistantSensor {
^^^^^
SyntaxError: Unexpected reserved word
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Plugin.module.exports [as initializer] (/usr/local/lib/node_modules/homebridge-homeassistant/index.js:27:32)
    at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:130:14)
    at Array.forEach (native)
    at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:108:22)

@robbiet480
Copy link
Member

@lagunacomputer I need more information. What's the error say?

@saisupriyacv You need to upgrade to a newer version of Node.js.

@robbiet480 robbiet480 added the bug label Jan 13, 2017
@bachoo786
Copy link

I get the following errors:

Loaded plugin: homebridge-homeassistant
[2/9/2017, 6:43:54 PM] Registering platform 'homebridge-homeassistant.HomeAssistant'
[2/9/2017, 6:43:54 PM] ---
/usr/lib/node_modules/homebridge/lib/server.js:202
var username = config.bridge.username;
^

TypeError: Cannot read property 'username' of undefined
at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:202:31)
at new Server (/usr/lib/node_modules/homebridge/lib/server.js:52:38)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)

@robbiet480
Copy link
Member

@bachoo786 This is a problem with Homebridge, not homebridge-homeassistant. I assume your configuration is invalid.

@bachoo786
Copy link

Here is my config:

{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": "45201",
"pin": "raspberry"
},

{
	"platforms": [{
		"platform": "HomeAssistant",
		"name": "HomeAssistant",
		"host": "http://XXXXX",
		"password": “XXXXX",
		"supported_types": ["binary_sensor", "cover", "fan", "input_boolean", "light", "lock", "media_player", "scene", "sensor", "switch"]
	}]
}

@lagunacomputer
Copy link
Author

I noticed you have a different homebridge config.json format than I do, PIN and PORT but no Password

@bachoo786
Copy link

I resolved somehow but mqtt is giving me problems my config now is:

{
"bridge": {
"name": "Homebridge",
"username": “XX:XX:XX:XX:XX:XX",
"port": XXXXX,
"pin": “XXX-XX-XXX"
},

"platforms": [{
		"platform": "HomeAssistant",
		"name": "HomeAssistant",
		"host": “XXX",
		"password": “XXX",
		"supported_types": ["light", "switch", "media_player"]
	},

	"platforms": [{
		"platforms": "mqtt",
		"name": "mqtt",
		"url": "http://XXX",
		"topic_prefix": “XXX",
		"username": “XXX",
		"password": “XXX"
	}]
}

@bachoo786
Copy link

all sorted thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants