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


  • 0

Loggin to MS SQL or MySQL


Question

Posted

Hello,

I have grown impatient with the lack of history for powerusage on my HC2. Everytime I upgrade the BOX Fibaro needs to clear my energy history which I do not like. So I grown impatient and want to log to SQL for backup. So Can I do something to log to SQL via for example a virtual device and a webpage or something. Any ideas?

7 answers to this question

Recommended Posts

  • 0
Posted

With Beyond Measure you can log hc data to mysql. With Isakssons komponent

I do it and it works great.

Check here.

Please login or register to see this link.

  • 0
Posted

If you know a bit of scripting it is quite easy to do. I have a setup which works in this way:

- A button on a virtual device is activated by a scene (scenes can't handle http requests for some strange reason)

- the virtual device opens a http-socket to my webserver and activates a php-script by means of a get message.

- the phpscript imports the entire device json from the hc2, located at:

Please login or register to see this code.

- the script then identifies the devices you want to log (i log everything of a specific device type, i.e. Plugs, or by means of a specific function i.e. "isBatteryOperated") and then exports the value and device ID to the database. A separate database stores the name as a function of id to avoid having to save the name in each value readout.

- the database can then be read out using a number of different graphing tools.

  • 0
  • Inquirer
  • Posted

    Good variant. With this I can go from fibaro to domoticz and IF fibaro gets better I can even go back again without loosing energy history.

    • 0
    Posted

    Dall1985 can you share your php script / virtual device for this solution?

     

    thanks,

     

    Remco

    • 0
    Posted

    It would be very nice with a step by step how to log to MySQL. That is the only thing that i miss in HC:2.

    • 0
    Posted

    Yes, that would be great. Than I can finally create some statistics about my house. The HC2 doesn't store enought data to do this...

    • 0
    Posted

    If the only thing you are after is loggin numbers, you might be interested in ThingSpeak.com, which is a service with logging capabilities - then you simply do not need a MySQL server - just simple LUA code like:

    Please login or register to see this code.

    Join the conversation

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

    Guest
    Answer this question...

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

    ×
    ×
    • Create New...