a constantly growing catalog of templates for various customizable scripts can be found here:
Official script templates
-
Der_Stumme -
12. Januar 2022 um 21:58 -
Unerledigt
-
-
There's something wrong with your link. It links back to this thread.
-
How can I convert this ES6 script to valid Shelly HTTP POST.
My target is to call Tibber service and get todays price information.Code
Alles anzeigenconst options = { method: 'POST', headers: { 'Authorization': 'Bearer '+apiKey, 'Content-Type': 'application/json' }, body: {} }; const tibberCall = (payLoad,funcProcess) => { // https://javascript.info/fetch options.body = payLoad; fetch('https://api.tibber.com/v1-beta/gql',options) // fetch(tibberUrl,options) .then(function(response) { if (!response.ok) { throw Error(response.statusText); } return response; }) .then( response => response.json() ) .then(function(response) { console.log("ok"); //console.log("json:"+JSON.stringify(response.data.viewer) ); funcProcess(response); }).catch(function(error) { console.log("catch-error: "+error); }); };
-
Here is a small shelly scripting video tutorial: