sibartlett / homebridge-wink3

Homebridge plugin for wink.com
https://sibartlett.github.io/homebridge-wink3
ISC License
54 stars 20 forks source link

OAuth Authorization Code Error #40

Open prince82 opened 7 years ago

prince82 commented 7 years ago

I log in to http://ip_address:8888 with my username and password and I see that I have been successfully authenticated "Homebridge successfully authenticated with Wink."

But in the terminal, I get the following error:

Could not authenticate with wink.com { Error: EACCES: permission denied, open '/home/pi/.homebridge/config.json'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1314:33)
    at WinkPlatform.updateConfig (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:66:8)
    at WinkClient.updateConfig (/usr/lib/node_modules/homebridge-wink3/src/WinkPlatform.js:40:36)
    at then.response (/usr/lib/node_modules/homebridge-wink3/src/WinkClient.js:70:12)
    at process._tickCallback (internal/process/next_tick.js:109:7)
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/home/pi/.homebridge/config.json' }

my accessories do not show up. I have the sonos plugin installed and that is working fine in homebridge.

My config.json:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "platforms": [{
        "platform": "Wink",
        "name": "Wink",
        "client_id": "xxxxxxxxxxxxx",
        "client_secret": "xxxxxxxxxxxxx",
        "hide_groups": ["garage_door","thermostat"]
    }],
        "accessories": [{
                "accessory": "Sonos",
                "name": "TV Room",
                "room": "TV Room"
        }, {
                "accessory": "Sonos",
                "name": "Living Room",
                "room": "Living Room"
        }]
 }

thanks.

prince82 commented 7 years ago

I figured it out. My permission settings for config.json had root as owner. I used the following command:

sudo chown pi:pi config.json

to change ownership to pi.