I have code setup to calculate import and export for the grid, which shows in HA, however when I set the entity in the ChargeHQ code for import and export, nothing flows through.
sensor:
name: Grid Import Power
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_xxxx_current_power_consumption') | int - states('sensor.envoy_xxxx_current_power_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.envoy_xxxx_current_power_production') | int - states('sensor.envoy_xxxx_current_power_consumption') | int ] | max }}
sensor:
name: Battery Export Power
state_class: measurement
icon: mdi:battery-charging
unit_of_measurement: W
device_class: power
state: >
{{ [0, states('sensor.envoy_xxxx_inverter_xxxx') | int ] | max }}
sensor:
name: Battery Import Power
state_class: measurement
icon: mdi:battery-charging
unit_of_measurement: W
device_class: power
state: >
{{ [0, 0 - states('sensor.envoy_xxxx_inverter_xxxxx') | int ] | max }}
sensor:
platform: integration
name: Grid Import Energy
source: sensor.grid_import_power
unit_prefix: k
unit_time: h
method: left
platform: integration
name: Grid Export Energy
source: sensor.grid_export_power
unit_prefix: k
unit_time: h
method: left
platform: integration
name: Battery Export Energy
source: sensor.battery_export_power
unit_prefix: k
unit_time: h
method: left
platform: integration
name: Battery Import Energy
source: sensor.battery_import_power
unit_prefix: k
unit_time: h
method: left
I have code setup to calculate import and export for the grid, which shows in HA, however when I set the entity in the ChargeHQ code for import and export, nothing flows through.
Hoping you can see what's wrong with the code?
Thanks
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend: themes: !include_dir_merge_named themes
automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml
command_line: binary_sensor:
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend: themes: !include_dir_merge_named themes
automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml
command_line:
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend: themes: !include_dir_merge_named themes
automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml
command_line:
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend: themes: !include_dir_merge_named themes
automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml
command_line:
Loads default set of integrations. Do not remove.
default_config:
Load frontend themes from the themes folder
frontend: themes: !include_dir_merge_named themes
automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml
command_line: binary_sensor:
template:
sensor: name: Grid Import Power state_class: measurement icon: mdi:transmission-tower unit_of_measurement: W device_class: power state: > {{ [0, states('sensor.envoy_xxxx_current_power_consumption') | int - states('sensor.envoy_xxxx_current_power_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.envoy_xxxx_current_power_production') | int - states('sensor.envoy_xxxx_current_power_consumption') | int ] | max }}
sensor: name: Battery Export Power state_class: measurement icon: mdi:battery-charging unit_of_measurement: W device_class: power state: > {{ [0, states('sensor.envoy_xxxx_inverter_xxxx') | int ] | max }}
sensor: name: Battery Import Power state_class: measurement icon: mdi:battery-charging unit_of_measurement: W device_class: power state: > {{ [0, 0 - states('sensor.envoy_xxxx_inverter_xxxxx') | int ] | max }}
sensor:
platform: integration name: Grid Import Energy source: sensor.grid_import_power unit_prefix: k unit_time: h method: left
platform: integration name: Grid Export Energy source: sensor.grid_export_power unit_prefix: k unit_time: h method: left
platform: integration name: Battery Export Energy source: sensor.battery_export_power unit_prefix: k unit_time: h method: left
platform: integration name: Battery Import Energy source: sensor.battery_import_power unit_prefix: k unit_time: h method: left