Jump to content

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


  • 0

Storing JSON HTTPS response and storing it as a Global variables


Question

Posted

Hi,

 

I'm very new to the world of coding but i am slowly making sense of things as i move on. 

 

I'm having trouble accessing some data from my weather station so i can use it to automate my sprinklers in a scene and VD.

 

 When I print a "alphabetical" parameter the code shows the value from the JSON response. (example shown in photos as "country response" 

 

The problem is that i cant work out is why when i seem to print a decimal parameter the response is always "nil" even though i can see the value in the line above in the overall JSON response. 

 

Once I get past this hurdle I would then like to store the individual responses as global variables i.e wind chill, wind speed, rain ect to the use in VDs and other scenes.

 

I have installed quite alot of smart devices in my home (I'm an electrician so i have gone over the top) but now i need to get smart so i can actually have a "smart home"

 

Thank you in advance for any help.

 

Cheers,


Pete

 

 

 

 


  
   

 

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

3 answers to this question

Recommended Posts

  • 0
Posted

Please provide complete information. Your debug output is cut on the right side. Also, it seems the screenshots have been modified. Please condsider pasting the fulll json string from the console.

 

You can use e.g. an online json validator or the JSONview plugin for Chrome to explore the json string.

 

/jayrock

  • 0
Posted

perhaps it is

observations[2]

  • 0
Posted

perhaps it's just observations.windSpeed...

As @jayrock mentioned, please post the entire JSON string...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...