tim-hellhake / tradfri-adapter

Mozilla Public License 2.0
2 stars 3 forks source link

No Devices Found #7

Closed kein0r closed 4 years ago

kein0r commented 4 years ago

I installed tradfri-adapter 0.2.2 but when adding "Things" none of two Smart Plug show up. Logs just shows these two lines

2020-05-30 10:27:44.969 INFO : tradfri-adapter: Adapter: TradfriAdapter id gw-d44da439d0a9 pairing started 2020-05-30 10:28:44.965 INFO : tradfri-adapter: Adapter: TradfriAdapter id gw-d44da439d0a9 pairing cancelled

with d44da439d0a9 matching the MAC of the tradfri gateway. When executing

coap-client -m get -u "testuser" -k "PSK" "coaps://ip:5684/.well-known/core"

form the gateway I can see that the two devices are listed

decrypt_verify(): found 24 bytes cleartext decrypt_verify(): found 698 bytes cleartext <//15006>;ct=0;obs,<//15001>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15010>;ct=0;obs,<//15005>;ct=0;obs,<//15005/add>;ct=0,<//15005/remove>;ct=0,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9102>;ct=0,<//15011/9094>;ct=0;obs,<//15011/9095>;ct=0;obs,<//15011/9104>;ct=0;obs,<//15011/9110>;ct=0;obs,<//15011/9110/add>;ct=0,<//15011/9110/remove>;ct=0,<//15011/9110/update>;ct=0,<//sonos>;ct=0,<//15005/131073/196608>;ct=0;obs,<//15005/131073/196609>;ct=0;obs,<//15005/131073/196610>;ct=0;obs,<//15001/65536>;ct=0;obs,<//15004/131073>;ct=0;obs,<//15005/131073>;ct=0;obs,<//15011/9063>;ct=0,<//15001/65538>;ct=0;obs

and I can query each of them separately using

coap-client -m get -u "testuser" -k "PSK" "coaps://ip:5684/15001/65536" v:1 t:CON c:GET i:7aeb {} [ ] decrypt_verify(): found 24 bytes cleartext decrypt_verify(): found 227 bytes cleartext {"9001":"Kossel","9002":1590710737,"9020":1590797404,"9003":65536,"9054":0,"9019":1,"5750":3,"3":{"0":"IKEA of Sweden","1":"TRADFRI control outlet","6":1,"2":"","3":"2.0.024"},"3312":[{"5850":0,"5851":254,"9003":0}]}

and

coap-client -m get -u "testuser" -k "PSK" "coaps://ip:5684/15001/65538" v:1 t:CON c:GET i:ee6d {} [ ] decrypt_verify(): found 24 bytes cleartext decrypt_verify(): found 228 bytes cleartext {"9001":"PrusaI3","9002":1590718145,"9020":1590804555,"9003":65538,"9054":0,"9019":1,"5750":3,"3":{"0":"IKEA of Sweden","1":"TRADFRI control outlet","6":1,"2":"","3":"2.0.024"},"3312":[{"5850":0,"5851":254,"9003":0}]}

tim-hellhake commented 4 years ago

Hi kein0r,

thanks for the report. Is the adapter not working in general or do you have only problems with the power plugs? Do you see the message Saving authentication in the logs? Are there any messages like Received update for xxx yyy?

kein0r commented 4 years ago

The power plugs themselves are working. I can control them from the IKEA app. Yes at the time I installed the extension I see the following message in the log once

2020-05-28 19:01:46.135 INFO : Loading add-on: tradfri-adapter 2020-05-28 19:01:47.871 INFO : tradfri-adapter: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3 2020-05-28 19:01:48.633 INFO : tradfri-adapter: Loading add-on tradfri-adapter from /home/pi/.mozilla-iot/addons/tradfri-adapter 2020-05-28 19:01:49.179 INFO : tradfri-adapter: Discovered gateway gw-d44da439d0a9 at TRADFRI-Gateway-d44da439d0a9.local 2020-05-28 19:01:49.190 INFO : tradfri-adapter: { securityCode: 'SECURITYCODEREMOVED', 2020-05-28 19:01:49.192 INFO : tradfri-adapter: experimental: { brightnessProperty: true }, 2020-05-28 19:01:49.193 INFO : tradfri-adapter: gateways: { 'gw-d44da439d0a9': {} } } 2020-05-28 19:01:49.195 INFO : tradfri-adapter: Authenticating to the gateway 2020-05-28 19:01:49.461 INFO : tradfri-adapter: Saving authentication 2020-05-28 19:01:49.554 ERROR : Invalid message received: { messageType: 4096, data: { adapterId: 'gw-d44da439d0a9', name: 'TradfriAdapter', pluginId: 'tradfri-adapter' } }

Yes, when I control the power plugs via the IKEA app the following messages appear in the logs

2020-05-30 11:42:16.739 INFO : tradfri-adapter: Received update for PrusaI3 (65538) 2020-05-30 11:42:16.742 INFO : tradfri-adapter: PrusaI3 (65538) / true 2020-05-30 11:42:16.752 INFO : tradfri-adapter: Received update for Kossel (65536) 2020-05-30 11:42:16.755 INFO : tradfri-adapter: Kossel (65536) / true

tim-hellhake commented 4 years ago

Yes, when I control the power plugs via the IKEA app the following messages appear in the logs

Nice, that means that adapter is working and receives updates from the gateway. Are there any messages like Creating device for xxx yyy in the log? If yes, could you please check if the plugs are now recognized?

kein0r commented 4 years ago

Yes, after controlling them once via the app and seeing above "Receive update messages" the log showed

run-app.log.2020-05-30:2020-05-30 11:12:53.954 INFO : tradfri-adapter: Creating device for Kossel (65536) run-app.log.2020-05-30:2020-05-30 11:12:53.994 INFO : tradfri-adapter: Creating device for PrusaI3 (65538)

and the devices can now be added successfully :)

tim-hellhake commented 4 years ago

Wonderful :) I'll see if I can change it, so it recognizes devices without an initial update.

kein0r commented 4 years ago

Thanks a lot for helping me resolve this

tim-hellhake commented 4 years ago

You're welcome :)