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 · 5 comments
Open

Bug: API No Connection #1139

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

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.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 11, 2025
@domre77
Copy link

domre77 commented Jan 11, 2025

Marked as stale? I know it’s automatic, but this a major bug that completely breaks the API part of the plugin, and it’s persisted for months. I understand people are busy, and I thank them for there work up until now, but, I read this as the big is not being fixed?

Maybe it’s time to move to Home Assistant for me I think.

@dampney
Copy link
Author

dampney commented Jan 11, 2025

@domre77, I just starting testing the Switchbot integration on HA.

TL;DR
SB into HA into HomeKit. Works well so far, not all devices are supported, AC is thermostat only, not Heater-Cooler.


I'm seeing IR lights, IR AC and Hub 2 temp/humidity sensors but not any bots, not a IR on/off switch and no Hub 2 light sensor / buttons.

My AC is a split-system with the Hub 2 IR blaster. The HA integration into HomeKit has worked reliable so far.

There seems to be no support for Heater-Cooler, so HA pushes the device into HK as a thermostat.

A thermostat is fine but there is no "Off" selection within the controls but a separate on/off switch.

It's easy to change this switch into a fan in HomeKit so the device shows up under Climate controls.

The SB integration in HA does connect via the API - so a lack of local support if the internet goes down (thanks NBN).

I had relied on the SB Homebridge plugin for several years now due to Matters lack of controls and SB bugs.

Hope this helps

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

No branches or pull requests

8 participants