hif2k1 / battery_sim

Home assistant home battery simulator - allows you to model how much energy you would save with a home battery
106 stars 13 forks source link

Accept input from active power sensor #51

Closed GentleJan closed 1 year ago

GentleJan commented 1 year ago

I am using an homewizard p1 power meter and the HA integration (https://www.home-assistant.io/integrations/homewizard/) This device not only has Total energy export/import T1/T2 but also Active power (w) and Active power L1,L2,L3 (w per fase). It would be great to have the possibility to use the total active power and/or L1,L2,L3 as input for de battery sim. Than i could put in 3 batteries each on one fase.

hif2k1 commented 1 year ago

Thanks for the suggestion. I've never heard of a three battery setup, one on each phase. In the real world this would surely be very expensive as you'd have to have three inverters. Anyway it would be possible to implement this using an integrating input helper for each phase. If you integrate the active power over time you will get the energy in kWh and then you can use that sensor as an input to any batteries you want to add.

On Wed, 2 Nov 2022 at 12:04, GentleJan @.***> wrote:

I am using an homewizard p1 power meter and the HA integration ( https://www.home-assistant.io/integrations/homewizard/) This device not only has Total energy export/import T1/T2 but also Active power (w) and Active power L1,L2,L3 (w per fase). It would be great to have the possibility to use the total active power and/or L1,L2,L3 as input for de battery sim. Than i could put in 3 batteries each on one fase.

— Reply to this email directly, view it on GitHub https://github.com/hif2k1/battery_sim/issues/51, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAIZGN5RPRRXZ2ZCXMW2ZDWGJKF3ANCNFSM6AAAAAARVAFWKU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

GentleJan commented 1 year ago

I am going to buy an dutch product “sessy” How does the Sessy home battery work? | sessy (sessy-nl.translate.goog)https://sessy-nl.translate.goog/hoe-werkt-sessy/?_x_tr_sl=nl&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp You can put for example 2x 5Kwh per fase.. so 6 batteries in total Thanks for the reply. I will try it with the riemann sum integral helper But how can I than use the simulated grid import/export after dis/charching?

From: hif2k1 @.> Sent: Thursday, November 3, 2022 12:29 PM To: hif2k1/battery_sim @.> Cc: GentleJan @.>; Author @.> Subject: Re: [hif2k1/battery_sim] Accept input from active power sensor (Issue #51)

Thanks for the suggestion. I've never heard of a three battery setup, one on each phase. In the real world this would surely be very expensive as you'd have to have three inverters. Anyway it would be possible to implement this using an integrating input helper for each phase. If you integrate the active power over time you will get the energy in kWh and then you can use that sensor as an input to any batteries you want to add.

On Wed, 2 Nov 2022 at 12:04, GentleJan @.<mailto:@.>> wrote:

I am using an homewizard p1 power meter and the HA integration ( https://www.home-assistant.io/integrations/homewizard/) This device not only has Total energy export/import T1/T2 but also Active power (w) and Active power L1,L2,L3 (w per fase). It would be great to have the possibility to use the total active power and/or L1,L2,L3 as input for de battery sim. Than i could put in 3 batteries each on one fase.

— Reply to this email directly, view it on GitHub https://github.com/hif2k1/battery_sim/issues/51, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAIZGN5RPRRXZ2ZCXMW2ZDWGJKF3ANCNFSM6AAAAAARVAFWKU . You are receiving this because you are subscribed to this thread.Message ID: @.<mailto:@.>>

— Reply to this email directly, view it on GitHubhttps://github.com/hif2k1/battery_sim/issues/51#issuecomment-1301964701, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOE7WVXZDWSQM2ZYBXUB5LLWGOOYNANCNFSM6AAAAAARVAFWKU. You are receiving this because you authored the thread.Message ID: @.**@.>>

GentleJan commented 1 year ago

Can i also ask a question (dont know how else to directly contact you?). 2022-11-03_13h15_39 why do i only see 700w/1400w 2.0 Kw readings?and nothin in between? also at the discharge rate.. 2022-11-03_13h18_00

hif2k1 commented 1 year ago

The simulated export and import values will be correct for the phase that the battery is on. They are mainly there for use in the energy dashboard which supports adding multiple meters so could you create three batteries - one for each phase - and then add their respective simulated imports and exports to the energy dashboard?

I think the charging and discharging rate spikes are there because of rounding. If the meter reports every 10 seconds and it is incrementing by 0.013 every time, but rounding that to two decimal places then: At time 0 it will report 0.01 (0.013 rounded) At time 10s it will report 0.03 (0.026 rounded) At time 20s it will report 0.04 (0.040 rounded)
At time 30s it will report 0.05 (0.053 rounded) From the batteries perspective at 10s it looks like it is charging twice as fast as at the other times. This doesn't affect the total energy flow as the discrepancies cancel out over time. Perhaps some smoothing of the values or running average of the last few readings would be more comprehensible through.