Announcement

Collapse
No announcement yet.

Anybody using Grafana?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Anybody using Grafana?

    My friend, who's a Home Assistant user, just installed Grafana which looks like a great tool for graphs and dashboards. Very eye pleasing. The integration with Home Assistant looks very easy to accomplish but I haven't found so much info about integrating with HS.

    Does anybody use Grafana together with HS?

    #2
    Originally posted by Freddan101 View Post
    My friend, who's a Home Assistant user, just installed Grafana which looks like a great tool for graphs and dashboards. Very eye pleasing. The integration with Home Assistant looks very easy to accomplish but I haven't found so much info about integrating with HS.

    Does anybody use Grafana together with HS?
    Fantastic program, it uses mysql. I run a script that runs at hs startup, please check my posting for it, it collects the devices changes and put them in mysql. If you can find it let me know i will send it to you.

    Good luck,
    Aldo

    Sent from my SM-G935V using Tapatalk

    Comment


      #3
      Originally posted by aldo View Post
      Fantastic program, it uses mysql. I run a script that runs at hs startup, please check my posting for it, it collects the devices changes and put them in mysql. If you can find it let me know i will send it to you.

      Good luck,
      Aldo

      Sent from my SM-G935V using Tapatalk

      I would definitely be interested in this too! I currently use ELK for my firewall but just saw some Grafana dashboards and they are awesome!
      Do you have any details about how you installed and configured Grafana for Homeseer?

      Comment


        #4
        First you need to create a mysql database, check the script, there are instructions in it on how to get going with it.

        Then install Grafana and in the query use the following statement by replacing whatever you want to graph.

        SELECT
        UNIX_TIMESTAMP(datecreated) as time_sec,
        devicevalue as value,
        devicename as metric
        FROM history
        WHERE $__timeFilter(datecreated) and deviceroom = 'Energy Monitor' and devicename in ('Total Watts' ,'Total KW Hours')
        ORDER BY datecreated ASC
        Attached Files

        Comment


          #5
          These are few of the screens from it.
          Attached Files

          Comment


            #6
            Originally posted by aldo View Post
            First you need to create a mysql database, check the script, there are instructions in it on how to get going with it.

            Then install Grafana and in the query use the following statement by replacing whatever you want to graph.

            SELECT
            UNIX_TIMESTAMP(datecreated) as time_sec,
            devicevalue as value,
            devicename as metric
            FROM history
            WHERE $__timeFilter(datecreated) and deviceroom = 'Energy Monitor' and devicename in ('Total Watts' ,'Total KW Hours')
            ORDER BY datecreated ASC
            Thanks a lot for your script. I will have a look at it and see if I understand everything.

            Do you log all updates from every single device?

            Comment


              #7
              Correct, every device that changes, so you may need a relatively large disk space.

              Comment


                #8
                Thanks for the script Aldo. I am planning on trying it this weekend!

                Andy


                Sent from my iPhone using Tapatalk

                Comment


                  #9
                  Originally posted by aldo View Post
                  Correct, every device that changes, so you may need a relatively large disk space.
                  Is it possible to modify the script so only certain devices are logged?

                  Comment


                    #10
                    Great question, not sure, you will need to ask someone that knows about scripts, I used it from someone else. See if you can Google for the script name, you should be able to find the author of it or ask the script guys, they are really great.

                    Aldo

                    Sent from my SM-G935V using Tapatalk

                    Comment


                      #11
                      Are you using regular SQL libraries for a MySQL database? Will this even work?
                      I have tried this, and it wont work.

                      Wouldnt you need to use
                      'Imports mysql.data.mysqlclient'
                      inplace of
                      'imports system.data.sqlclient' ?

                      Comment


                        #12
                        Originally posted by gjelsvik View Post
                        Are you using regular SQL libraries for a MySQL database? Will this even work?
                        I have tried this, and it wont work.

                        Wouldnt you need to use
                        'Imports mysql.data.mysqlclient'
                        inplace of
                        'imports system.data.sqlclient' ?
                        I have been using it for almost a year using mysql. Please give me sometime this weekend to get the script and the tables for you.

                        Sent from my SM-G935V using Tapatalk

                        Comment


                          #13
                          Originally posted by aldo View Post
                          I have been using it for almost a year using mysql. Please give me sometime this weekend to get the script and the tables for you.

                          Sent from my SM-G935V using Tapatalk
                          Great

                          I have mysql db up, with the tables created like I think you might have done it. I have grafana reading mysql, and I have the script running on each devicechange. Ive also added a "whitelist" so that It only registers the devices I want to log. But im stucked at getting .net to talk with mysql.

                          Comment


                            #14
                            Originally posted by gjelsvik View Post
                            Great

                            I have mysql db up, with the tables created like I think you might have done it. I have grafana reading mysql, and I have the script running on each devicechange. Ive also added a "whitelist" so that It only registers the devices I want to log. But im stucked at getting .net to talk with mysql.
                            Got most of it sorted by now.. I really cant figure how you could read mysql with that script. Some of the commands arent even mysql compatible.

                            Also, the servername you have in your connection string implies you are using sqlexpress?

                            Comment


                              #15
                              I have attached everything you need to get started. I tried to document what you need in the script, unfortunately I can read scripts but pretty much it.

                              Aldo
                              Attached Files

                              Comment

                              Working...
                              X