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

Telldus API #99

Open
tellustheguru opened this issue Dec 3, 2023 · 20 comments
Open

Telldus API #99

tellustheguru opened this issue Dec 3, 2023 · 20 comments

Comments

@tellustheguru
Copy link

Telldus has change term of use regarding Telldus API, I have translated it from Swedish:

Information for those of you who use the Telldus API (not Google Home users):

For Telldus users who use our API services for free, we will need to review the scope and capacity of these services in light of the costs associated with providing certain services with the requirement of server capacity, redundancy and security.

pa-api.telldus.com will remain down for now while we implement additional features to limit the frequency of incoming traffic caused by certain users. We will reopen it as soon as possible once implementation and testing have been done.
If you use our API services, please note the following:

  • We will update our operational information when pa-api.telldus.com is available again.
  • DO NOT use api.telldus.com. Your IP will be automatically blocked. Switch to pa-api.telldus.com if you haven't already.
  • Do not make more than 10 requests to pa-api.telldus.com per minute.
  • Check and double check that your scripts don't make new attempts to contact the Telldus API without waiting at least 10 seconds.

Retrying without delay will result in blocking.

@mifi
Copy link
Collaborator

mifi commented Dec 5, 2023

do we need to change anything in this repo?

@tellustheguru
Copy link
Author

What I mean is the point:

  • Do not make more than 10 requests to pa-api.telldus.com per minute.

because they warn if you repeat the request more than 10 times/minute you will be blocked.

Maybe a limiter is needed in the plugin to prevent this.

@tellustheguru
Copy link
Author

This may also lead to blocking:

"Check and double-check that your scripts are not retrying to contact the Telldus API without waiting at least 10 seconds. Retrying without a delay will result in blocking."

@mifi
Copy link
Collaborator

mifi commented Dec 7, 2023

Oh so they will temporary ban the ip for a while? I dont have time to work on this now (and i dont have any hardware rn) but PR is welcome.

@Mats82Sweden
Copy link

How can I change the telldus plugin to point to https;//pa-api.telldus.com ?

@mifi
Copy link
Collaborator

mifi commented Dec 10, 2023

just delete your yarn.lock/package-lock.json and node_modules

@Mats82Sweden
Copy link

@mifi
I think I managed to point it to https://pa-api.telldus.com but I still get the handshake error.

12/10/2023, 1:14:00 PM] Loaded plugin: homebridge-telldus@1.1.0
[12/10/2023, 1:14:00 PM] Registering platform 'homebridge-telldus.Telldus'
[12/10/2023, 1:14:01 PM] ---
[12/10/2023, 1:14:01 PM] Loading 2 platforms...
[12/10/2023, 1:14:01 PM] [Telldus Live] Initializing Telldus platform...
[12/10/2023, 1:14:01 PM] [Telldus Live] isLocal: false
[12/10/2023, 1:14:01 PM] [Telldus Live] Loading accessories...
[12/10/2023, 1:14:01 PM] [Telldus Live] request to https://pa-api.telldus.com/json/sensors/list failed, reason: write EPROTO 200084A8FFFF0000:error:0A000410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1586:SSL alert number 40

[12/10/2023, 1:14:01 PM] FetchError: request to https://pa-api.telldus.com/json/sensors/list failed, reason: write EPROTO 200084A8FFFF0000:error:0A000410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1586:SSL alert number 40

at ClientRequest.<anonymous> (/var/lib/homebridge/node_modules/homebridge-telldus/node_modules/node-fetch/lib/index.js:1505:11)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)

