Australia has a rather unique energy market, being both the longest in the world (4500km) and giving consumers direct exposure to the wholesale market through multiple retailers.
While Amber Electric has been the go-to for enthusiasts in the past, the explosion of home batteries in Australia (thanks to Federal government rebates) has led to some interesting new products on the market.
Easy Mode - GloBird Zero Hour
For a Tesla Powerwall customer, GloBird is the easiest to set up and benefit from, as they give you three hours of free electricity and $1 for not using power during peak. This means rain or shine your Powerwall's built-in tariff system can keep your battery charged off solar or the grid and give you a really small bill, providing you have enough capacity.
But that's not what we're talking about today, that's too easy.
Hard Mode - FlowPower Happy Hour
FlowPower offers consumers wholesale pricing with no monthly subscription, but also a fixed 45c (in most states) feed-in tariff for two hours daily. This means a sufficiently sized battery can run off stored solar, import when it's cheap if required, but dump the excess into the grid for a small profit every day.
Since getting my new Powerwall 3 with two expansions (a little over 40kWh rated capacity) I've been using the Powerwall Time of Use tariff to successfully export for two hours most nights, but this approach had some serious flaws.
Tesla's solar forecasting doesn't work, or isn't strict enough, because after dumping my excess power one night it proceeded to rain for a week, and I had no reserves to carry me through. The second issue was exporting during the day, because while I want to export as much as possible during the "happy hours", I didn't want to contribute to grid instability by exporting during the midday peak — but having export enabled was also a prerequisite for Tesla's native charge-on-solar feature.
There are robust solutions to these problems, with PredBat a popular choice, but I figured this was a simple mathematics problem that the new Powerwall Local integration could help solve.
DIY Energy Management
My solution has two parts, each with their own automations: a battery export controller, and a car charging controller. Each works within the constraints of the Tesla ecosystem, and is designed to optimise for profit with a safe margin for error and restrained API command usage.
Export Budgeting and Control
The most important part of controlling my Powerwall export is accurately estimating the amount of energy I can export while leaving enough for my household usage, which is a moving target throughout the day. To do this I created a template sensor that I call battery_export_budget.
{{
max(min(float(states('sensor.solcast_pv_forecast_forecast_tomorrow')),float(states('sensor.total_battery_capacity'))*0.75)
- float(states('sensor.base_load_until_solar'))
- float(states('sensor.outside_energy_site_battery_free_capacity')),0)
| round(3)
}}
The first section gets the solar forecast for tomorrow, up to 75% of my battery capacity. This base figure identifies how much of the battery we expect we'll be able to refill from the sun, while still leaving a 25% backup reserve.
Then I subtract my expected base load until solar starts the next day, which is just the number of hours until sunrise multiplied by my base load set in an input number. This ensures I leave enough energy for my own home use, but lets me flexibly adjust the estimate using the input number as required. I store this in another template sensor called base_load_until_solar.
{% set target = as_datetime(state_attr('sun.sun', 'next_rising')) + timedelta(hours=1) %}
{% set hours = (target - now()).total_seconds() / 3600 %}
{{ (hours * float(states('input_number.base_load'))) | round(0) }}
Finally I subtract how much free capacity my Powerwalls have, ensuring I'm going to be able to charge the Powerwall back up to ~100%.
The end result is a moving target of how much energy I can afford to export to the grid. Now we simply use an automation to check the time of day and the numerical state of the export budget, to start or stop exporting during the FlowPower "Happy Hour" export window.
alias: Flow Power Export Controller
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.battery_export_budget
for:
hours: 0
minutes: 1
seconds: 0
above: 1
id: start
enabled: false
- trigger: numeric_state
entity_id:
- sensor.battery_export_budget
for:
hours: 0
minutes: 1
seconds: 0
below: 0.2
id: stop
- trigger: time
at: "17:30:00"
id: start
- trigger: time
at: "19:30:00"
id: stop
conditions:
- condition: time
after: "17:29:00"
before: "19:31:00"
actions:
- choose:
- conditions:
- condition: trigger
id:
- stop
sequence:
- if:
- condition: state
entity_id: select.energy_site_operation_mode
state:
- self_consumption
then: []
else:
- action: select.select_option
metadata: {}
target:
entity_id: select.energy_site_operation_mode
data:
option: self_consumption
- if:
- condition: state
entity_id: select.energy_site_allow_export
state:
- never
then: []
else:
- action: select.select_option
metadata: {}
target:
entity_id: select.energy_site_allow_export
data:
option: never
- conditions:
- condition: trigger
id:
- start
- condition: time
before: "19:00:00"
- condition: numeric_state
entity_id: sensor.battery_export_budget
above: 1
sequence:
- if:
- condition: state
entity_id: select.energy_site_operation_mode
state:
- autonomous
then: []
else:
- action: select.select_option
metadata: {}
target:
entity_id: select.energy_site_operation_mode
data:
option: autonomous
- if:
- condition: state
entity_id: select.energy_site_allow_export
state:
- battery_ok
then: []
else:
- action: select.select_option
metadata: {}
target:
entity_id: select.energy_site_allow_export
data:
option: battery_ok
mode: restart
On a good day, this just exports approximately 10kW for two hours, earning around $7 per day.

