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
Symbiot78 2
Hi
I'm trying to figure out how to use some response data. I want to convert specific data to a variable.
I request data from a URL
I get the below response.
I want to get the following into a variable:
shadeId
position
so the result is that I know that shadeId 50173 is in position1:65483
{"shadeIds":[50173,40999,7342],"shadeData":[{"id":50173,"type":55,"capabilities":4,"batteryKind":1,"smartPowerSupply":{"status":0,"id":0,"port":0},"batteryStatus":0,"batteryStrength":0,"roomId":59205,"firmware":{"revision":1,"subRevision":8,"build":1944},"name":"U3R1ZSBMYW1lbA==","signalStrength":0,"motor":{"revision":50,"subRevision":48,"build":11826},"positions":{"posKind1":1,"position1":65483,"posKind2":3,"position2":400},"groupId":11973},{"id":40999,"type":54,"capabilities":4,"batteryKind":1,"smartPowerSupply":{"status":0,"id":0,"port":0},"batteryStatus":0,"batteryStrength":0,"roomId":36806,"firmware":{"revision":1,"subRevision":8,"build":1944},"name":"S0EgQWxrb3Zl","signalStrength":0,"groupId":6735,"motor":{"revision":50,"subRevision":48,"build":11826},"positions":{"posKind1":1,"position1":65534,"posKind2":3,"position2":58360}},{"id":7342,"type":55,"capabilities":4,"batteryKind":1,"smartPowerSupply":{"status":0,"id":0,"port":0},"batteryStatus":0,"batteryStrength":0,"roomId":36806,"firmware":{"revision":1,"subRevision":8,"build":1944},"name":"S0EgTlkgVsOmZw==","positions":{"posKind1":1,"position1":65535,"posKind2":3,"position2":20},"signalStrength":4,"groupId":45116,"motor":{"revision":50,"subRevision":48,"build":11826}}]}
The code I run in a scene is:
17 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.