Skip to content

Instantly share code, notes, and snippets.

@danielolsson100
Last active September 2, 2022 11:13
Show Gist options
  • Save danielolsson100/d691359c6e5bd4d87934318da7939358 to your computer and use it in GitHub Desktop.
Save danielolsson100/d691359c6e5bd4d87934318da7939358 to your computer and use it in GitHub Desktop.
update easee charger threshold from ferroamp data
This is instructions to dynamic update Easee charger circuit limit with dynamic data from ferroamp without adding additional load to ACE.
Reguired components:
Home Assistant with an Easee charger and Ferroamp Energyhub
Integrations:
https://github.com/henricm/ha-ferroamp
https://github.com/fondberg/easee_hass
You need to know or find your circuit id of your Easee charger and that is displayed in various places in the HA / Easee integration.
1. Edit configuration.yaml and add these rows below to create a custom sensor for each phase
# Grid Current for Easee charger threshold
sensor:
- platform: template
sensors:
grid_current_l1:
value_template: "{{ (state_attr('sensor.ferroamp_grid_current','L1')*-1) | int }}"
friendly_name: "Grid Current - L1"
unit_of_measurement: "A"
- platform: template
sensors:
grid_current_l2:
value_template: "{{ (state_attr('sensor.ferroamp_grid_current','L2')*-1) | int }}"
friendly_name: "Grid Current - L2"
unit_of_measurement: "A"
- platform: template
sensors:
grid_current_l3:
value_template: "{{ (state_attr('sensor.ferroamp_grid_current','L3')*-1) | int }}"
friendly_name: "Grid Current - L3"
unit_of_measurement: "A"
2. Restart HA to get the sensors above up and running.
3. Edit automamation.yaml with the following entries as an example, (do it in the GUI)
- id: '1628865016785'
alias: .Easee - Update circuit threshold
description: ''
trigger:
- platform: state
entity_id:
- sensor.grid_current_l1
- platform: state
entity_id:
- sensor.grid_current_l2
- platform: state
entity_id:
- sensor.grid_current_l3
condition: []
action:
- service: easee.set_circuit_dynamic_limit
data:
circuit_id: <enter your circuit ID here>
currentP1: '{{ (16 - (state_attr(''sensor.ferroamp_grid_current'',''L1'')*-1)
- state_attr(''sensor.easee_circuit_current'',''state_circuitTotalPhaseConductorCurrentL1''))
| int }}'
currentP2: '{{ (16 - (state_attr(''sensor.ferroamp_grid_current'',''L2'')*-1)
- state_attr(''sensor.easee_circuit_current'',''state_circuitTotalPhaseConductorCurrentL2''))
| int }}'
currentP3: '{{ (16 - (state_attr(''sensor.ferroamp_grid_current'',''L3'')*-1)
- state_attr(''sensor.easee_circuit_current'',''state_circuitTotalPhaseConductorCurrentL3''))
| int }}'
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment