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
WimF 1
,maybe someone can help me with the following question:
the response i get from a HTTP request on my heating controller is :
{"jsonrpc":"2.0","id":6538,"result":{"objects":[{"id":"211","properties":{"85":{"value":19.5}}}]}}
And i now need to extract the value 19.5 out of this and put it into a variable.
at this moment I have the following data
{
"jsonrpc":"2.0",
"id":6538,
"result":{
"objects":[
{
"id":"225",
"properties":{
"85":{
"value":19.8
}
}
}
]
}
}
and i can extract data up to the id= 225 with following code:
local resultaat = json.decode(response)
figaro:debug(resultaat.jsonrpc)
fibaro:debug(resultaat.id)
fibaro:debug(resultaat.result.objects[1].id)
fibaro:debug(resultaat.result.objects[1].properties)
as soon as i put in the next level 85 i get a failure message so i'm really stuck
[ERROR] 19:05:58: line 16: ')' expected near '.85'
in reverse I would also like to put a value back into following statement:
{"jsonrpc":"2.0","id":11,"method":"write","params":{"objects":[{"id":"211","properties":{"85":{"value":"19.5"}}}]}}
so that i can write that to the device.
any help will be very much appreciated as i am just learning LUA and documentation is not very available/clear.
Edited 22 minutes ago by WimFPlease login or register to see this link.
-
Edited by WimF9 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.