JSON parse issue
andersmilton opened this issue · comments
Looks nice!
Tried installing it now, but the plugin can't seem to recognise my gateway or accessories. I get the following in the Homebridge log file:
SyntaxError: Unexpected token A in JSON at position 0 at Object.parse (native) at coap.get.then (/usr/local/lib/node_modules/homebridge-tradfri/dist/tradfri/tradfri.js:23:36) at process._tickCallback (internal/process/next_tick.js:103:7)
Works great with Jesper Lindbergs homebridge-tradfri
, https://github.com/jesper-lindberg/homebridge-tradfri, so I don't think there's anything horribly wrong with my setup.
I think your issue is with Jesper Lindbergs homebridge-tradfri
plugin, since mine is called homebridge-tradfri-plugin
. Notice the file where the error is thrown (/usr/local/lib/node_modules/homebridge-tradfri/dist/tradfri/tradfri.js:23:36).
Make sure you are only running one of the plugins if you have more installed. Just remove their configuration from config.json.
I had already replaced the homebridge-tradfri configuration with the homebridge-tradfri-plugin one when I got the error. Maybe Homebridge cached it somewhere? Or maybe there was a conflict as "name": "Tradfri"
is the same in the config for both plugins?
Anyway, good catch! I uninstalled homebridge-tradfri and now your plugin works like a charm!
I'm glad it works. I'll close this issue now, if you have some other problems feel free to reopen.