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

Bug: API No Connection #1139

Open
dampney opened this issue Dec 17, 2024 · 2 comments
Open

Bug: API No Connection #1139

dampney opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@dampney
Copy link

dampney commented Dec 17, 2024

Describe the Bug

Errors with API connection. No devices found.

To Reproduce

Uninstalled Plugin due to other bugs, removed bridge from HomeKit.
Reset token in SB app
Reinstalled plugin, added new token / secret, child bridge added to HomeKit.
Restarted HB.

Expected Behavior

Have reinstalled the SB plugin half a dozen times over the last few weeks to months due to bugs with this plugin. Have basically given up with dealing with the issues. Now wanting the plugin to work for some simple IR lights instead of relying on major devices (AC, multiple bots etc).

Relevant Log Output

[12/17/2024, 10:40:27 PM] [SwitchBot] Failed to get d evices: getaddrinfo ENOTFOUND api.switch-bot.com
[12/17/2024, 10:40:27 PM] [SwitchBot] Failed to get d evices: getaddrinfo ENOTFOUND api.switch-bot.com
[12/17/2024, 10:40:27 PM] [SwitchBot] Failed to get d evices: getaddrinfo ENOTFOUND api.switch-bot.com
112/17/2024, 10:40:27 PM] [SwitchBot] Failed to get d evices: getaddrinfo ENOTFOUND api.switch-bot.com
112/17/2024, 10:40:27 PM] [SwitchBot] Failed to get d evices: getaddrinfo ENOTFOUND api.switch-bot.com

Config for homebridge-switchbot

{    "name": "SwitchBot",    "credentials": {        "token": "xxx",        "secret": "xxx",        "notice": "Keep your Token & Secret a secret!"    },    "_bridge": {        "username": "0E:D7:1B:2F:23:63",        "port": 47836    },    "platform": "SwitchBot"}

Screenshots

IMG_8426
IMG_0015

Device and Model

Mac Mini Late

Node.js Version

V20.10.p

NPM Version

TBC

Homebridge Version

V1.8.5

Homebridge Switchbot Plugin Version

V4.1.5

Homebridge Config UI X Plugin Version

V4.65.1

Operating System

macOS

@blanky
Copy link

blanky commented Dec 17, 2024

Having the same issues, using Cloudflare as DNS.
Doing a dig with Cloudflare and Google:

(base) ➜  ~ dig api.switch-bot.com

; <<>> DiG 9.10.6 <<>> api.switch-bot.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62340
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;api.switch-bot.com.		IN	A

;; ANSWER SECTION:
api.switch-bot.com.	3180	IN	CNAME	api.switchbot.net.

;; AUTHORITY SECTION:
switchbot.net.		480	IN	SOA	ns-1478.awsdns-56.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400

;; Query time: 14 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Dec 17 22:29:58 AEST 2024
;; MSG SIZE  rcvd: 160

(base) ➜  ~ dig @8.8.8.8 api.switch-bot.com

; <<>> DiG 9.10.6 <<>> @8.8.8.8 api.switch-bot.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37095
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;api.switch-bot.com.		IN	A

;; ANSWER SECTION:
api.switch-bot.com.	426	IN	CNAME	api.switchbot.net.

;; AUTHORITY SECTION:
switchbot.net.		592	IN	SOA	ns-1478.awsdns-56.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400

;; Query time: 27 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Dec 17 22:30:09 AEST 2024
;; MSG SIZE  rcvd: 160

Interestingly, if I hop on a VPN to the USA it seems to work (am based in Australia).

(base) ➜  ~ dig api.switch-bot.com

; <<>> DiG 9.10.6 <<>> api.switch-bot.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64557
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;api.switch-bot.com.		IN	A

;; ANSWER SECTION:
api.switch-bot.com.	3600	IN	CNAME	api.switchbot.net.
api.switchbot.net.	300	IN	CNAME	d-99k5evl0bf.execute-api.us-east-1.amazonaws.com.
d-99k5evl0bf.execute-api.us-east-1.amazonaws.com. 60 IN	A 34.203.59.42
d-99k5evl0bf.execute-api.us-east-1.amazonaws.com. 60 IN	A 54.208.27.114
d-99k5evl0bf.execute-api.us-east-1.amazonaws.com. 60 IN	A 34.227.3.41

;; Query time: 212 msec
;; SERVER: 10.0.0.243#53(10.0.0.243)
;; WHEN: Tue Dec 17 22:32:42 AEST 2024
;; MSG SIZE  rcvd: 185

That's about as far as I got, DNS is not my forte.

@domre77
Copy link

domre77 commented Dec 27, 2024

Same here. Nothing but issues with the API for months. Had to switch to BLE, which is unreliable but works most of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants