# How to calculate daily kWh Percent?

Thanks Bill !!

Now can i post images in the right place

My emonPi + emonTx has several imputs and for each one has the followin process:

1 - if > 0, skip next
2 - x (-1) [1 & 2 modify negative values]
3 - Log to feed [real time electric input]
4 - Power to kWh/d [Daily kWhd device]
5 - / feed (General - Power to kWh/d)

The idea is that feed â€śGeneral - Power to kWh/dâ€ť is the real time total value for my home general kW. So if i divide one device kWh/d (for instance â€śHornoâ€ť entry) between total home kWh/d â€śGeneralâ€ť then i can get percent use of kW/d for each device.

Example

Feed: Horno - Power to kWhd = 2 (x %)
Feed: General - Power to kWhd = 8 (100%)
Feed: Horno - Power to kWhd - Percent == 2/8 == 0,25 == 25%

Then the idea is get daily percent use of â€śHornoâ€ť relative to total energy use for my home. Finally, i would set this percent in a battery Dashboard.

When i create this model of feeds, â€śPercentâ€ť current feed configuration represents real time value percent, but my objective is get cumulative value percent of the day. So i have not real representation of total cumulative percent consuption for this device. Please ask me if my explanation is not very clear

In another hand, if i represents Multigraph, i can see with bars percent values of each device but i have not the numeric value of daily percent.

In this example â€śHorno - Power to kWhdâ€ť has 1.43 and â€śGeneral - Power to kWhdâ€ť has more or less 6. So (1.43/6)*100 = 24 %

I would like to have a feed with this value, to query daily percent use of each device (Horno, Lavadora, Aire Acondicionado, Enchufes, Lavavajillasâ€¦)

Can you lend me a hand to get these daily values in percent? Thanks in advance

1 Like

Hi Dan,

Iâ€™ve bumped your account up a notch. You should be able to post multiple images now.

Did you ever get a solution for this?

Hi Peter,

Not yet. I have no idea how to implement it. Do you have any suggestion?

Since daily values are not passed on for further processing you will need to create a secondary processlist at the end of the existing processlist using a reset to zero and then use â€ś+feedâ€ť processes to pull in the daily values for the calcâ€™s you need.

For example if you have an input â€śAâ€ť that has the following processlist

log to feed A_Power
power to kWh A_kWh
power to kwh/d A_kWh/d

and the total daily consumption is being tallied somewhere as Total_kWh/d, then you might be able to do something like

log to feed A_Power
power to kWh A_kWh
power to kwh/d A_kWh/d
reset2zero
+feed A_kWh/d
/feed Total_kWh/d
x 100
Update feed at day A_percentage_of_daily_total

and â€śA_percentage_of_daily_totalâ€ť should (hopefully) be overwritten each time the input updates, with the current percentage of daily total.

I say â€śhopefullyâ€ť as Iâ€™ve never used that process and it seems to have changed name recently, it may be that you have â€śUpsert feed at dayâ€ť instead and the function code style doesnâ€™t match the other daily feeds, so it maybe that it has not evolved along with the other functions as it is less used.

I havenâ€™t tried this myself so it may need tweaking, but please let us know if you try it as itâ€™s an interesting subject.