Thanks for sharing this! This is going to get me to re-think my setup entirely…
However, I still think I’m missing something in regard to the home energy usage sensor.
So you use sensor.powerwall_load_now as the source for a Riemann integral to create sensor.energy_consumed_by_house. And then use that Riemann integral sensor as the source for sensor.energy_consumed?
And then what specifically is populating that information in the Energy kWh power-flow-card? I don’t see sensor.energy_consumed listed in your Energy kWh yaml above. Does the power-flow-card calculate this daily home usage automatically or am I missing something else?
Transparently, I’m trying to figure out why my daily home energy usage Utility Meter with sensor.powerwall_load_import as the source is not matching the Tesla app as I outlined in this thread. I hadn’t tried using a Riemann integral for this, so I’m wondering if that’s why it’s not working…however the difference in values in the history ofsensor.powerwall_load_import from now to the previous midnight matches up with the value in the Tesla app, but not in the Utility Meter I built off of it.
So you only have the value for home energy usage within the power-flow-card and do not have a sensor outside of it that reports the same number? This is what I’m looking for since a Utility Meter on sensor.powerwall_load_import is not properly calculating the value and I haven’t been able to find a solution to this yet. Thanks for the info.
name: “solar_battery_energy_to_full”
unique_id: “solar_battery_energy_to_full”
state: >
{% set percent = states(‘sensor.battery_state_of_charge’) | float(0) / 100.0 | float(0) %} ## IS THIS SUPPOSED TO BE THE CURRENT BATTERY’S SOC (I.E. 50%) OR THE AMOUNT OF WATTS GOING INTO THE BATTERY? ##
{% set number = 2 %} ## I HAVE 2 BATTERIES ##
{% set energy = 3.5 | float(0) %} ## EACH BATTERY HOLDS 3.5KWH ##
{% set reserve = 10 %} ## I USE 10% AS A RESERVE ##
{% set charge = ((1.0 - percent) * number * energy) | float(0) %}
{{ charge }}
I’ve created a new sensor off my rundown sensor to project the rundown time onto the current time. I can now estimate what time my batteries will be depleted.
That looks great! Could you share the yaml or what you did to get those type of cars in your view?
Also @AllHailJ thanks again for sharing your yaml to create the sensors. Have you done anything so the updates don’t pollute your logbook? It seems like every minute I get a new logbook update of the change x 3 sensors. I’ve tried adding some lines to my configuration to filter those out, but they still show for me. Curious if this bothers anyone else and/or if there’s a recommended workaround.
To clarify, I was referring to updates in the logbook (literally every time expected remaining changes, it adds an entry to the logbook), not updates to Home Assistant. Sorry for the lack of clarity.
An example here’s a screenshot of my logbook. If you notice the PW + Reserve @ Current Power sensor that updated twice in 30 seconds. I was curious if you did anything to filter these types of events from the logbook since the utility of the update frequency is minimal.
My understanding is that this happens for all sensors, real or virtual. It’s part of the core system. If I have this behavior wrong, I hope someone will correct me. I do not filter the log book in any manner. My understanding is also that anytime an input to a sensor changes, the sensor changes and that is causing the sensor recalculation. Again if I have this wrong…
I read in the logbook documentation that you can exclude an entity from being recorded. Maybe that’s what you are looking for so it doesn’t flood your logbook?
Thank you both. Yes, I tried to add a logbook exclude section to my configuration, but it didn’t seem to work for me as the items would still populate. That’s why I was wondering if anyone else had tried to address this.
Hi
What is the visualisation you use right now for your Alpha ESS system? I also have an AlphaESS inverter with storage and have all those values in my home assistant. But for now only the values, no visual effects, no history.
I would like to see yours to get some good ideas and maybe also import some existing work to have a smooth start.
Hi I adapted the code from @SpookyAwol and added it to my configuration.yaml file (separating them out is on my todo list) but the sensor isn’t appearing in my list on Home Assistant. Can anyone spot any glaring issues? It worked in developer, without the extra templates above it, still new to the yaml syntax. Ignore the indenting issure at the top, that’s happened as copying and pasting
template
- name: "solar_battery_life"
state: >
{% set percent = states('sensor.foxess_bat_soc') | float(0) / 100.0 %}
{% set energy = 8.6 | float(0) %}
{% set reserve = 0.11 | float(0) %}
{% set charge = (percent - reserve) * energy | float(0) %}
{% set a = states('sensor.foxess_pv_power') | float(0) %}
{% set b = states('sensor.foxess_load_power') | float(0) %}
{% set c = states('sensor.foxess_bat_discharge_power') | float(0) %}
{% set d = states('sensor.foxess_bat_charge_power') | float(0) %}
{% if float(percent) == 100 %}
Battery is full/Not charging. Current House load {{ b }}
{% elif float(c) > 0 %}
Battery is discharging
{% set current_power = a + b + c %}
{% elif float(d) > 0 %}
Battery is charging
{% set current_power = a + b + d %}
{% endif %}
{% set decimal_hours = charge / current_power %}
{% set minutes = (decimal_hours % 1 * 60) | round(0) %}
{% if minutes <= 9 %}
{% set min = '0' ~ minutes | string %}
{% else %}
{% set min = minutes | string %}
{% endif %}}
{% if float(c) > 0 %}
{{ "SOC: " ~ percent ~ "%, Empty in:" ~ decimal_hours | int(0) ~ ' hrs ' ~ minutes ~ ' minutes' }}
{% elif float(d) > 0 %}
{{ "SOC: " ~ percent * 100 ~ "%, Full in: " ~ decimal_hours | int(0) ~ ':' ~ min }}
{% endif %}