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

Wall Plug energy consumption - confused with the consumption values.


Question

Posted

Hi,

I want to send energy consumption of a wall plug to an external database and calculate the consumption in my custom app but I'm confused with the consumption values generated in HC2. 

There are two values seen on the device as shown here:

Please login or register to see this image.

/monthly_2018_09/758980550_wallplug.PNG.824f199c46f05aa040d477a73a98b94e.PNG" alt="758980550_wallplug.PNG.824f199c46f05aa040d477a73a98b94e.PNG" />

I think the left value (46.20W) is the current consumption value but I didn't get the second value(94.99kWh). I've checked that with the Energy Panel values as shown in the following picture but It didn't match any of the values.

wallplug2.PNG.1e45d3705eaf2c6fc22ceb65e1c32682.PNG

 

So the question is for calculating the energy consumption which value should I send to my database and at which intervals(i.e. every fifteen minutes)

Any help would be appreciated.

Thanks 

12 answers to this question

Recommended Posts

  • 0
Posted (edited)

The value on the right is the total historical consumption ( since the device has been added or cleared)

There is an option to clear this historical data... see below

Please login or register to see this image.

/monthly_2018_09/Capture.PNG.35bd78ce0ddd3bc8e2d6de5a4a08220d.PNG" width="255" />

By the way Fibaro's energy panel has ability to show any consumption at any time for any device and honestly it looks and works great.

 

Edited by cag014
  • 0
  • Inquirer
  • Posted

    Thanks @cag014, I've examined the Fibaro energy panel. I can access energy  consumption values for devices and rooms. I'm planning to send hourly device data for each device to my database and calculate the daily, monthly and yearly values from that. It is critical to send the correct hourly data to the database. So if I send the hourly data just at the end of each hour do you think that it will be correct? 

    • 0
    Posted

    @Arduino

    Yes, it is correct to send data every hour.

    By the way you can get hourly consumption of each device from energy panel and calculate whatever you need directly on HC2 and send the report.

    You can create a Virtual device for all devices and their consumption, in this case you can observe directly the status of consumption from your phone, tablet or web UI.

    • 0
  • Inquirer
  • Posted

    Thanks.@cag014 

    I'll send hourly data with the following code.. I calculate the beginning of each hour and get the data for previous hour. 

     

    Please login or register to see this code.

     

    • 0
    Posted

    Looks good, as I understand it is part of the code....

    You need to run in loop to get data for every device.  Could be a good idea to get devices ID automatically, otherwise every time that you add new device you need to update the code.

    In addition you need somehow to trigger this scene once per hour.

     

    • 0
  • Inquirer
  • Posted

    You're right. I'll check the api to get the devices automatically. For triggering the scene I can use setInterval() function.

    Others might need a similar script so I 'll share the final version.

    • 0
    Posted (edited)

    You mean setTimeout().

    Thanks for willing to share the final version.... will wait for that.

    Edited by cag014
    • 0
    Posted
    8 hours ago, Arduino said:

    Thanks.@cag014 

    I'll send hourly data with the following code.. I calculate the beginning of each hour and get the data for previous hour. 

     

    Please login or register to see this code.

     

    I'm wondering why you're using so complicated time calculation. As far as I know it should work as well using "now"

    hourlyData=api.get("/energy/now-3600/now/single/devices/power/ "..energyDeviceID)

     

    • 0
  • Inquirer
  • Posted (edited)
    16 hours ago, cag014 said:

    I'm wondering why you're using so complicated time calculation. As far as I know it should work as well using "now"

    hourlyData=api.get("/energy/now-3600/now/single/devices/power/ "..energyDeviceID)

     

    Say for instance the time is 17:18. If I use "/energy/now-3600/now/...." It will return the value between 17:18 and 16:18. But I want to record the consumption value from the beginning of an hour. I mean the value between 17:00 and 16:00 that's why I use that calculation. I'll make a single record for each hour in my database. 

    Edited by Arduino
    • 0
    Posted

    Sorry for being so annoying, but as previous discussed your scene should be triggered every hour, right?

    So you should set the trigger to start the scene every hour at XX:00 minutes...

    By the way even if your scene triggered more than once per hour, you could check if the minutes are equal to '0'

    for example:

    Please login or register to see this code.

    In any case your code should work as well... no comments from me anymore...

    sorry

    • 0
  • Inquirer
  • Posted

    Thanks cag014. I'm working on it.

    • 0
    Posted

    Can I chime in with a related question:

     

    Are the consumption values calculated by HC as a function of power and time, or are they  coming from energy reports from the device?

     

     

     

     

    /P

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