Smart Shift - Running Devices When Energy is Cheaper and Greener

HA seems to be a good choice to run devices when energy is cheaper and greener, but I couldn’t find any specific automations to assist with this task.

What are you doing to time shift your devices to the ‘solar soak’ window to reduce costs and maximise consumption of renewable energy?

I quite like the execution of Amber Electric Smart Shift, but it isn’t available where I live so I have pulled together some Automations to deliver the same outcome. As these Automations are not specific to Amber Electric, they should be reusable for any provider where you can access the pricing, or even to manage consumption of excess solar.

In brief Amber is an Australian electricity retailer that provides access to wholesale electricity prices. Customers monitor the wholesale price and shift their energy usage to cheaper, greener times. This saves them money and supports the shift to a more renewably-powered Australia.

A graph showing the average wholesale electricity price throughout the day, with the cheapest times highlighted as the times when amber would turn on a customers smart devices

@madpilot has done a great job getting the Amber Electric Integration into HA core and my automations are based off that.

What I have done is setup three automations that Trigger off the sensor.amber_general_price; High Price (Red), OK Price (Yellow) and Low Price (Green) and which then call Actions to notify the pricing changes, and switch relevant devices on and off to match the price state.

Actions lists include:

Of course there are many ways to achieve the same outcome and some fine tuning around which loads you actually want to start and stop is important, but it is easy to add additional loads if they are integrated into home assistant. I have also been playing around with limiting times, so things don’t start making noise/ announcements in the middle of the night. It is also great to track the energy (via Energy Management) and power (via Tesla Style Power Card for each of these devices to give me a good understanding for what is occuring in my home.

I’d be interested in hearing how others are doing their load shifting to either maximise solar self consumption or reduced cost of operations?

For example I have my Tesla charging rate matched to my solar production:

I have configured all three Automations using the GUI, but include the YAML for reference here:

Low Price (Green) Alert

alias: Low Price (Green) Alert
description: Actions when amber price is in green zone
trigger:
  - platform: numeric_state
    entity_id: sensor.amber_general_price
    below: '0.20'
condition: []
action:
  - service: tts.cloud_say
    data:
      entity_id: media_player.home_group
      message: It's cheap and green to use energy right now!
  - type: turn_on
    device_id: d812826aeed3155a16f834ec0142ab35
    entity_id: switch.pool_socket_1
    domain: switch
  - type: turn_on
    device_id: 30ce25127fdb22d40a44d92a4a9593fb
    entity_id: switch.dishwasher_plug
    domain: switch
  - type: turn_on
    device_id: e0f12c9615840d77176395a46370fb59
    entity_id: switch.washing_machine
    domain: switch
  - type: turn_on
    device_id: 5b202246d0a4683ddbe328579cb8f5ce
    entity_id: switch.dryer_outlet
    domain: switch
  - type: turn_on
    device_id: 94c3bbfe8ba40736026dfe497b97072a
    entity_id: switch.microwave_outlet
    domain: switch
  - service: notify.notify
    data:
      message: >-
        It is cheep and green to use energy right now with above average
        renewables in the grid.
      title: Electricity - Low Price (Green) Alert
  - device_id: 86d6b82bf861abbf8c2f23f8ce6ec2d7
    domain: vacuum
    entity_id: vacuum.gary
    type: dock
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - type: turn_on
    device_id: 9f4c92e8ec55a1ff1754168da72c7845
    entity_id: switch.duka_charger_switch
    domain: switch
  - device_id: d67eab4ace0272da1a43b3fd60d2cbcc
    domain: climate
    entity_id: climate.sensibo_family
    type: set_hvac_mode
    hvac_mode: cool
mode: single

High Price (Red) Alert

alias: High Price (Red) Alert
description: Actions when amber price is in red (high prices) zone
trigger:
  - platform: numeric_state
    entity_id: sensor.amber_general_price
    above: '0.29'
  - platform: state
    entity_id: binary_sensor.amber_price_spike
    from: 'Off'
    to: 'On'
condition: []
action:
  - service: notify.notify
    data:
      title: 'Electricity - High Price (Red) Alert '
      message: It is expensive and dirty to use energy right now.
  - service: tts.cloud_say
    data:
      entity_id: media_player.home_group
      message: It is expensive and dirty to use energy right now.
  - type: turn_off
    device_id: 30ce25127fdb22d40a44d92a4a9593fb
    entity_id: switch.dishwasher_plug
    domain: switch
  - type: turn_off
    device_id: e0f12c9615840d77176395a46370fb59
    entity_id: switch.washing_machine
    domain: switch
  - type: turn_off
    device_id: 9f4c92e8ec55a1ff1754168da72c7845
    entity_id: switch.duka_charger_switch
    domain: switch
  - device_id: 86d6b82bf861abbf8c2f23f8ce6ec2d7
    domain: vacuum
    entity_id: vacuum.gary
    type: clean
  - type: turn_off
    device_id: d812826aeed3155a16f834ec0142ab35
    entity_id: switch.pool_socket_1
    domain: switch
  - device_id: d67eab4ace0272da1a43b3fd60d2cbcc
    domain: climate
    entity_id: climate.sensibo_family
    type: set_hvac_mode
    hvac_mode: 'off'
mode: single

OK Price (Yellow) Alert

alias: OK Price (Yellow) Alert
description: Actions when amber price is in yellow (OK prices) zone
trigger:
  - platform: numeric_state
    entity_id: sensor.amber_general_price
    above: '0.20'
condition: []
action:
  - service: notify.mobile_app_pixel_6
    data:
      title: Electricity - OK Price (Yellow) alert
      message: Carry on with normal usage, as prices are around the average.
  - service: tts.cloud_say
    data:
      entity_id: media_player.home_group
      message: Carry on with normal usage, as prices are around the average.
  - type: turn_off
    device_id: 9f4c92e8ec55a1ff1754168da72c7845
    entity_id: switch.duka_charger_switch
    domain: switch
  - type: turn_off
    device_id: d812826aeed3155a16f834ec0142ab35
    entity_id: switch.pool_socket_1
    domain: switch
  - device_id: d67eab4ace0272da1a43b3fd60d2cbcc
    domain: climate
    entity_id: climate.sensibo_family
    type: set_hvac_mode
    hvac_mode: 'off'
mode: single
3 Likes

This is excellent! How often are the TTS alerts triggering?

Thanks it seems to be running pretty well.

TTS updates are only occurring when the price sensor crosses the threshold so sometimes 30 minutes, but other times it can go for a couple of hours before a threshold is crossed.

Locally Amber have again redefined the thresholds to different values and introduced an Orange traffic light, in addition to regular RYG, so I can update my values, but it would be neat for the integration to provide the upstream traffic light, if possible.

The other major function that Smart Shift has and I haven’t been able to replicate is control of battery export during price spike events to help stablise the grid.

I’m considering adding the traffic lights.

However, if you want match it up now:

Spot price < 0: Negative (I represent this with cyan)
0 <= perKwh < DMO price: Cheap (Green)
DMO < perKwh <= DMO * 1.1: Average (Yellow)
DMO * 1.1 < perKwh <= DMO * 1.2: High (Orange)
DMO * 1.2 < perKwh < Spot Price 300: Very High (Red)
Spot Price >= 300: Spike! (Purple)

Hit me up with your network if you need to know the current DMO price.