{"id":76275,"date":"2024-11-29T14:59:25","date_gmt":"2024-11-29T13:59:25","guid":{"rendered":"https:\/\/support.ilevia.com\/?p=76275"},"modified":"2025-02-27T09:00:15","modified_gmt":"2025-02-27T08:00:15","slug":"script-sunset-sunrise-times-with-online-api","status":"publish","type":"post","link":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/","title":{"rendered":"Script Sunset Sunrise times with online API"},"content":{"rendered":"[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||||false|false&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||||false|false&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||||false|false&#8221; global_colors_info=&#8221;{}&#8221;]\n<h1 style=\"text-align:center\">Script attivazione allarme dal orari alba e tramonto attraverso API online<\/h1>\n[\/et_pb_text][et_pb_divider _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_divider][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||||false|false&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]\n<blockquote>\n<h2>INTRODUZIONE<\/h2>\n<\/blockquote>\n<p>La seguente guida spiega in dettaglio come costruire lo script e come funziona. Lo script recurerer\u00e0 le informazioni online attraverso delle richieste HTTP da delle API online. infine processer\u00e0 le informazioni e azioner\u00e0 i componenti impostati.<\/p>\n[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]\n<blockquote>\n<h3>Configurazione componenti<\/h3>\n<\/blockquote>\n[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 1:<\/strong><\/p>\n<p>Apri il software di configurazione <a href=\"\/configuration-software-en\/overview\" target=\"_blank\" rel=\"noopener\">Ilevia Manager<\/a> accedi alla sezione <strong>Componenti<\/strong>. Apri il men\u00f9 <strong>Home automation<\/strong> e aggiungi i seguenti componenti:<\/p>\n<\/p>\n<ul>\n<li>2 <a href=\"\/configuration-software-en\/switch\" target=\"_blank\" rel=\"noopener\">Interruttore<\/a> component;<\/li>\n<li>4 <a href=\"\/configuration-software-en\/info\" target=\"_blank\" rel=\"noopener\">Info<\/a> components;<\/li>\n<li>1 <a href=\"\/configuration-software-en\/lock\" target=\"_blank\" rel=\"noopener\">Lucchetto<\/a> component;<\/li>\n<li>1 <a href=\"\/configuration-software-en\/script\" target=\"_blank\" rel=\"noopener\">Script<\/a> component.<\/li>\n<\/ul>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step1.png&#8221; alt=&#8221;Components needed to build the script wihtin the Ilevia&#8217;s configuration software.&#8221; title_text=&#8221;Script-lock-home_Step1&#8243; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 2:<\/strong><\/p>\n<p>Apri l&#8217;editor del componente <a href=\"\/configuratio-software-en\/script\" target=\"_blank\" rel=\"noopener\">Script<\/a>.[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step2.png&#8221; alt=&#8221;How to enter into the script editor of the Script component with the Ilevia Manager.&#8221; title_text=&#8221;Script-lock-home_Step2&#8243; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]\n<blockquote>\n<h3>Panoramica Scirpt<\/h3>\n<\/blockquote>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_scriptoverview.png&#8221; alt=&#8221;Script overview&#8221; title_text=&#8221;Script-lock-home_scriptoverview&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 3:<\/strong><\/p>\n<p>Creazione prima variabile che contiene la <strong>richiesta HTTP<\/strong> per gli orari dell&#8217;alba e il tramonto.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step3.png&#8221; alt=&#8221;Variable that will take the information from the HTTP request within the Ilevia configuration software.&#8221; title_text=&#8221;Script-lock-home_Step3&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 4:<\/strong><\/p>\n<p>Aggiungi la prima funzione, la funzione chiamata <b>Sunrise_sunset<\/b> eseguir\u00e0 il <b>Parse<\/b> del payload che in questo esempio \u00e8 rappresetentato dalla variabile &#8220;<b>Payload<\/b>&#8220;, Dopo di che crea una variable che contiene il parse della variable &#8220;<b>Payload<\/b>&#8221; chiamata &#8220;<b>Sunrisetime_ok<\/b>&#8220;, questa variabile contiene il parse dell&#8217;ora dell&#8217;Alba derivante dalla richiesta HTTP, Infine la stampa all&#8217;interno del componente con ID <b>18<\/b>.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step4.png&#8221; alt=&#8221;First part of the first function, here is shown how to gather the information from the jxon coming from the HTTP request.&#8221; title_text=&#8221;Script-lock-home_Step4&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 5:<\/strong><\/p>\n<p>Lo stesso processo viene applicato con l&#8217;ora del tramonto, la nuova variabile chiamata &#8220;<b>sunsettime<\/b>&#8221; conterr\u00e0 il parse dell&#8217;ora del Tramonto derivante dal Json derivante dalla richiesta HTTP dalla variabile  &#8220;<b>Payload<\/b>&#8220;. infine impostare il valore nel componente con <b>ID 19<\/b>.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step5.png&#8221; alt=&#8221;Second part of the first script, this will take the Sunset time from the json of te &#8221; title_text=&#8221;Script-lock-home_Step5&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 6:<\/strong><\/p>\n<p>La nuova variabile chiamata &#8220;<b>currenttime<\/b>&#8220;, questa far\u00e0 una richiesta HTTP che ritornera l&#8217;ora attuale in base alla tuo <b>fuso orario<\/b>. Una nuova variabile viene create chiamata &#8220;<b>timesettings<\/b>&#8221; che far\u00e0 il parse del Json derivante dalla <b>richiesta HTTP<\/b> e estrapolare il dato dell&#8217;ora attuale dal json.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step6.png&#8221; alt=&#8221;HTTP request for the current time&#8221; title_text=&#8221;Script-lock-home_Step6&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 7:<\/strong><\/p>\n<p>Il prossimo passo \u00e8 estrapolare il valore dell&#8217;Ora, Minuti e secondi. Vengono quindi create tre nuove variabili, dove ogni una di queste prender\u00e0 una parte dell&#8217;informazione dal json. Il prossimo passo \u00e8 assemblare gli elementi contenenti i valori di tempo all&#8217;interno di un valore di tempo unico, quindi viene creata variabile chiamata <b>todayTime<\/b>. Infine il risultato viene aggiunto all&#8217;interno del componente con <b>ID 20<\/b>.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step7.png&#8221; alt=&#8221;This part of the function will take the three time value (Hour. Minute, second) from the json coming from the&#8221; title_text=&#8221;Script-lock-home_Step7&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 8:<\/strong><\/p>\n<p>Il passo successivo si determiner\u00e0 se l&#8217;ora \u00e8 AM o PM. La nuova variabile chiamata &#8220;<b>period<\/b>&#8221; serve per impostare la sigla AM e PM All&#8217;ora attuale. Then converts the current time from 24 h clock to 12 h. Finally assemble the current time and print the value into the component with <b>ID 21<\/b>.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step8.png&#8221; alt=&#8221;Converting 24 hour clock time to 12 hour clock&#8221; title_text=&#8221;Script-lock-home_Step8&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 9:<\/strong><\/p>\n<p>Per poter applicare un aggiornamento alla funzione &#8220;<b>Sunrise_sunset<\/b>&#8220;, la nuova funzione chiamata &#8220;<b>Over<\/b>&#8220;. Questa funzione imposta un <b>Intervallo<\/b> alla funzione principale. questo eseguir\u00e0 la funzione ripetutamente.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step9.png&#8221; alt=&#8221;Setting a time interval so the function sunset sunrise keep getting triggered.&#8221; title_text=&#8221;Script-lock-home_Step9&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 10:<\/strong><\/p>\n<p>L&#8217;ultima funzione dello script cambier\u00e0 il valore di uno componente <a href=\"\/it\/software-configurazione\/lucchetto\" target=\"_blank\" rel=\"noopener\">Lucchetto<\/a> se l&#8217;ora attuale corrisponde all&#8217;ora del tramonto. La prima variabile creata chiamata &#8220;<b>Time digest<\/b>&#8221; contiene l&#8217;ora attuale, la seconda chiamata &#8220;<b>IF_Pm<\/b>&#8221; contiene l&#8217;<b>ora Tramonto<\/b>. L&#8217;ultima variabile chiamata &#8220;<b>lock<\/b>&#8221; contiene il valore del componente <a href=\"\/software-configurazione\/lucchetto\" target=\"_blank\" rel=\"noopener\">Lucchetto<\/a>. Infine completa la funzione con una logica <em>If Else<\/em> che cambier\u00e0 di stato il componente <a href=\"\/it\/software-configurazione\/lucchetto\" target=\"_blank\" rel=\"noopener\">Lucchetto<\/a> se l&#8217;ora attuale \u00e8 prima dell&#8217;ora del <b>Tramonto<\/b>.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step10.png&#8221; alt=&#8221;This function will check if it the sunset time has passed, if it had, it will just unlock the lock.&#8221; title_text=&#8221;Script-lock-home_Step10&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<strong>Passo 11:<\/strong><\/p>\n<p>infine, imposta i <b>setTriggers<\/b>, i setTriggers sono obbligatori per l&#8217;esecuzione delle funzioni. Il primo setTrigger far\u00e0 eseguire la prima funzione &#8220;<b>Sunrise_sunset<\/b>&#8220;, solo se il <b>componente ID 12<\/b> cambier\u00e0 il suo stato in <b>ON<\/b>. Il secondo setTrigger eseguir\u00e0 la funzione &#8220;<b>Over<\/b>&#8221; ogni volta che il <b>componente ID 12<\/b> cambia di stato. Infine l&#8217;ultimo setTrigger che imposter\u00e0 l&#8217;ultima funzione &#8220;<b>Locking_home<\/b>&#8221; whenever the component <b>ID 23<\/b> change state.<\/p>\n[\/et_pb_text][et_pb_image src=&#8221;https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script-lock-home_Step11.png&#8221; alt=&#8221;Setting the set trigger statement that will get the components value and then trigger the function.&#8221; title_text=&#8221;Script-lock-home_Step11&#8243; show_in_lightbox=&#8221;on&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;50px||50px||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][et_pb_divider _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_divider][et_pb_testimonial portrait_url=&#8221;data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjUwMCIgdmlld0JveD0iMCAwIDUwMCA1MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGZpbGw9IiNFQkVCRUIiIGQ9Ik0wIDBoNTAwdjUwMEgweiIvPgogICAgICAgIDxyZWN0IGZpbGwtb3BhY2l0eT0iLjEiIGZpbGw9IiMwMDAiIHg9IjY4IiB5PSIzMDUiIHdpZHRoPSIzNjQiIGhlaWdodD0iNTY4IiByeD0iMTgyIi8+CiAgICAgICAgPGNpcmNsZSBmaWxsLW9wYWNpdHk9Ii4xIiBmaWxsPSIjMDAwIiBjeD0iMjQ5IiBjeT0iMTcyIiByPSIxMDAiLz4KICAgIDwvZz4KPC9zdmc+Cg==&#8221; quote_icon_color=&#8221;#000000&#8243; quote_icon_background_color=&#8221;#FFFFFF&#8221; font_icon=&#8221;&#xe092;||divi||400&#8243; portrait_width=&#8221;0px&#8221; portrait_height=&#8221;0px&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; custom_margin=&#8221;||19px||false|false&#8221; locked=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221;]\n<p><b>Click the link below to download the demo project and try it your self.<\/b><\/p>\n<p><strong><a href=\"https:\/\/support.ilevia.com\/wp-content\/uploads\/2024\/12\/Script_lock-if-sunset.zip\">Download the demo project here!<\/strong><\/a><\/p>\n[\/et_pb_testimonial][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; inner_shadow=&#8221;on&#8221; admin_label=&#8221;section&#8221; _builder_version=&#8221;4.24.0&#8243; background_color=&#8221;#fafafa&#8221; parallax=&#8221;on&#8221; min_height=&#8221;280px&#8221; custom_margin=&#8221;30px||||false|false&#8221; global_module=&#8221;59323&#8243; locked=&#8221;off&#8221; collapsed=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.23.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]\n<h1 style=\"text-align: center;\">Still Need Help? Our Customer Service Is Here For You.<\/h1>\n[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.23.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.23.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_button button_url=&#8221;https:\/\/support.ilevia.com\/faqs\/&#8221; button_text=&#8221;Ask for help&#8221; button_alignment=&#8221;center&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_size=&#8221;20px&#8221; button_text_color=&#8221;#1e84f4&#8243; button_border_color=&#8221;#1e84f4&#8243; button_use_icon=&#8221;off&#8221; custom_margin=&#8221;||||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; box_shadow_spread=&#8221;-80px&#8221; global_colors_info=&#8221;{}&#8221; box_shadow_spread__hover_enabled=&#8221;on|desktop&#8221; box_shadow_spread__hover=&#8221;0px&#8221; button_text_color__hover_enabled=&#8221;on|hover&#8221; button_text_color__hover=&#8221;#FFFFFF&#8221;][\/et_pb_button][et_pb_button button_url=&#8221;https:\/\/support.ilevia.com\/faqs\/&#8221; button_text=&#8221;Make a suggestion&#8221; button_alignment=&#8221;center&#8221; _builder_version=&#8221;4.25.2&#8243; _module_preset=&#8221;default&#8221; custom_button=&#8221;on&#8221; button_text_size=&#8221;20px&#8221; button_text_color=&#8221;#1e84f4&#8243; button_border_color=&#8221;#1e84f4&#8243; button_use_icon=&#8221;off&#8221; custom_margin=&#8221;||||false|false&#8221; box_shadow_style=&#8221;preset2&#8243; box_shadow_spread=&#8221;-80px&#8221; locked=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221; box_shadow_spread__hover_enabled=&#8221;on|desktop&#8221; box_shadow_spread__hover=&#8221;0px&#8221; button_text_color__hover=&#8221;#FFFFFF&#8221; button_text_color__hover_enabled=&#8221;on|hover&#8221;][\/et_pb_button][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>Script attivazione allarme dal orari alba e tramonto attraverso API online INTRODUZIONE La seguente guida spiega in dettaglio come costruire lo script e come funziona. Lo script recurerer\u00e0 le informazioni online attraverso delle richieste HTTP da delle API online. infine processer\u00e0 le informazioni e azioner\u00e0 i componenti impostati. Configurazione componenti Passo 1: Apri il software [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"categories":[1,18],"tags":[],"class_list":["post-76275","post","type-post","status-publish","format-standard","hentry","category-all","category-configuration-software-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Script Sunset Sunrise times with online API Ilevia Support |<\/title>\n<meta name=\"description\" content=\"Detailed guide that explains how to setup a script that will Arm the Alarm if the sunset time has passed within Ilevia Manager.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Filippo Amabilia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/\"},\"author\":{\"name\":\"Filippo Amabilia\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#\\\/schema\\\/person\\\/08a8d13dee0bc9f160da55efe97b7959\"},\"headline\":\"Script Sunset Sunrise times with online API\",\"datePublished\":\"2024-11-29T13:59:25+00:00\",\"dateModified\":\"2025-02-27T08:00:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/\"},\"wordCount\":2008,\"publisher\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#organization\"},\"articleSection\":[\"All Archives\",\"Configuration Software\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/\",\"url\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/\",\"name\":\"Script Sunset Sunrise times with online API Ilevia Support |\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#website\"},\"datePublished\":\"2024-11-29T13:59:25+00:00\",\"dateModified\":\"2025-02-27T08:00:15+00:00\",\"description\":\"Detailed guide that explains how to setup a script that will Arm the Alarm if the sunset time has passed within Ilevia Manager.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/configuration-software-en\\\/script-sunset-sunrise-times-with-online-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Configurazione\",\"item\":\"https:\\\/\\\/support.ilevia.com\\\/it\\\/archivi\\\/software-configurazione\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Script Sunset Sunrise times with online API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/\",\"name\":\"Ilevia Support\",\"description\":\"Assistance &amp; Technical Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#organization\",\"name\":\"Ilevia\",\"url\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"http:\\\/\\\/support.ilevia.com\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/ilevia.png\",\"contentUrl\":\"http:\\\/\\\/support.ilevia.com\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/ilevia.png\",\"width\":500,\"height\":500,\"caption\":\"Ilevia\"},\"image\":{\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/ileviaofficial\\\/\",\"https:\\\/\\\/www.instagram.com\\\/ilevia_official\\\/\",\"https:\\\/\\\/it.linkedin.com\\\/company\\\/ilevia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/ilevia\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/#\\\/schema\\\/person\\\/08a8d13dee0bc9f160da55efe97b7959\",\"name\":\"Filippo Amabilia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g\",\"caption\":\"Filippo Amabilia\"},\"url\":\"https:\\\/\\\/support.ilevia.com\\\/en\\\/author\\\/filippo-amabilia\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Script Sunset Sunrise times with online API Ilevia Support |","description":"Detailed guide that explains how to setup a script that will Arm the Alarm if the sunset time has passed within Ilevia Manager.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/","twitter_misc":{"Written by":"Filippo Amabilia","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/#article","isPartOf":{"@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/"},"author":{"name":"Filippo Amabilia","@id":"https:\/\/support.ilevia.com\/en\/#\/schema\/person\/08a8d13dee0bc9f160da55efe97b7959"},"headline":"Script Sunset Sunrise times with online API","datePublished":"2024-11-29T13:59:25+00:00","dateModified":"2025-02-27T08:00:15+00:00","mainEntityOfPage":{"@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/"},"wordCount":2008,"publisher":{"@id":"https:\/\/support.ilevia.com\/en\/#organization"},"articleSection":["All Archives","Configuration Software"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/","url":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/","name":"Script Sunset Sunrise times with online API Ilevia Support |","isPartOf":{"@id":"https:\/\/support.ilevia.com\/en\/#website"},"datePublished":"2024-11-29T13:59:25+00:00","dateModified":"2025-02-27T08:00:15+00:00","description":"Detailed guide that explains how to setup a script that will Arm the Alarm if the sunset time has passed within Ilevia Manager.","breadcrumb":{"@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/support.ilevia.com\/en\/configuration-software-en\/script-sunset-sunrise-times-with-online-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/support.ilevia.com\/en\/"},{"@type":"ListItem","position":2,"name":"Software Configurazione","item":"https:\/\/support.ilevia.com\/it\/archivi\/software-configurazione\/"},{"@type":"ListItem","position":3,"name":"Script Sunset Sunrise times with online API"}]},{"@type":"WebSite","@id":"https:\/\/support.ilevia.com\/en\/#website","url":"https:\/\/support.ilevia.com\/en\/","name":"Ilevia Support","description":"Assistance &amp; Technical Guides","publisher":{"@id":"https:\/\/support.ilevia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/support.ilevia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/support.ilevia.com\/en\/#organization","name":"Ilevia","url":"https:\/\/support.ilevia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/support.ilevia.com\/en\/#\/schema\/logo\/image\/","url":"http:\/\/support.ilevia.com\/wp-content\/uploads\/2018\/12\/ilevia.png","contentUrl":"http:\/\/support.ilevia.com\/wp-content\/uploads\/2018\/12\/ilevia.png","width":500,"height":500,"caption":"Ilevia"},"image":{"@id":"https:\/\/support.ilevia.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ileviaofficial\/","https:\/\/www.instagram.com\/ilevia_official\/","https:\/\/it.linkedin.com\/company\/ilevia\/","https:\/\/www.youtube.com\/ilevia\/"]},{"@type":"Person","@id":"https:\/\/support.ilevia.com\/en\/#\/schema\/person\/08a8d13dee0bc9f160da55efe97b7959","name":"Filippo Amabilia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0e396093874891309dc46571e6eec478bc2a5080be4f76a70e1ca9deb9f99eec?s=96&d=mm&r=g","caption":"Filippo Amabilia"},"url":"https:\/\/support.ilevia.com\/en\/author\/filippo-amabilia\/"}]}},"_links":{"self":[{"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/posts\/76275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/comments?post=76275"}],"version-history":[{"count":98,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/posts\/76275\/revisions"}],"predecessor-version":[{"id":76567,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/posts\/76275\/revisions\/76567"}],"wp:attachment":[{"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/media?parent=76275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/categories?post=76275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.ilevia.com\/en\/wp-json\/wp\/v2\/tags?post=76275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}