hif2k1 / battery_sim

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

request: add charging and discharging rates so it can be used in the energy dashboard. #9

Closed aaamoeder closed 2 years ago

aaamoeder commented 2 years ago

As the title says. I'm using this but I'd love to integrate it into the energy dashboard, but for that I need a charging and discharging rate. Would be awesome if this could be added !!! Thanks for your work making this component

joe98477 commented 2 years ago

Fantastic work on this component!! This would have to be as separate entities? Attributes would require a template sensor to integrate into the energy dashboard but either way having access to these values would be great for doing full simulations on energy management with different sized batteries.

hif2k1 commented 2 years ago

I have just released an update that supports this so if you update the extension in HACS this should be visible for you. It is an attribute I'm afraid so you would need to add a template sensor. If a lot of people want this as an additional sensor this can be done, but I don't want to add loads of additional sensors that might just be confusing. Hope it works, let me know if there are any issues.


  - sensor: 
      - name: rate_of_charge
        state: "{{ state_attr('sensor.tesla_powerwall', 'current_rate_of_charging_kw') | float }}"
        unit_of_measurement: 'kW'
 - sensor:
      - name: rate_of_discharge
        state: "{{ state_attr('sensor.tesla_powerwall', 'currrent_rate_of_discharging_kw') | float }}"
        unit_of_measurement: 'kW'
aaamoeder commented 2 years ago

hero !!! 🥇

aaamoeder commented 2 years ago

two small remarks.. It seems the charge and discharge attributes are switched... and You have made a small spelling mistake in the discharging attribute ... (3 r's)

;-)