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


Energy report 0.3.6

   (1 review)

3 Screenshots

About This File

Energy report - version 0.3.5

 

This script is for anyone not using HEM (Home Energy Meter) by Aeotec or Qubino for example, but having a

lot of zwave switches and wants to measure their energy consumption.

 

This script automatically recognizes devices with energy consumption measurment. It‘s also possible to exclude

any device from the report (e.g. with a very small energy consumption) or configure the report to only monitor

the manually entered devices.

 

The consumption report can be created on any day of a month and can report for any selected time period.

 

For more information, see the attached PDF.

 

Thanks to @pblacky who had the idea for this script.

Thanks @Cannon_82 for being so nice to share an icon for this scene.

 


What's New in Version 0.3.6   See changelog

Released

LUA code adapted to HC3.

 

  • Like 3
  • Thanks 3

Other Files from jwi


User Feedback

Recommended Comments

Hello, 

 

works well. 

Is it possible to make the report by hour ? 

(day 2 , 13:00  hour consumption 100 kwh )

 

thank you 

 

Link to comment
Share on other sites

4 hours ago, Lenny22 said:

Hello, 

 

works well. 

Is it possible to make the report by hour ? 

(day 2 , 13:00  hour consumption 100 kwh )

 

thank you 

 

Thank you too

 

If I understood you correctly, for this purpose you need to change the trigger (conditions) on the left.

Analogous to your example: value = { "00", "13", "2", "*", "*", "*" }

Here the script would start every 2nd of the month at 1:00 p.m.

In order for an email to be sent, you also have to change the variable maildays.

Link to comment
Share on other sites

the deal is that i´m buying energy from  stock exchange and the price changes every hour.  

so i would like to have report for every hour of the day oft the month. 

 

to e.mail it will send what ? report or notification ? 

 

thank you 

 

Link to comment
Share on other sites

Actually the script is not designed for such short periods of time. But you can do it with a little unsightly hack.
 
In the left side (Conditions/triggers) change the value to 1 hour so that the script starts every hour. " value = { "0", "*", "*", "*", "*", "*" } "
 
In the script itself, replace the line "sek = ndays * 86400" with "sek =3600" as the basis for the calculation.
 
After the lines:
local consumption= 'Total consumption-------------: '.. kilowatts .. ' kWh'..'</br>'
local tcosts = 'Total costs-------------------: '.. sum .. ' '..currSymbol
 
Add the following lines:
hub.alert('push', {2,}, "Last hour consuption:".. kilowatts.. " kWh") -- for push message 
print (consumption)
print (tcosts)
 
And finally, at the beginning of the script, change the variables to this value:
local maildays = {}
local debugout = false
local debughtml = false
local defDays = 1
 
This is how it should work for your needs
 
Good luck
 
Link to comment
Share on other sites

54 minutes ago, jwi said:
Actually the script is not designed for such short periods of time. But you can do it with a little unsightly hack.
 
In the left side (Conditions/triggers) change the value to 1 hour so that the script starts every hour. " value = { "0", "*", "*", "*", "*", "*" } "
 
In the script itself, replace the line "sek = ndays * 86400" with "sek =3600" as the basis for the calculation.
 
After the lines:
local consumption= 'Total consumption-------------: '.. kilowatts .. ' kWh'..'</br>'
local tcosts = 'Total costs-------------------: '.. sum .. ' '..currSymbol
 
Add the following lines:
hub.alert('push', {2,}, "Last hour consuption:".. kilowatts.. " kWh") -- for push message 
print (consumption)
print (tcosts)
 
And finally, at the beginning of the script, change the variables to this value:
local maildays = {}
local debugout = false
local debughtml = false
local defDays = 1
 
This is how it should work for your needs
 
Good luck
 

 

image.png.47652ff7e4bec6ed1f591cc75be19155.png

 some thing is wrong here. 

image.png.ef874d8be9e0a79481004467b57a6a58.png

what should i change ? 

Thank you 

Link to comment
Share on other sites

This is wonderful and I simply do not understand why the HC3 has so bad energy reporting to start with and ok some " solar" but face it most of them have no use for that and like

function like this to track the use, the green " bug"  must have hit hard in Fibaro home offices making so much energy stuff that nobody in fact is able to use 

 

BUT this is what we need, the ability to track use, pr device and for a full setup,  I might be outside bell-curve as just finished putting in energy meters on most things that use power

washing machines, water pumps, aircon etc.  

 

Im trying to modify your script,  I'm not a coder, so for now, I do not get emails but Im struggling with the automatic part, ( I want to try to avoid the manual that works fine as I have so many devices )   I see as I have miz of brands and also some ( don't tell anybody ) Zigbee

 

that " power" misses a few things, so I was thinking that the below might work but still only process the first line.  if look under the device in HC3 and use 

 

   pwrIDs = fibaro.getDevicesID({interfaces = {"power"} or {"energy"} or {"electricity"}, visible = true, enabled = true})
 
Wonder if you are able to point me in the right direction.
 
image.png.7c292aa636fbf720adc0ee6fa3ecf3a6.png

 

 

Link to comment
Share on other sites

@Jasper Waale , I hope you know that ZigBee is still in beta at fibaro, so there may be problems.

At the time I coded this script, fibaro didn't have zigbee yet. But let's see, maybe there is a solution.

 

As far as I know, a property of the device must be "power". But you can also try “light”. The "ROLE" is only for filtering and you can set it for each device in the "General" tab.

I have 3 different ZigBee devices and all 3 are addressed with "power". But you can also combine a combination of manual and automatically found IDs.

 

For that paste this code at this point:

if manually then
   -- Manual entry of device IDs for evaluation.
   pwrIDs = {213,224,256,264,285,305,322,339,383,391} 
else  
   -- Automatic determination of electricity consumers.
   pwrIDs = fibaro.getDevicesID({interfaces = {"power"}, visible = true, enabled = true})  
end
-------------insert -------------
mpwrIDs = {999,1201, }   -- enter manualy your IDs
for _,v in ipairs(mpwrIDs) do -- this code joins both tables 
    table.insert(pwrIDs, v)   -- 
end
-----------------------------

 

Good luck

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
Add a comment...

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