On a bad day, the automation prevents exporting altogether, or limits it to only the energy I can spare.

EV Charging Control
The second half of the puzzle is my car. During the day I want to soak up surplus solar into the car — but only the solar that's genuinely spare after the house battery is looked after, and never at the expense of the evening export budget. The car charging budget is calculated much like the export budget, as a template sensor:
{{
max(float(states('sensor.solcast_pv_forecast_forecast_remaining_today'))
- float(states('sensor.base_load_while_solar'))
- float(states('sensor.outside_energy_site_battery_free_capacity')),0)
| round(3)
}}
This takes the solar still forecast for the rest of today, subtracts the base load I expect to use while the sun is up, and subtracts the free capacity left in the Powerwalls. Whatever is left over is energy the car can take without stealing from the house or the evening export.
That budget decides whether the car should charge today, but I still need to make sure I'm charging off genuine surplus and not quietly importing from the grid. So a second automation pairs the daily budget with live solar production before it touches the car.
alias: FlowPower EV Controller
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.battery_ev_budget
for:
hours: 0
minutes: 1
seconds: 0
above: 5
id: "on"
- trigger: numeric_state
entity_id:
- sensor.battery_ev_budget
for:
hours: 0
minutes: 1
seconds: 0
below: 0.1
id: "off"
- trigger: numeric_state
entity_id:
- sensor.v1r_solar_power
for:
hours: 0
minutes: 1
seconds: 0
above: 5000
id: "on"
- trigger: numeric_state
entity_id:
- sensor.v1r_solar_power
for:
hours: 0
minutes: 1
seconds: 0
below: 4000
id: "off"
- trigger: state
entity_id:
- sensor.sonic_charging
to:
- charging
- stopped
for:
hours: 0
minutes: 0
seconds: 10
conditions:
- condition: state
entity_id: binary_sensor.sonic_charge_cable
state:
- "on"
- condition: numeric_state
entity_id: sensor.sonic_battery_level
below: number.sonic_charge_limit
- condition: state
entity_id: sensor.sonic_charging
state:
- stopped
- starting
- charging
- condition: zone.in_zone
target:
entity_id: device_tracker.sonic_location
options:
for: "00:00:00"
zone: zone.home
behavior: any
actions:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.battery_ev_budget
above: 5
- condition: state
entity_id: sensor.sonic_charging
state:
- stopped
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.v1r_solar_power
above: 4800
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.v1r_charge
above: 90
- condition: numeric_state
entity_id: sensor.v1r_solar_power
above: 50
sequence:
- action: switch.turn_on
metadata: {}
target:
entity_id: switch.sonic_charge
data: {}
- conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.battery_ev_budget
below: 0.1
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.v1r_solar_power
below: 4200
- condition: numeric_state
entity_id: sensor.v1r_charge
below: 88
- condition: state
entity_id: sensor.sonic_charging
state:
- charging
sequence:
- action: switch.turn_off
metadata: {}
target:
entity_id: switch.sonic_charge
data: {}
mode: single
It only ever runs when the car is home, plugged in, and still below its charge limit. From there it charges when the day's EV budget is healthy and there's enough live solar to actually sustain a charge right now — roughly 4.8kW, near the minimum single-phase rate — or just a trickle if the car is already nearly full. It stops again when the budget runs dry or live solar drops away.

The gap between the ~4.8kW start threshold and the ~4.2kW stop threshold is deliberate. That deadband means a passing cloud won't make the automation flip the charge switch on and off every minute, which keeps it from wasting commands against the car — the same restraint the export controller uses. Between the two, the car soaks up spare sun during the day and gets out of the way before the evening happy hour begins.
Wrapping up
With my first bill in hand, this methodolgy is already paying off with a $40 credit, despite having a quite a few days of rain, bad solar, and mistakes a long the way tuning the thresholds. Now the system is in autopilot, it exports through the FlowPower happy hour almost every night, without ever compromising my own household usage or the solar my car needs during the day. When the forecast turns bad, the budgets quietly shrink and the automations hold back — no flat battery the morning after, and no importing at peak to make up for an over-eager export.
All of this without the complexities of linear programming systems like PredBat or EMHASS. The export and charging commands all run through Teslemetry, which will soon work locally without the cloud, and because every decision is gated and deadbanded, it only sends one when something genuinely needs to change. For a setup like mine, that's more than enough to profit with the flow.