toddaustin07 / webrequestor

Web Requestor Edge Driver
Apache License 2.0
21 stars 8 forks source link

Web request being called twice #4

Closed leftyfb closed 1 year ago

leftyfb commented 1 year ago

I have webrequestor and edgebridge working swimingly! It completely replaces the webcore rule I thought I would never be able to get back.

That said, every time I execute my "Request #1", whether it's from the Web Req Multi Master device or through automation, 2 requests are sent to the edge bridge. See the below edgebridge log output as an example of a single execution:

Mon Jan 16 17:31:08 2023  **********************************************************************************
Mon Jan 16 17:31:08 2023  POST request received from: ('192.168.0.22', 57430)
Mon Jan 16 17:31:08 2023  Endpoint: /api/forward?url=https://maker.ifttt.com/trigger/button_pressed/with/key/*REMOVED*
Mon Jan 16 17:31:08 2023  Sending POST to https://maker.ifttt.com/trigger/button_pressed/with/key/*REMOVED*
Mon Jan 16 17:31:08 2023  Headers: {'Host': 'maker.ifttt.com', 'Accept': '*/*', 'User-Agent': 'SmartThings Edge Hub', 'Content-Length': '103', 'Content-Type': 'application/json'}
Mon Jan 16 17:31:08 2023  Body: {"value1":"=TODAY()","value2":"=NOW()","value3":"=((DATEDIF(A2,INDIRECT(\"A\"&ROW()),\"D\")/2)-ROW())"}
Mon Jan 16 17:31:08 2023  Returned data: Congratulations! You've fired the button_pressed event
Mon Jan 16 17:31:08 2023  Response sent
Mon Jan 16 17:31:08 2023  Response returned to Edge driver
Mon Jan 16 17:31:09 2023  **********************************************************************************
Mon Jan 16 17:31:09 2023  POST request received from: ('192.168.0.22', 57440)
Mon Jan 16 17:31:09 2023  Endpoint: /api/forward?url=https://maker.ifttt.com/trigger/button_pressed/with/key/*REMOVED*
Mon Jan 16 17:31:09 2023  Sending POST to https://maker.ifttt.com/trigger/button_pressed/with/key/*REMOVED*
Mon Jan 16 17:31:09 2023  Headers: {'Host': 'maker.ifttt.com', 'Accept': '*/*', 'User-Agent': 'SmartThings Edge Hub', 'Content-Length': '103', 'Content-Type': 'application/json'}
Mon Jan 16 17:31:09 2023  Body: {"value1":"=TODAY()","value2":"=NOW()","value3":"=((DATEDIF(A2,INDIRECT(\"A\"&ROW()),\"D\")/2)-ROW())"}
Mon Jan 16 17:31:09 2023  Returned data: Congratulations! You've fired the button_pressed event
Mon Jan 16 17:31:09 2023  Response sent
Mon Jan 16 17:31:09 2023  Response returned to Edge driver
toddaustin07 commented 1 year ago

I don't know if you are experiencing the same thing, but I have seen similar cases during my development activities and a hub reboot is needed to cure the problem. Somehow the platform gets into a state where it duplicates commands.

Let me know if that doesn't help. It may be something else.

leftyfb commented 1 year ago

That worked. Thank you. Now to figure out how to add the current date and time to the body of the POST.