VPN/Proxy erkannt
Es scheint, dass Sie einen VPN- oder Proxy-Dienst verwenden. Bitte beachten Sie, dass die Nutzung eines solchen Dienstes die Funktionalität dieser Webseite einschränken kann.
-
I am trying to write a script so the Shelly is sending a REST request to a external server.
The info I need is:
how to add a header to the request using Shelly.call() ?
I am getting response.code 401, it seems that the header with the auth info is not send correctly.
My script so far :
Shelly.call(
"HTTP.GET",
{"url": "https://abcd.com",
"headers": {"API-Key": "abcdefg"},
"Content-Type":"application/json"},
function (response) {
print("processing response");
if (response && response.code && response.code === 200) {
print("response.code : ", response.code);
print(JSON.stringify(response.body));
Shelly.emitEvent("HTTP-result", response.body);
}
else {
print("Error: HTTP request failed.");
print("response.code : ", response.code);
}
}
);
Alles anzeigen
Edit by 66er:
Code placed in Code-Tag
-
-
Thank you all for your answers !
I will test a Shelly Pro 1PM and the Shelly Pro Ad-On in use with the Shelly Pro i4.
-
I need to upload a script for the action.
Can the Shelly Plus 1 also used with custom scripts ?
-
Thank you for your feedback.
Yes I did, but I don't have DC provide power to them.
But I just saw the Shelly Add-on.
And if I am understanding it correctly I can use that a a hat connect a simple on/off or button to the digital in connector.
This would solve my requirements.
-
I am new to the shelly product line and got now my fist shelly's.
One of them is the Shelly i4 AC version.
I thought I could attach a simple close switch to the inputs but I am wrong.
The input is not a high / low signal it is a detected current flow and it uses the 110/230V connector.
This means I can not use the i4 for for my home automation project, but for some of my other projects it is perfect.
Question:
Is there a Shelly available which can simple be used with a low voltage open/close switch instead of using 110/230V ?
Create would be to have the i4 with a extra 5V/3,3V out connector which can be used to attach the low voltage switch.
This should be easy as internally is a ESP32 doing the job.