Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
Peppe 0
Hi All,
I'm no a professional programmer but I'm trying to make some basic code for my needs on HC2.
I wrote a code in order to get information from my SolarEdge system and based on that perform some actions like turn on the water heater, etc...
Unfortunately the SolarEdge system some times (from my test typically ones per day) responds with an error that generates a Lua fail aborting the scene.
This is the code I'm using for the HTTP request:
local http = net.HTTPClient()
http:request("https://monitoringapi.solaredge.com/site/"..SE_CLIENT_ID.."/powerDetails?meters=FeedIn&startTime="..SEendTime.."&endTime="..SEendTime.."&api_key="..SE_API.."",{
--options = {method = 'GET', timeout = 2000 },
options = {method = 'GET'},
success = process,
--success = function(response) fibaro:debug(response.data) end,
--error = error
error = function(err) fibaro:debug("Error:"..err) end
})
and this is one of the errors that I got during the day running the full code:
[DEBUG] 18:39:02: Error:Host not found (non-authoritative), try again later
Is there a way to avoid this issue and in case of an error in HTTP response just skip it and retry?
Thank you
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.