Skip to content

Instantly share code, notes, and snippets.

@danielolsson100
Last active July 13, 2024 08:24
Show Gist options
  • Save danielolsson100/2a77c0799bd5dfdaaa3363f126728450 to your computer and use it in GitHub Desktop.
Save danielolsson100/2a77c0799bd5dfdaaa3363f126728450 to your computer and use it in GitHub Desktop.
Control Import / Export with Ferroamp portal access
This automation uses https://github.com/jonasbkarlsson/ferroamp_operation_settings/ to control Ferroamp Export/Import thresholds with HA
alias: Ferroamp - Cloud API
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bs_ep_low
- platform: state
entity_id:
- sensor.easee_status
- platform: time_pattern
minutes: "0"
seconds: "5"
condition:
- condition: state
entity_id: sensor.ferroamp_control_status
state: auto
action:
- if:
- condition: state
entity_id: sensor.easee_status
state: charging
then:
- service: number.set_value
metadata: {}
data:
value: "-11000"
target:
entity_id: number.ferroamp_operation_settings_export_threshold
- service: number.set_value
metadata: {}
data:
value: "11000"
target:
entity_id: number.ferroamp_operation_settings_import_threshold
else:
- if:
- condition: state
entity_id: binary_sensor.bs_ep_low
state: "on"
then:
- service: number.set_value
metadata: {}
data:
value: "11000"
target:
entity_id: number.ferroamp_operation_settings_import_threshold
- service: number.set_value
metadata: {}
data:
value: "0"
target:
entity_id: number.ferroamp_operation_settings_export_threshold
else: []
- if:
- condition: state
entity_id: binary_sensor.bs_ep_above_average
state: "on"
then:
- service: number.set_value
metadata: {}
data:
value: "0"
target:
entity_id: number.ferroamp_operation_settings_import_threshold
- service: number.set_value
metadata: {}
data:
value: "-11000"
target:
entity_id: number.ferroamp_operation_settings_export_threshold
- service: button.press
metadata: {}
data: {}
target:
entity_id: button.ferroamp_operation_settings_update
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment