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
Plank 1
I am trying to get a power reading from my energy monitor but am having lots of trouble trying to work out what code i need to use. I need to get a particular piece of info from this response I get.
I don't have any experience in coding don't have much idea, but a nudge in the right direction would be greatly appreciated.
The exact response from the http request is = [{"cid":"PWER","data":[{"1525674668000":746}],"sid":"740893","units":"kWm","age":6}]
my energy monitor is a efergy monitor.
Please login or register to see this link.
is where I got the API details from."746" is the value I am trying to retrieve.
When I print (response.data) I get [DEBUG] 16:31:24: [{"cid":"PWER","data":[{"1525674668000":746}],"sid":"740893","units":"kWm","age":6}]
When I print json.decode(response.data) I get [DEBUG] 16:17:02: table: 0x9c41348 -- I don't know what this means
I tested the path here:
Please login or register to see this link.
and can get the watt reading using this code "..data[0]*" in the json path expression field
Scene code i'm using. I just copied and pasted from another forum post by @Lambik to get the http request, I'l make my own code later if i can get this data out.
Please login or register to see this code.
Link to comment
Share on other sites
6 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.