OpenWonderLabs / SwitchBotAPI

SwitchBot Open API Documents
887 stars 73 forks source link

Scene execution URL not working #322

Open MartinMartinov opened 4 months ago

MartinMartinov commented 4 months ago

Current Situation

I'm trying to activate a scene in Python, but I'm having trouble. I can get the device list using https://api.switch-bot.com/v1.1/scenes and an authenticated header, and I can get the device list and activate devices using the same header, but when I try to active scenes using:

https://api.switch-bot.com/v1.1/scenes/{sceneId}/execute

I get a generic wrong URL response. Is the format of the sceneId in the response to https://api.switch-bot.com/v1.1/scenes different than what I should put in for the execute URL? I notice the sample sceneIDs in the README have a different format to the response I get (which is a UUID).

Logs

https://api.switch-bot.com/v1.1/scenes/[redacted]/execute
{'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=[redacted]"}

Configuration

My header definitions (following the sample):
self.headers = {
    'Authorization': token,
    'Content-Type': 'application/json; charset=utf8',
    't': str(t),
    'sign': str(sign, 'utf-8'),
    'nonce': str(nonce),
}

Environment

Additional Context

No response

milty456 commented 2 months ago

Having same issue as well