meg768 / homebridge-ikea-tradfri-gateway

homebridge-ikea-tradfri-gateway
GNU General Public License v3.0
73 stars 24 forks source link

Homebridge wont start when config is entered #64

Open StephanDuby opened 3 years ago

StephanDuby commented 3 years ago

I added the plugin to my homebridge installation, pasted the example config and edited the security code for my tradfri gateway. I then proceeded to restart homebridge but it will no longer start.

Status says: Stopped - show log

The log gives me no useful info

Removing the config bit allows my homebridge to start up again.

StephanDuby commented 3 years ago

i was able to get my homebridge running by doing the following:

        .then(() => {
            this.log('Loading devices...');
            return this.gateway.observeDevices();
        })
        /*.then(() => {
            this.log('Loading groups and scenes...');

            return this.gateway.observeGroupsAndScenes();

        })*/
        .then(() => {
            return this.enablePing();
        })

I assume the gateway does not want to expose the groups and scenes at this point ...

I dont need them so for me its fine ...

sloevhaug commented 3 years ago

My system was also working fine until I updated to the latest version of IKEA Home Smart. It seems like they have released a new "scenes"-feature which breaks this plugin from working.

@StephanDuby Thanks for the easy fix! I am also configuring all my scenes and groups in HomeKit anyways so don't need them from the IKEA app.

sloevhaug commented 3 years ago

@StephanDuby I discovered that updating all packages/dependencies also solved the problem. in package.json change the ^ to > like so:

"dependencies": {
    "color-convert": ">1.9.3",
    "dotenv": ">4.0.0",
    "node-tradfri-client": ">2.1.8",
    "yow": ">1.0.107"
  },

To indicate that we can update these. Then run sudo npm update šŸ‘

matshol commented 3 years ago

Hey guys!

Im very new to this and have to ask, whats the directory of the files you are updating?

Thanks for reply,

Hom-beep commented 3 years ago

@matshol

i was able to get my homebridge running by doing the following:

        .then(() => {
            this.log('Loading devices...');
            return this.gateway.observeDevices();
        })
        /*.then(() => {
            this.log('Loading groups and scenes...');

            return this.gateway.observeGroupsAndScenes();

        })*/
        .then(() => {
            return this.enablePing();
        })

can be found under /usr/lib/node_modules/homebridge-ikea-tradfri-gateway/src/gateway.js

@StephanDuby I discovered that updating all packages/dependencies also solved the problem. in package.json change the ^ to > like so:

"dependencies": {
    "color-convert": ">1.9.3",
    "dotenv": ">4.0.0",
    "node-tradfri-client": ">2.1.8",
    "yow": ">1.0.107"
  },

To indicate that we can update these. Then run sudo npm update šŸ‘

can be found under /usr/lib/node_modules/homebridge-ikea-tradfri-gateway/package.json

For me the first solution worked :)

markxoe commented 3 years ago

I've made an Pull Request, lets wait for the developer to merge and publish

sloevhaug commented 3 years ago

Actually, it started bugging out after a couple of weeks after updating packages. Lights were unreachable in HomeKit, even after restarting both homebridge server and ikea hub. Had to reinstall the plugin and go back to commenting out the lines @StephanDuby posted.

Looking for another solution if anybody knows, because this solution is not stable enough.

gdotp01 commented 3 years ago

It would be good to fix this. I can see that there is a new Pull request for package.json to update the dependencies. I've tried installing this today and can't get it to work. I also can't work out how to manually update this in Homebridge as I can't find the package.json file (it does not appear to be in /usr/lib/node_modules/homebridge-ikea-tradfri-gateway/package.json as stated above.

markxoe commented 3 years ago

The dependecy issue is solved via my Pull Request, it worked so far for me

markxoe commented 3 years ago

Actually, it started bugging out after a couple of weeks after updating packages. Lights were unreachable in HomeKit, even after restarting both homebridge server and ikea hub. Had to reinstall the plugin and go back to commenting out the lines @StephanDuby posted.

Looking for another solution if anybody knows, because this solution is not stable enough.

Any Logs/ Errors or anything to work with?

sloevhaug commented 3 years ago

No, sorry... i will remember to save logs next time it happens. On 18 Jan 2021, 16:49 +0100, Mark Oude Elberink notifications@github.com, wrote:

Actually, it started bugging out after a couple of weeks after updating packages. Lights were unreachable in HomeKit, even after restarting both homebridge server and ikea hub. Had to reinstall the plugin and go back to commenting out the lines @StephanDuby posted. Looking for another solution if anybody knows, because this solution is not stable enough. Any Logs/ Errors or anything to work with? ā€” You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

gdotp01 commented 3 years ago

The dependecy issue is solved via my Pull Request, it worked so far for me

Hi. How would I incorporate this whist waiting for the code to be merged?

gdotp01 commented 3 years ago

Manged to find th package.json and updated as so

"bundleDependencies": false, "dependencies": { "color-convert": "^2.0.1", "dotenv": "^8.2.0", "node-tradfri-client": "^2.1.8", "yow": "^1.0.108" },

Ran sudo npm update

Still fails with the message:

TradfriError: The gateway did not respond in time. at TradfriClient. (/usr/local/lib/node_modules/homebridge-ikea-tradfri-gateway/node_modules/node-tradfri-client/build/tradfri-client.js:186:39) at Generator.next () at fulfilled (/usr/local/lib/node_modules/homebridge-ikea-tradfri-gateway/node_modules/node-tradfri-client/build/tradfri-client.js:5:58) at processTicksAndRejections (internal/process/task_queues.js:93:5) { code: 1 }

matshol commented 3 years ago

@gdotp01 It worked for me (and is still working) to change the ^ to > as @sloevhaug explained:

dependencies": { "color-convert": ">1.9.3", "dotenv": ">4.0.0", "node-tradfri-client": ">2.1.8", "yow": ">1.0.107" },

And then sudo npm update.

gdotp01 commented 3 years ago

@matshol thanks for getting back but I can't get it to work. The lined I entered were from the pull request with slightly later versions in them. However I now get the error message when i try to do a npm update. I copied the versions you were using with the >.

code ETARGET npm ERR! notarget No matching version found for node-tradfri-client@>2.1.8. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

So I'm a bit stuck

Hom-beep commented 3 years ago

Currently my non-ikea-lights show up in homekit but there is something wrong with choosing color. seems like they canĀ“t handle homekitĀ“s light input. got this problem since about 1 week.

tomlcooper commented 3 years ago

Currently my non-ikea-lights show up in homekit but there is something wrong with choosing color. seems like they canĀ“t handle homekitĀ“s light input. got this problem since about 1 week.

I think I have the same issue, I've raised it's own issue here #69.

wilsontgh commented 3 years ago

just changing "node-tradfri-client": "^1.6.0" to "node-tradfri-client": ">1.6.0" worked for me