johnlemonse / homebridge-telldus

36 stars 22 forks source link

Error when starting plugin #102

Open magneroald opened 4 months ago

magneroald commented 4 months ago

Hi, i have been running the original Telldus Homebridge plugin for many years, but after the latest api-issues at Telldus and the restrictions they have introduced, the plugin does not work properly anymore. I just recently switched to you version since the creator of the original does not want to update it further as I understand it.

I get this when I start the plugin:

[3/2/2024, 4:49:46 PM] [Telldus] Initializing Telldus platform... [3/2/2024, 4:49:46 PM] [Telldus] isLocal: false [3/2/2024, 4:49:46 PM] [Telldus] Loading accessories... [3/2/2024, 4:49:46 PM] [Telldus] Found 6 sensors in telldus live. [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1561519548. Name from telldus: Kjellerstue [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1565127034. Name from telldus: Kjøkken [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1530803400. Name from telldus: Røykvarsler [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1531170902. Name from telldus: Spisebord effekt [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1540045939. Name from telldus: Svalgang [3/2/2024, 4:49:46 PM] [Telldus] Creating accessory with ID 1530136617. Name from telldus: Yr.no [3/2/2024, 4:49:46 PM] [Telldus] Found 9 devices in telldus live. [3/2/2024, 4:49:47 PM] [Telldus] 429 == 200 [3/2/2024, 4:49:47 PM] AssertionError [ERR_ASSERTION]: 429 == 200 at LiveApi.request (/usr/local/lib/node_modules/@pontusnilsson/homebridge-telldus-pn/node_modules/telldus-api/index.js:237:12) at processTicksAndRejections (node:internal/process/task_queues:95:5) [3/2/2024, 4:49:47 PM] Got SIGTERM, shutting down Homebridge... [3/2/2024, 4:49:47 PM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet! at Bridge.Accessory.setupURI (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11) at Server.setServerStatus (/usr/local/lib/node_modules/homebridge/src/server.ts:155:45) at Server.teardown (/usr/local/lib/node_modules/homebridge/src/server.ts:199:10) at signalHandler (/usr/local/lib/node_modules/homebridge/src/cli.ts:93:12) at process.emit (node:events:517:28) at process.emit (/usr/local/lib/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)

I am the developer of the "At home" app that uses the Telldus-api, and I have had a lot of communication with telldus about the restrictions and the consequence of this. My app is working ok with the api now, but I have come around there restrictions by caching the devices and sensors list, so that if I get 429 error, I use the cached data. Would that be a solution here too?

By the way, It seems that the commands for turing on and of devices is not included in the restrictions.

In my app I have support for the Homebridge plugin and I am relient of that to be able to combine homekit and Telldus devices in a seamless way, so I hope you can fix this issue.

Magne Roald Oslo, Norway

mifi commented 4 months ago

I don't have much time to work on this but if someone wants to submit a PR (that's not too invovled) i could have a look. see also #99

magneroald commented 4 months ago

I would like to modify it myself, but I would ned a little guidance on how to modify and test it on my local installation. Is it so that I can just play with the index.js file and restart Homebridge?

magneroald commented 3 months ago

Just an update. I have now locally updated both the telldus api and the homebridge plugin to work with the api-restrictions;

Only issue left is that dimmers are unstable.

fknorn commented 4 days ago

@magneroald - can you please share how you did this? How do we update the API url?

magneroald commented 16 hours ago

I have now uploaded my changes to https://github.com/magneroald

There are two forks with changes here:

https://github.com/magneroald/telldus-api

https://github.com/magneroald/homebridge-telldus-pn

In each of the repositories, it is the index.js file that is changed, so you can replace these files in your local installation to try it out.