Hi,
Love the work @del13r .
I’m sorry to have to do this. I have spend the last 3 night after work trying to nut this out.
From ready over this thread many times, I suspect it is my config.
I am only getting the Energy IMPORT available in the Energy integration. The Energy Export and Solar Corrected do not come up as entities for me to select.
Could anyone please help me know where I am going wrong to get this going.
template:
- sensor:
name: Grid Import Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.oakmont_solar_current_energy_consumption') | int - states('sensor.oakmont_solar_current_energy_production') | int ] | max }}
- sensor:
name: Grid Export Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.oakmont_solar_current_energy_production') | int - states('sensor.oakmont_solar_current_energy_consumption') | int ] | max }}
- sensor:
name: Solar Power Corrected
state_class: measurement
icon: mdi:solar-panel
unit_of_measurement: W
device_class: power
state: >
{% set value = states('sensor.oakmont_solar_current_energy_production') | int %}
{% if value <= 5 %}
0
{% elif is_state("sun.sun","below_horizon") %}
0
{%- else -%}
{{ value }}
{%- endif %}
sensor:
- platform: template
sensors:
envoy_current_exporting:
friendly_name: "Current Energy Exporting"
value_template: "{{ [0, (states('sensor.oakmont_solar_current_energy_production') | int - states('sensor.oakmont_solar_current_energy_consumption') | int)] | max }}"
unit_of_measurement: 'W'
icon_template: 'mdi:flash'
envoy_current_importing:
friendly_name: "Current Energy Importing"
value_template: "{{ [0, (states('sensor.oakmont_solar_current_energy_consumption') | int - states('sensor.oakmont_solar_current_energy_production') | int)] | max }}"
unit_of_measurement: 'W'
icon_template: 'mdi:flash'
- platform: integration
name: Grid Import Energy
source: sensor.grid_import_power
unit_prefix: k
unit_time: h
device_class: energy
- platform: integration
name: Grid Export Energy
source: sensor.grid_export_power
unit_prefix: k
unit_time: h
device_class: energy
- platform: integration
name: Solar Energy Corrected
source: sensor.solar_power_corrected
unit_prefix: k
unit_time: h
device_class: energy
type or paste code here
Really appreciate any assistance. Its doing my head in.
Thanks.