OpenWonderLabs / SwitchBotAPI

SwitchBot Open API Documents
830 stars 70 forks source link

Custom IR device wont work #65

Closed 1liminal1 closed 2 years ago

1liminal1 commented 2 years ago

I can get a list of devices doing:

curl -H "Authorization:xxxxxxxxxxxxxxxxxxxx" https://api.switch-bot.com/v1.0/devices

I see the device in the list of devices

"infraredRemoteList":[{"deviceId":"xxxxxxxxxxxxxxxxxxxxxx","deviceName":"Bedroom Fan","remoteType":"Others","hubDeviceId":"xxxxxxxxxxxxxxxx"}]}

But If I try to get the status:

curl -H "Authorization:xxxxxxxxxxxxxxxxxxxxxxxx" https://api.switch-bot.com/v1.0/devices/xxxxxxxxxxxxxxxxxxx/status

I get the following error:

{"statusCode":190,"body":{},"message":"wrong deviceId"}

Also I have added this as a switch into Home Assistant. I have three switchbot and two curtains. all works fine.

But cant get the fan to do anything

my code

Thanks so much :)

I can get a list of devices doing:

curl -H "Authorization:xxxxxxxxxxxxxxxxxxxx" https://api.switch-bot.com/v1.0/devices

I see the device in the list of devices

"infraredRemoteList":[{"deviceId":"xxxxxxxxxxxxxxxxxxxxxx","deviceName":"Bedroom Fan","remoteType":"Others","hubDeviceId":"xxxxxxxxxxxxxxxx"}]}

But If I try to get the status:

curl -H "Authorization:xxxxxxxxxxxxxxxxxxxxxxxx" https://api.switch-bot.com/v1.0/devices/xxxxxxxxxxxxxxxxxxx/status

I get the following error:

{"statusCode":190,"body":{},"message":"wrong deviceId"}

Should turn on the fan

Im not posting for security

Device Model:

Custom IR device (fan) added to hub

SwitchBotAPI

Using HA to turn on and off bedroom fan

github-actions[bot] commented 2 years ago

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.

1liminal1 commented 2 years ago

Anyone?

QuixThe2nd commented 2 years ago

Im facing the same issue using homebridge.

AdyRock commented 2 years ago

It is not possible to get the status of remote devices as they are send only devices. The API document says this:

Get the status of a physical device that has been added to the current user's account.

Physical devices refer to the following SwitchBot products,

Bot
Plug
Curtain
Meter
Motion Sensor
Contact Sensor
Color Bulb
Humidifier
Smart Fan
1liminal1 commented 2 years ago

Ok that does make sense. I did manage to get in working. Custom button commands are whatever you name them. ie On and not TurnOn

QuixThe2nd commented 2 years ago

@1liminal1 You could always use IFTTT, that's what I ended up using.