Amber Electric (Australia) Custom Component

Thanks mate, that makes a lot of sense and probably why I wasn’t signed up to smartshift when I first joined (I think I remember clicking join smartshift) but put it down to being solar only.

@markpurcell interesting, I’ll sit on it for a while as I am quite happy with how my current set up works and may struggle to replicate in YAML (due to not knowing it well no doubt).

Wish both of you a Merry Christmas

On a different note, anyone elses amber entities stop updating? None of mine have updated for 4 hours (forecasts, actuals or anything).

Still going strong here:

There is an open bug - restarting the integration fixes it.

All this is managed by Home Assistant core, so I assume there is a back off that eventually gives up if there are issues fetching but I haven’t had time to investigate.

Thanks, restarting did indeed fix it. Didn’t realise that was a thing (still reasonably new to HA) otherwise would have tried earlier.

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.