[12/10/2023, 1:14:01 PM] Got SIGTERM, shutting down Homebridge...
[12/10/2023, 1:14:01 PM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
at Bridge.Accessory.setupURI (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
at Server.setServerStatus (/var/lib/homebridge/node_modules/homebridge/src/server.ts:155:45)
at Server.teardown (/var/lib/homebridge/node_modules/homebridge/src/server.ts:199:10)
at signalHandler (/var/lib/homebridge/node_modules/homebridge/src/cli.ts:93:12)
at process.emit (node:events:517:28)
at process.emit (/var/lib/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
[12/10/2023, 1:14:06 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null

@Torkilds1
Copy link

I have the same issue as @Mats82Sweden have.

@tellustheguru
Copy link
Author

The API is down, read this (It's in Swedish):
https://telldus.com/driftinformation/

@Mats82Sweden
Copy link

Mats82Sweden commented Dec 10, 2023

@tellustheguru
Thanks it's me that have been getting it wrong. I thought they wanted us to switch to pa-api.telldus.com because api.telldus.com is down.
So just sit back and wait for the API to come back?
Most of all I wanted to communicate directly to my Telldus Znet v2 local IP address but I cant get that to work either as long as the API is down?

@Mats82Sweden
Copy link

I got it working by installing beta firmware on my Telldus Znet vnet v2 and then configured it via homeassistant. Then uninstalled homebridge to not brick anything hehe.

@yflorack
Copy link

yflorack commented Dec 18, 2023

Looks like the API does something strange still with my setup. I uninstalled and reinstalled your plugin and put in the api-tokens. It seems Telldus gives some errors as follows, and I wonder if this has to do with the fact that I have more than 10 devices/sensors connected and the telldus api system possibly can't handle more than 10 requests per minute anymore? Also my hoobs setup will show that this Telldus Bridge is not fully running yet, but it supposedly has found 9 devices and 4 sensors.

18/12/2023, 08:41:27Telldus BridgeTelldus Liv!e429 == 200
18/12/2023, 08:41:27Telldus BridgeWARNINGunhandled rejection: AssertionError [ERR_ASSERTION]: 429 == 200

@mifi
Copy link
Collaborator

mifi commented Dec 18, 2023

429 probably means rate limited. so probably it's sending too many commands too fast

@yflorack
Copy link

yflorack commented Dec 18, 2023

Is there any way to add a delay between those commands, or check if more than 10 commands are sent?

If i switch the whole setup to use “local”, will all the requests then run over the local tellstick instead of via the telldus server api?

@tellustheguru
Copy link
Author

Yes. If you switch to local, you can make unlimited requests because homebridge speak directly to Telldus Stick. The only time homebridge will speak with Telldus API is ones a year to renew local token.

@yflorack
Copy link

Hm, looks like installing local also doesnt work at the moment :( . maybe also something related to the api changes?

got this when trying to access the Tellstick after the command telldus-local-auth [IP of Tellstick] homebridge-telldus:

404 Not Found
The path '/tellduslive/authorize' was not found.

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in call
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in call
File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 230, in call
File "/usr/lib/python2.7/site-packages/web/base/Server.py", line 202, in handle
NotFound: (404, "The path '/tellduslive/authorize' was not found.")

@kernie66
Copy link

Are you sure you run the correct command? The error message is not related to the linked command from the Readme file.

Otherwise you can get the token manually as described here:
https://tellstick-server.readthedocs.io/en/v1.3.2/api/authentication.html

@yflorack
Copy link

I actually found another thread with the same issue described, and it seemed there was a cache issue with the browser, so using an incognito browser using google chrome did the trick.

@runbert
Copy link

runbert commented Dec 21, 2023

I still haven't got my Tellstick Net device to work with homebridge since they changed the APIs. I get the 429 error. I do although also have a USB Tellstick (https://www.clasohlson.com/se/TellStick-USB-fjarrstyrning/p/36-3969) and wonder if it is possible to use that with a raspberry pi and this API? I think that would be the best solution to run everything local on the pi, but do not know how to setup and configure it in unix. Any help is appreciated

@fknorn
Copy link

fknorn commented Jan 18, 2024

just delete your yarn.lock/package-lock.json and node_modules

Hi there, could someone please explain in more detail what that means or how to do this? Thanks so much!!

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

8 participants