Amber Electric (Australia) Custom Component

Here is a configuration using ApexCharts card - A highly customizable graph card to display Amber price forecasts.

type: custom:apexcharts-card
experimental:
  color_threshold: true
span:
  start: minute
  offset: '-2h'
header:
  show: true
  title: Battery, Price & Cost Forecast
  show_states: true
  colorize_states: true
now:
  show: true
  label: Now
series:
  - entity: sensor.amber_general_forecast
    float_precision: 2
    yaxis_id: first
    curve: stepline
    unit: $/kWh
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
  - entity: sensor.amber_feed_in_forecast
    float_precision: 2
    yaxis_id: first
    curve: stepline
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    name: feed in forecast
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
yaxis:
  - id: first
    decimals: 1
    max: 1
    min: 0
    apex_config:
      tickAmount: 2
      logarithmic: false
  - id: second
    show: false
    opposite: false
    decimals: 1
    max: 100
    min: 0
    apex_config:
      tickAmount: 2
view_layout:
  position: main
1 Like

@markpurcell Hi Mark, I think we crossed paths recently on GitHub with reference to exposing the data from individual Powerwall Batteries.

I am thinking of switching to Amber and it seems equipment compatibility is okay, being Solar Edge inverters and Powerwall2’s. Do you have any experience/advice when three single-phase inverters and two Powerwall2’s are connected to separate phases of a 3-phase system?

I know that I will have to disable Modbus in the short term and that I should be able to reenable for monitoring after onboarding to SmartShift, or are you suggesting that control is best automated in HA?

I would be concerned that my lack of knowlege/skills in programing would lead to undesirable import/export/curtailing outcomes and think that leaving control with SmartShift might be better for me.

I would recommend you enroll your powerwalls into SmartShift and that will do a good job of controlling your exports and imports from the grid.

Which energy network are you on?

I would recommend against enrolling your SolarEdge PV inverters in SmartShift, the curtailment is in many ways better done locally and the automation is pretty straight forward. You can setup and test the curtailment automations now before you even transfer to Amber to get some confidence before making the switch. The loss of control of your SolarEdge inverters can cause you issues down the track. However if local control doesn’t work out you can always enroll and switch SolarEdge to SmartShift later.

With regards to three phase and two batteries, if the battery gateway is setup correctly it should see all your loads across all phases and the batteries will compensate by exporting sufficient power that it remains net zero. I have one battery backing up an essential circuits board, but not the others.

Also in a grid outage a three phase solar inverter cannot be energized (as it needs all three phases) so you won’t be able to recharge the batteries.

Thanks Mark. Like you, only one of my batteries backs up the essential circuits. That battery only is able to be recharged from solar panels connected to same phase through the single phase inverter. I’ll investigate the curtailment automations when i have time.

I am with Ausgrid.

1 Like

If you are on AusGrid I recommend you run very quickly and sign up for the two way (export) tariff! (and potentially get another battery)

1 Like

This is cool. I’ve tried to replicate this but show “Renewables” instead of feed in (I’ve yet to get a battery) - but doesn’t seem to be working.

Any thoughts?

Unfortunately Amber doesn’t provide a Renewables forecast like it does for price and cost, so the best you can do is to display current Renewables.

image

type: custom:apexcharts-card
experimental:
  color_threshold: true
span:
  start: minute
  offset: '-2h'
header:
  show: true
  title: Price & Cost Forecast + Renewables
  show_states: true
  colorize_states: true
now:
  show: true
  label: Now
series:
  - entity: sensor.amber_general_forecast
    float_precision: 2
    curve: stepline
    unit: $/kWh
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
  - entity: sensor.amber_feed_in_forecast
    float_precision: 2
    curve: stepline
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
  - entity: sensor.amber_renewables
yaxis:
  - id: first
    decimals: 1
    max: 1
    min: 0
    apex_config:
      tickAmount: 2
      logarithmic: false
view_layout:
  position: main

Each forecast in the forecast attribute has a renewable attribute. You can use that.

2 Likes

neat.

image

type: custom:apexcharts-card
experimental:
  color_threshold: true
span:
  start: minute
header:
  show: true
  title: Price & Cost Forecast + Renewables
  show_states: true
  colorize_states: true
now:
  show: true
  label: Now
series:
  - entity: sensor.amber_general_forecast
    float_precision: 2
    yaxis_id: first
    curve: stepline
    unit: $/kWh
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
  - entity: sensor.amber_feed_in_forecast
    float_precision: 2
    curve: stepline
    unit: $/kWh
    yaxis_id: first
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.per_kwh];
      });
  - entity: sensor.amber_feed_in_forecast
    float_precision: 2
    name: Renewables
    curve: stepline
    yaxis_id: second
    color: green
    unit: '%'
    show:
      in_header: after_now
      legend_value: false
    stroke_width: 1
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
        return [new Date(entry.start_time), entry.renewables];
      });
