Giter VIP home page Giter VIP logo

Comments (14)

hzx1987227 avatar hzx1987227 commented on July 30, 2024 1

image
image
image

Check the setting,

My device is SwitchBot Curtain.

from switchbotapi.

duceduc avatar duceduc commented on July 30, 2024

I am having issues as well but I am using curl over CLI. These commands works:
https://api.switch-bot.com/v1.0/devices
https://api.switch-bot.com/v1.0/statues

What isn't working for me is POST:
https://api.switch-bot.com/v1.0/devices/{mac}/turnOn

{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=TOKEN"}

How are you setting the Authorization part in Postman? I am getting unauthorized error. I think I am not adding the token key correctly.

Edit: I figured out how to properly add the token. I get this error using this url.
https://api.switch-bot.com/v1.0/devices/{MAC}/commands

What is the proper url to have the curtain fully open/close?

"statusCode": 190,
"body": {},
"message": "param is invalid"

from switchbotapi.

hzx1987227 avatar hzx1987227 commented on July 30, 2024

I am having issues as well but I am using curl over CLI. These commands works:
https://api.switch-bot.com/v1.0/devices
https://api.switch-bot.com/v1.0/statues

What isn't working for me is POST:
https://api.switch-bot.com/v1.0/devices/{mac}/turnOn

{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=TOKEN"}

How are you setting the Authorization part in Postman? I am getting unauthorized error. I think I am not adding the token key correctly.

Edit: I figured out how to properly add the token. I get this error using this url.
https://api.switch-bot.com/v1.0/devices/{MAC}/commands

What is the proper url to have the curtain fully open/close?

"statusCode": 190,
"body": {},
"message": "param is invalid"

You can add the following context to the body then select the raw with json format

{
"command": "turnOn",
"parameter": "default",
"commandType": "command"
}

from switchbotapi.

duceduc avatar duceduc commented on July 30, 2024

Getting this error now.

"statusCode": 190,
"body": {},
"message": "ExpressionAttributeValues must not be empty"

Error Message

from switchbotapi.

hzx1987227 avatar hzx1987227 commented on July 30, 2024

Getting this error now.

"statusCode": 190,
"body": {},
"message": "ExpressionAttributeValues must not be empty"

Error Message

Post Url is :

https://api.switch-bot.com/v1.0/devices/C2F1406*****/commands

Try uncheck the Content-Type in Headers tab.

from switchbotapi.

duceduc avatar duceduc commented on July 30, 2024

This is my post URL
https://api.switch-bot.com/v1.0/devices/C5C6DFDH83EJ/commands

I have tried unchecking Content-Type. Still same error.

from switchbotapi.

duceduc avatar duceduc commented on July 30, 2024

So weird. I am also using the curtain bot and matched your settings. Still error occurs.
Error code 190 is:

190 | System error | Device internal error due to device states not synchronized with server

settings

from switchbotapi.

donavanbecker avatar donavanbecker commented on July 30, 2024

Check out: homebridge-switchbot-openapi, I haven't implemented curtains yet, but connection to API is solid.

from switchbotapi.

hzx1987227 avatar hzx1987227 commented on July 30, 2024

So weird. I am also using the curtain bot and matched your settings. Still error occurs.
Error code 190 is:

190 | System error | Device internal error due to device states not synchronized with server

settings

emmmm...

Try use SwitchBot App move your curtain first?

Then post the api?

I have no idea...

from switchbotapi.

hzx1987227 avatar hzx1987227 commented on July 30, 2024

Check out: homebridge-switchbot-openapi, I haven't implemented curtains yet, but connection to API is solid.

When i rebooted the Hub mini, the command API worked again,may be this is a bug for Hub mini

from switchbotapi.

github-actions avatar github-actions commented on July 30, 2024

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.

from switchbotapi.

github-actions avatar github-actions commented on July 30, 2024

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

from switchbotapi.

apetryk2 avatar apetryk2 commented on July 30, 2024

I just wanted to point out that anyone that is getting the ExpressionAttributeValues must not be empty make sure to enable cloud service on your switchbot device. I was getting this error and then when I enabled cloud services (via the app) the error went away.

from switchbotapi.

robindbe avatar robindbe commented on July 30, 2024

Some extra info about the 'ExpressionAttributeValues' error as you'll probably end up here. It also occurs if you try to move a curtain in a group (2 curtains grouped together, for middle opening) and you're not moving the master curtain. Using the master's ID solves the issue.

from switchbotapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.