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


[HOWTO] HC2 + Grafana (influxdb)


10der
 Share

Recommended Posts

@julesmartens

 

1) influx already installed

2) Grafana already installed

3) create datasource

Please login or register to see this attachment.

 

check

Please login or register to see this attachment.

 

python (2 or 3) already installed!

installl influx client for python 

Please login or register to see this code.

 

unpack attached file (python).

change creds

 

Please login or register to see this code.

put poll.py file into crontab

 

crontab -e
 

Please login or register to see this code.

 

open Grafana

1) Add dashboard

2) Add query

3) 

Please login or register to see this attachment.

 

warning: in this sample I have filtered by com.fibaro.temperatureSensor

you may use other values: "type": "com.fibaro.lightSensor", com.fibaro.humiditySensor etc

 

sample result

 

Please login or register to see this attachment.

 

 

 

PS: in WHERE you may add any criteria for filtering: by room name / by sensor name etc

 

 

Have a nice day!

 

O,

 

Please login or register to see this attachment.

Edited by 10der
  • Like 1
Link to comment
Share on other sites

  • 7 months later...
  • Topic Author
  • 1 hour ago, Stiven said:

    Do you need any scene to run on HC2?

    thnak you I do not need nothing.

    I do not know what is HC2. now.

    sorry.

    Link to comment
    Share on other sites

    Thank

    On 8/21/2019 at 5:34 PM, 10der said:

    @julesmartens

     

    1) influx already installed

    2) Grafana already installed

    3) create datasource

    Please login or register to see this attachment.

     

    check

    Please login or register to see this attachment.

     

    python (2 or 3) already installed!

    installl influx client for python 

    Please login or register to see this code.

     

    unpack attached file (python).

    change creds

     

    Please login or register to see this code.

    put poll.py file into crontab

     

    crontab -e
     

    Please login or register to see this code.

     

    open Grafana

    1) Add dashboard

    2) Add query

    3) 

    Please login or register to see this attachment.

     

    warning: in this sample I have filtered by com.fibaro.temperatureSensor

    you may use other values: "type": "com.fibaro.lightSensor", com.fibaro.humiditySensor etc

     

    sample result

     

    Please login or register to see this attachment.

     

     

     

    PS: in WHERE you may add any criteria for filtering: by room name / by sensor name etc

     

     

    Have a nice day!

     

    O,

     

    Please login or register to see this attachment.

     

    Thanks @

    Please login or register to see this link.

     

    Please login or register to see this link.

    I try the script on HC3 and work fine :) In need to improve in grafana, but work fine the export in RPI 3

    • Thanks 1
    Link to comment
    Share on other sites

    • 3 months later...

    I’m trying to have this working on my HC3 but it seems no data is collected ? Can you confirm if it works with a HC3 ?

     

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • No now it’s does not work.

    Just change URL via http url : port 

    it’s should be works 

    Link to comment
    Share on other sites

  • Topic Author
  • I am on the my PC now

     

    Please login or register to see this code.

     

    Edited by 10der
    Link to comment
    Share on other sites

    Thank you so much @

    Please login or register to see this link.

     

    Please login or register to see this link.

     

    I’ll try later today when I’ll be back home :-) 

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jguellec said:

    Quick question : this scene is enough ? Do we still need the python script to run ?

    no reptile inside. all inclusive :) 

    Link to comment
    Share on other sites

    Thanks. Just tried to create the scene, changed the IP address and the database to match my environment but I have the following error : 

    /opt/fibaro/lua_engine/lua/lib/json.lua:185: unexpected character '' at line 1 col 1

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jguellec said:

    Thanks. Just tried to create the scene, changed the IP address and the database to match my environment but I have the following error : 

    /opt/fibaro/lua_engine/lua/lib/json.lua:185: unexpected character '' at line 1 col 1

    just test open url in browser

     

    http://192.168.1.10:8086/query?pretty=true&db=smarthome&q=SELECT value FROM test

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • thats Ok!

    so you wrong configured scene.

    let go to line 

    -- print(url)
     
    and uncomment 
     
     print(url)
    Link to comment
    Share on other sites

    Mmmm.. Still the same error after uncomment : 

    /opt/fibaro/lua_engine/lua/lib/json.lua:185: unexpected character '' at line 1 col 1

     

    I should use a scene, correct ? Not a Quick App ? 

    Link to comment
    Share on other sites

  • Topic Author
  • Just now, jguellec said:

    Mmmm.. Still the same error after uncomment : 

    /opt/fibaro/lua_engine/lua/lib/json.lua:185: unexpected character '' at line 1 col 1

     

    yes! still!

    just see to LOG!

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • my face palm.

     

    remove line

    local jT = json.decode((fibaro.getGlobalVariable("HomeTable")) or "{}")

     

    at all

    Link to comment
    Share on other sites

    Oh, wait : what is this variable here ? I don’t have the HomeTable global variable : 

     

     

    local jT = json.decode((fibaro.getGlobalVariable("HomeTable")) or "{}")

    Ahah, you’re quicker than me. I’m trying 

    WORKING ! 

     

    You’re a boss ✌️

    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • @jgab Jan sorry, I think you know. why missed globar var fail condition or {} ?

    (fibaro.getGlobalVariable("HomeTable")) or "{}" not {} 

    Link to comment
    Share on other sites

    Join the conversation

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

    Guest
    Reply to this topic...

    ×   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.

     Share

    ×
    ×
    • Create New...