sinricpro / help-docs

https://help.sinric.pro help documentation
0 stars 2 forks source link

IFTTT webhook doesn't process value parameter #12

Open bertenvdb opened 2 years ago

bertenvdb commented 2 years ago

I've linked IFTTT to a garage door device in SinricPro. Triggering the applet in ifff gets logged in SinricPro and my connected garage door responds accordingly. However, I can only open my garage door, sending the call to close the door also opens it.

{ "api_key": "7ff5f0a8-167d-46ac-b591-22e5fb39f86d", "device_id": "61c4f61d695fce5c875074e5", "action": "setMode", "value": { "test": "why" } } Above body triggers a 'Close door' event. Below body does the same. { "api_key": "7ff5f0a8-167d-46ac-b591-22e5fb39f86d", "device_id": "61c4f61d695fce5c875074e5", "action": "setMode", "value": { "state": true } }

I'v tried everything I could think of: state: false, state: 0, state: 1, state: "On", state: "on", state: "Off", state: "off", "mode": On, mode: 1, mode: false, ...

  1. In SinricPro: Create garage door device
  2. Either make the call in Postman or create applet in IFTTT and link to SinricPro as described in https://help.sinric.pro/pages/ifttt.html
  3. Make the call in Postman or trigger the applet in IFTTT

I'd like to be able to open AND close my garagedoor using IFTTT.

kakopappa commented 2 years ago

Looks like the payload is wrong.

{ ..... "action": "setMode", "value": { "mode": "open" } }

You also see the same in the Arudio Serial Monitor when you enable SDK logs

example messages: https://github.com/sinricpro/sample_messages/tree/master/21_SetMode

feyhong11 commented 2 years ago

Hi, I think i have some trouble with "action": "setMode", "value": { "mode": "close"} . This commnad seem don't work on me but it is {"success"= true}. Would I have another commnd to send close to garagedoor please?

kakopappa commented 2 years ago

complete payload is like this. Have you specified the API key and device id and are they correct?

{ "api_key":"API key from step 1", "device_id":"device id from portal", "action":"setMode", "value":{ "mode":"close" }}

On Sun, 10 Jul 2022 at 5:31 PM feyhong11 @.***> wrote:

Hi, I think i have some trouble with "action": "setMode", "value": { "mode": "close"} . This commnad seem don't work on me but it is {"success"= true}. Would I have another commnd to send close to garagedoor please?

— Reply to this email directly, view it on GitHub https://github.com/sinricpro/help-docs/issues/12#issuecomment-1179700966, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZXOHBA73S4NCOECLZ3VTKRBRANCNFSM5KV6LHXQ . You are receiving this because you commented.Message ID: @.***>

feyhong11 commented 2 years ago

Dear, Kaokopappa Thank you for your quick response. I tested following your code and already rechecked the API key and device id The server also success to receive the massage from my request however it seem work merely {"mode":"open"}

Thank you for any help that you provide

Image: https://imgur.com/a/JJdMwkc

kakopappa commented 2 years ago

Hi @feyhong11

I have tested everything and seems to work correctly.

When you send an HTTP request using the curl command, does it work for you?

curl --location --request POST 'https://ifttt.sinric.pro/v1/actions' \
--header 'x-sinric-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
   "api_key":"xxxxxx",
   "device_id":"xxxxx",
   "action":"setMode",
   "value": { "mode": "close"}
}'

image