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

[SOLVED]Export HC2 Event Table Data


jodohl

Question

Hi!

I want to create a time series of outdoor/indoor temperatures from my sensors. I found that the relevant data are all recorded in the HC2 Event Table.

 

But has anyone found a convenient way of extracting the data as a csv or similar format? 

Link to comment
Share on other sites

Recommended Posts

  • 0

the data is there, for specific device (in this case 193), e.g. last 5 events

 

Please login or register to see this code.

you can specify as well timeframe:

 

Please login or register to see this code.

you can combine it with deviceID by adding it 

 

Please login or register to see this code.

 

so you can copy it and create scene which will format the data for your use, e.g.

 

Please login or register to see this code.

 

when you reading all events from time x to y, you can as well check for devicetype == com.fibaro.temperatureSensor, e.g.

 

Please login or register to see this code.

 

Edited by tinman
  • Like 3
Link to comment
Share on other sites

  • 0
Guest FredrikKarlsson

Of course, for more simple extraction of a small set of the data you could also use the new Export functionality in the Consumption -> Temperature.

 

Simple, but also less powerful.

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0

Or you can setup influxDB on a raspberry to store data from Hc:2, then you can make your own graphs in grafana :)

Please login or register to see this attachment.

Please login or register to see this attachment.

  • Like 1
Link to comment
Share on other sites

  • 0

I use this python script to process the information into a database:

 

Please login or register to see this code.

Of course you need to replace IP, login and pw

  • Thanks 1
Link to comment
Share on other sites

  • 0

Hi @jodohl

 

Here's

Please login or register to see this link.

.  With this method, I'm pushing the temperature data out to an external IoT platform (AllThingsTalk) and viewing the data there.

 

Please login or register to see this attachment.

 

Dave

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Thanks Dave. great proposal. Very helpful. Will have a look during the Christmas break since I do not live and breathe code on a regular basis :-)

    Link to comment
    Share on other sites

    • 0

    Hi Dave, I´m reading your experiences and I´m testing (AllThingsTalk).

     

    Do you have the code updated for the pushing the temperatures?

    -- Scene         : All Things Talk Test
    -- Version       : 1.2
    -- Date Created  : 09 June 2016

     

    In the example code you gave, How do I get more devices? I only get 2

    loungeTemperature = {deviceId = 63, assetId = ......

     loungeThermostat = {deviceId = 163, assetId =......

     

     

    Do you have something similar to check how much time the SSR303 is ON during the days?

     

    Had you think to make a online meeting to saw what you have to learn about posibilities? If you do it I´m interesting from a user point of view to share ideas (I´m not a programmer)

     

    Thanks a lot.

    Marjomar

     

    Edited by Marjomar
    Link to comment
    Share on other sites

    • 0

    Hi @Marjomar

     

    On 12/4/2017 at 2:49 PM, Marjomar said:

    How do I get more devices?

     

    Simply add the other devices to the array, eg:

    Please login or register to see this code.

    And yes, you can also list the SSR303 in the devices.  It will show in AllThingsTalk as 1 when the boiler is on, and 0 when it's off.  However, you need to interrogate the device's mode parameter, rather than value:

     

    Please login or register to see this code.

     

    Regards,

    Dave

    Edited by Dave Harrison
    • Like 1
    Link to comment
    Share on other sites

    • 0

    Thanks Dave, it´s working great.

     

    Just one last question, how can I define the pulling values? Now it´s one hour.

     

    Thanks again

    Link to comment
    Share on other sites

    • 0
    On 12/9/2017 at 2:35 PM, Dave Harrison said:

    Apologies for hijacking your thread @jodohl.

     

    @Marjomar...please can you repost your question on 

    Please login or register to see this link.

    .

     

    Many thanks,

    Dave

    Hi Dave,

     

    I have since one month a lot of errors in my HC2 lua script. Do you know if Allthings changed any thing?

     

    Many Thanks 

    Volker 

     

     

    Link to comment
    Share on other sites

    • 0
    21 hours ago, Volker said:

    I have since one month a lot of errors in my HC2 lua script. Do you know if Allthings changed any thing?

     

    Hi @Volker  Feel free to post details of the errors on the

    Please login or register to see this link.

    thread, and I'll see what I can do to help.

     

    Dave

    Link to comment
    Share on other sites

    • 0

    Hi Dave,

     

    Thank you.

    I using your code

    Please login or register to see this image.

    /monthly_2018_10/1_fibaro.png.60655046b7d195890bebf4af49301fc3.png" alt="1_fibaro.png.60655046b7d195890bebf4af49301fc3.png" />2_Fibaro.png.f1c1fe527381302a7b5708b601b2b729.png

    But since 1 month a get no result in AllTings...

    In my HC2 debug box are a lot of errors... see attachments.
    I hope you find the error.

     

    Thank you in advance.
    Volker

     

     

    Sorry, the code has been deleted:

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

     

    can you patch  "success" method

    IMHO you have issues on allthingstalk site side!

    Please login or register to see this code.

    btw,  you can run this LUA scene without "header" triggering. for example once an hour.

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    That is the new error report...

     

    Thank you.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    403? 

    omg... Error 403: "The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated."

    so, are you sure what

    1) you provide   right  cred in LUA script according to site

    2) you do not change the password on site last month? (and not update LUA script)

     

    stop. maybe 

    Please login or register to see this code.

    change API endpoint. idk

    Please login or register to see this link.

    as I can understand (after quick reading) your site change auth. now you must log in two steps: first get auth key-token, second make to call to update your data. here you should provide [{"key":"Authorization","value":"Bearer {{token}}"

     

    good luck in development! 

    Link to comment
    Share on other sites

    • 0

    Sorry, I am to stupid for that, I found no solution... Have anyone solved this problem?

     

    Thank you

    Volker

     

    Link to comment
    Share on other sites

    • 0
    On 10/23/2018 at 6:08 PM, 10der said:

     

     

    stop. maybe 

    Please login or register to see this code.

    change API endpoint. idk

    Please login or register to see this link.

    as I can understand (after quick reading) your site change auth. now you must log in two steps: first get auth key-token, second make to call to update your data. here you should provide [{"key":"Authorization","value":"Bearer {{token}}"

     

    good luck in development! 

     

    Hi!

    Can you explain this a Little bit more please? Idid not understand what i have to do, so that my Homecenter get access to maker.allthingstalk.com to write down my sensordata...

     

    thanks a lot!

    Rik

    Link to comment
    Share on other sites

    • 0
    On 11/2/2018 at 10:29 AM, Volker said:

    Sorry, I am to stupid for that, I found no solution... Have anyone solved this problem?

     

    Hi @Volker

     

    The authentication method for AllThingsTalk has changed and no longer uses the ClientId and ClientKey authentication method.  This has been replaced by a device token.  Please take a look at the original post where I've posted the revised solution:

    Dave

     

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