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

API Control of Air Conditioner Not Functioning Properly Since 11/8 (JST) #363

Open
yyverse opened this issue Nov 14, 2024 · 18 comments
Open
Assignees
Labels
question Further information is requested

Comments

@yyverse
Copy link

yyverse commented Nov 14, 2024

Current Situation

Since last week, starting on November 8th at 5:00 PM JST, I've been unable to control my air conditioner via the API using infrared commands. However, controlling the air conditioner from the SwitchBot app works fine. I kindly request you to investigate this issue.

Logs

My script attempts to operate the air conditioner every 5 minutes, and it has been functioning normally for over a year without any issues like this. I can determine whether the operations are successful by checking the history in the SwitchBot app.

Configuration

The following command is being used:


parameter = "2,1,1,on"
commands = dict(
    command = 'setAll',
    parameter = parameter,
    commandType = 'command',
)
set_commands(deviceId, commands)


### Environment

- OS: Debian GNU/Linux 11 (bullseye)
- Software: Python3.9
- Node: PC
- npm:


### Additional Context

Please assist in identifying and resolving the issue affecting API-based operations.
@yyverse yyverse added the question Further information is requested label Nov 14, 2024
@tcavin
Copy link

tcavin commented Nov 15, 2024

Hi,
I can also confirm there is something wrong with the API when sending command to my Air Conditioner
I didn't change any line of my code
Whatever command requested to the API (see below for mine), It always seems to transmit a default command (25, cold, ...)

My command :

{
    "command": "setAll",
    "parameter": "22,5,1,off",
    "commandType": "command"
}

I checked this behavior with v1.0 of the API, but also with v1.1
Thanks for your help solving this issue

@Michel-Bos-HA
Copy link

Michel-Bos-HA commented Nov 16, 2024

Hi there, I encountered this issue since this morning, 16th November, starting around 10.45 AM.

Any command from within Homey results in "Cold, 25".

From the Switchbot app it is fine. In the log however, for every request from Homey it states 'Device not found or cannot reach device, try again' (openapi)

@davidsak
Copy link

Just chiming in to say I’m having the same issue sending commands to my AC. If I send the “turnOn” or “turnOff” command it works fine but “sandaAll” no longer works. Everything was working fine before and nothing was modified in my code.

@tcavin
Copy link

tcavin commented Nov 19, 2024

Hi, I can also confirm there is something wrong with the API when sending command to my Air Conditioner I didn't change any line of my code Whatever command requested to the API (see below for mine), It always seems to transmit a default command (25, cold, ...)

My command :

{
    "command": "setAll",
    "parameter": "22,5,1,off",
    "commandType": "command"
}

I checked this behavior with v1.0 of the API, but also with v1.1 Thanks for your help solving this issue

@yyverse could you change the label from question to bug ?

@SwitchBot-Wonderlabs could you investigate because this bug blocks our installations, thx 🙏

@Michel-Bos-HA
Copy link

It looks like the openapi issue is solved. My commands seem to work. Fingers crossed off course :-)

@SeraphicRav
Copy link

Home Assistant Cloud integration is also impacted. Doing API requests directly does not work either.

Issue in Home Assistant :
home-assistant/core#130516 (comment)

@SeraphicRav
Copy link

It looks like the openapi issue is solved. My commands seem to work. Fingers crossed off course :-)

Some users reported the issue in Home Assistant but it worked for me. I guess some servers are faulty, others not...

@zibbs
Copy link

zibbs commented Nov 21, 2024

Still doesn't work for me... In the switchbot app works fine, but not though the api or integration in HA.

@davidsak
Copy link

setAll with a decimal in the temperature parameter does not seem to work anymore but if called with an integer it does. So for instance, “20.3,5,2,on” does not work but “20,5,2,on” does.

@irfane29
Copy link

I have an issue with controlling A/C temperature through home assistant, it was working until now. But with the switchbot app, all commands are working fine.
Please check on your server side what the issue, thanks

@rpaillot
Copy link

HVAC command started working again 2 or 3 days ago, but "temperature" doesn't work in HA.

"“Failed to call service climate/set_temperature. Unknown error”" (translated from FR)

@MrXANA91
Copy link

setAll with a decimal in the temperature parameter does not seem to work anymore but if called with an integer it does. So for instance, “20.3,5,2,on” does not work but “20,5,2,on” does.

Can confirm

@zibbs
Copy link

zibbs commented Nov 25, 2024

setAll with a decimal in the temperature parameter does not seem to work anymore but if called with an integer it does. So for instance, “20.3,5,2,on” does not work but “20,5,2,on” does.

Can confirm

I never used decimals and still doesn't work for me. Seems like nothing is called. The HUB doesn't blink when the command is send.

@rpaillot
Copy link

I just got an email answer from switchbot saying they fixed the issue.
Indeed we can now turnoff and turnon the ACs and set heat or cold and it works.

But we need to be able to set the temperature and I sent them a bunch of screen capture of what's happening. Hoping they will fix that too in a few days.

@darkaeden
Copy link

Turn ON/OFF/HEat/Cold works yet setting a different temperature than default triggers climate/set_temperature failure.

@rpaillot
Copy link

rpaillot commented Dec 2, 2024

Turn ON/OFF/HEat/Cold works yet setting a different temperature than default triggers climate/set_temperature failure.

Absolutely. same issue. Still ongoing

@rpaillot
Copy link

rpaillot commented Dec 2, 2024

Ok I have some news
I think something in the API may have changed or something was broken in the Switchbot Cloud Integration, either way.
Switchbot support advised me to read the API documentation again, then in
Terminal I used this command

curl -X POST "https://api.switch-bot.com/v1.0/devices/-YOUR-DEVICE-ID-HERE/commands"
-H "Content-Type: application/json"
-H "Authorization: Bearer YOUR API KEY HERE"
-d '{
"command": "setAll",
"parameter": "22,5,1,on",
"commandType": "command"
}'

And this seems to work perfectly and seems to change the temperature also.

Here's the section of the API

Screenshot 2024-12-02 at 10 12 34

I dont know how to use GitHub efficiently, how can we contact here the developer of the switchbot cloud integration to fix the issue ?

I could make automations to send curl commands, but not very friendly ;)

@SeraphicRav
Copy link

SeraphicRav commented Dec 4, 2024

It is OK, I am following the conversation, I made a bugfix pull request: home-assistant/core#132231

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

No branches or pull requests