Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when starting plugin #102

Open
magneroald opened this issue Mar 2, 2024 · 5 comments
Open

Error when starting plugin #102

magneroald opened this issue Mar 2, 2024 · 5 comments

Comments

@magneroald
Copy link

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
Copy link
Collaborator

mifi commented Mar 3, 2024

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
Copy link
Author

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
Copy link
Author

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

  • Sensor data and device data is only read with the list commands and cached to files so that data is always present if reading is too frequent.
  • Safer finding of sensor data (Yr.no Telldus plugin as an example)
  • Device on/off/dim is not restricted in telldus API

Only issue left is that dimmers are unstable.

@fknorn
Copy link

fknorn commented Jul 3, 2024

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

@magneroald
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants