I `ve the next code in a Gateway event script with a timer with 30 seconds :
It´s about reading data from a JSON file from a “aemet web service” to have the temperatura and humidity.
When i execute it in a button it works succesfully, but when i try to run it in the Gateway event script timer it doesn´t work.
My ignition plattfor is a 7.7.8.
Do you have any idea? Thank you very much.
Kind regards.
Did you check what the RunTime console is logging? Maybe there is an error, unfortunately when you put script inside the Gateway/Client Events Scripts, in case of error there will be no popup error ( like the one that appears if there is an error in a script inside a button )
File "<TimerScript:OFICINAS_ENGIE_MADRID/Temp_aemet @30,000ms >", line 3, in <module>t ÆIOError: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
There’s likely something wrong with the target website’s HTTPS certificate. Also, you should edit your original post to omit your API key.
Phil is probably correct, I just want to note that the httpGet function also has a bypassCertValidation option, where you can bypass certificate validation.