yaxis:
  - id: first
    decimals: 1
    max: 1
    min: 0
    apex_config:
      tickAmount: 2
      logarithmic: false
  - id: second
    decimals: 0
    max: 100
    min: 0
    show: false
view_layout:
  position: main

I thought I’d just share my findings of automating with Amber. As your hot water ultimately makes up 1/4 of most peoples energy consumption, consumes the highest singular rate of power and is easily automated, I tried various methods to determine when to switch on the hot water tank. Including; when the battery level, or Solar power or indeed grid feedin rates were above X amount.

The one I’ve settled on though, is the cheapest 3 hour General Usage window between 7am & 2pm. Effectively your Hot Water tank is just another battery, so heating when the feedin has the bonus 26c doesn’t make sense, you should be exporting. So I get the average of 6 consecutive Amber General Forecast rates (3hrs) starting from the current (NOW) rate and get the start time of cheapest period. Then an automation switches on the tank at the time of the cheapest window, whether it’s 7.30am, 8am, 8.30 etc and switches it off when the tank temperature trip trips (voltage > 1 & Current < 1).

Generally it’s around 10am when the sun is at it’s post productive so you shouldn’t be paying too much anyway. This also means that if any other power hungry devices (Washing Machines, Dishwashers etc) that generally cannot be automated easily are on at that time, your’re only going to be paying the cheapest rate and can also make use of the post 2pm bonus.

Hope this helps.

@madpilot Hi Myles, back around post #178/179 you spoke of possible firmware fix for sub-optimal Solar Edge inverter curtailment. I am expecting my inverters to be enrolled today (if Friday is still the day), so I am keen to know if I have made the right choice or whether I should be automating my own curtailment through HA?
Batts

Which inverter are you getting? Energy Hub’s don’t have the issue (I have one), and I don’t think new genesis inverter have it either.

As far as I know it’s only older HD Wave inverters that have the issue

Hey Amber/HA brains trust. Has anyone figured out how to control Amber Smartshift through their APIs or from within HA? I think my own algorithms would be better than SmartShift and I’m confident I know when to dump my battery and when to load it up.

For example, I often have periods where the general price is $0.05 but Smartshift doesn’t start loading up the battery… when it should.

That API doesn’t exist yet. Working on it, but don’t have an ETA.

I’m going to assume you have a Powerwall, which is why you can’t just control it via HA?

BTW: Smart shift will beat threshold based rules most of the time. Charging at 5c doesn’t make sense if there is free solar to charge your battery, or if you are unable to dump at a higher price because your predicted load will be close to the battery max discharge (and thus will never hit the grid).

Yes I have a power wall. Why does that change things? If I had a different battery I could control it via API?

When you say “not yet working on it”, am I to assume you’re working on the official integration?

I guess whether smart shift would be better than my implementation is up for debate, because I can’t control it at the moment.

There’s an interesting add-on to Home Assistant that will use more sophisticated methods to not only manage your battery but also your household loads all in the one calculation. But I understand powerwall is very difficult to manage directly. Other batteries have API that allow direct control and are more suited to local management. Have a look at this thread:

There are people managing powerwalls with this system but I think its not easy. I have a sonnen which is easy to control locally but not easy for amber to control because sonnen won’t open their VPP API up to amber.

1 Like

If I had a different battery I could control it via API?

Many other battery manuafacturers can be controlled locally via Home Assistant - SolarEdge for example.

When you say “not yet working on it”, am I to assume you’re working on the official integration?

First step it to get the actual API built, which requires a few internal architectural changes, then after that is done, I’ll add functionality to the Home Assistant integration.

2 Likes

Re: SolarEdge Curtailment - Help please!
@madpilot @markpurcell
I gave up on Amber after waiting 6 weeks for Amber to enroll my inverters, and re-enabled Modbus. Since, I have been trying to get curtailment working. I would really appreciate some help with the correct code and Inverter settings.

When I curtail with a FULL battery, production falls to zero (not mirroring consumption. Note the active power slider.

This is the automation I used for solar curtailment when I was waiting to onboard.

You want to set site_limit to 0, and the i1_limit_control_mode to Export Control

alias: Solar Curtailment
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.amber_feed_in_price
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.amber_feed_in_price
            below: 0
        sequence:
          - service: select.select_option
            data:
              option: Export Control (Export/Import Meter)
            target:
              entity_id: select.solaredge_i1_limit_control_mode
          - service: number.set_value
            data:
              value: "0"
            target:
              entity_id: number.solaredge_i1_site_limit
    default:
      - service: select.select_option
        data:
          option: Disabled
        target:
          entity_id: select.solaredge_i1_limit_control_mode
mode: single

Any word on the progress of this please? This is huge for my setup - while SmartShift is good, there’s a few instances where I’d like to be able to tailor it to my usage where SmartShift hasn’t quite got it figured out yet.