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


Search the Community

Showing results for tags 'json path'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 1 result

  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. http://www.energyhive.com/content/about/develop 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: https://jsonpath.curiousconcept.com/ 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. local http = net.HTTPClient(); http:request("http://www.energyhive.com/mobile_proxy/getCurrentValuesSummary?token=XXXX", { options = { method = "GET", headers = { ['Authorization'] = 'Bearer xxxxxxxx', } }, success = function(response) --error = function(err) fibaro:debug("Error: " .. err) local jsonTable = json.decode(response.data) jsonData = response.data jsonTable = json.decode(jsonData) local jsonpower = jsonTable fibaro:debug(jsonpower) end })
×
×
  • Create New...