Controlling Air conditioner using Demand Enabled Response Device per AS/NZS 4755

Precooling room using RCAC DRED (Demand Response Enabling Device)

When you have surplus solar, one thing to consider is using it to operate a reverse cycle air conditioner during the day. Assuming you have a good energy meter like the Iammeter WEM3080T connected to Home assistant, It should be possible to use an automation to turn the air conditioner on and off when there is sufficient to run it. This can get a bit complicated if (like me) you have another energy circuit (like hot water) that you want to give priority to.

The idea is by using free solar power during the day to keep a hot room cool, less night time grid energy will be required.

In Australia and New Zealand, Air conditioners have had to comply with AS/NZS 4755 standard since about 2011. This is designed so the energy operator can reduce the Air conditioner’s power consumption in a similar way to how they manage controlled loads. This requires a special receiver module called a Demand Response Enabling Device (DRED) but few people have installed these as they are not mandated. Some Air conditioner are DRED ready and others might be an additional module available at extra cost. Its possible to access the DRED interface with Home Assistant to give greater granularity in power consumption settings.In my case, the one I wanted to control had the DRED interface already fitted as shown below.

So how does the DRED work? It’s pretty simple really. In the displayed configuration, the air conditioner will run at maximum current. If you connect the Common terminal to terminal 3 and current will be limited to 75% of rated power, patch it to terminal 2, it will be limited to 50% of rated power and a connection to terminal 1 will reduce it to 0% of rated power (eg. turn the compressor off but leave the circulation fan running). So sounds pretty simple right? Just grab a couple of relays and go for it! But as always the devil is in the detail. After thinking about various way to set the relays up, I stumbled upon this 4 chanel relay that interfaces with Ewelink that supports Home assistant. The beauty of this device is that it supports mains power which substantially simplifies the wiring. The other nice feature for us is that you can set an interlock mode in the app so that only 1 relay is enabled at any time. Turning any relay on will disable any other relays that are on. Perfect. The delivery timeframe was surprisingly quick! Its a bit annoying that you have to open the case to connect the wires. I accidentally knocked off one of the switches (which will never get used so it won’t matter)

Connecting all the common terminals with the green wire, adding red wires to go to the DRED terminals and mains power wires did not take long.

I tried hard to get this working without measuring the air conditioner power consumption but in the end I grabbed a Shelly 1 pm to measure the power (I did not wire in a switch). I would like to eventually replace this with a Iammeter WEM3080 as its a much more robust device which can use Modbus/TCP to send the power usage to HAS every six seconds. In fact, the Modbus/TCP feature is one of the many things including external wifi antennas that sets the iammeter apart. I currently use a 3 phase and single phase meter. The 3 phase meter can be split into 3 single phase meters.

I already have a Shelly UNI monitoring my hot water temperature with a DS18B20 temperature sensor slipped in under the insulation of the hot water service near the thermostat. Using this in my automations will let me wait until my water is hot before sending power to the Air conditioner.

Time to get some stuff fitted up!

The relay box will end up being a little bit exposed here. I turned the box around so the wires were on the inside to give them more protection once the cover was on. I will revisit this but it’s pretty good once the cover is on.

I did try to integrate a Broadlink RM4 remote into the automations to turn the air conditioner on and off but whilst I have it working from a console switch, it did not seem to want to trigger in an automation which was a bit annoying. Weird!

broadlink2

So with the hardware fitted, Time to work on some automations.

We need switch we can use to enable and disable our DRED system at will

input_boolean:

dred_enable:

name: Enable DRED

icon: mdi:bug

And we need a template that says how much surplus solar we have (before hot water consumption as it will yield to any other loads). Sensor.modbus_power_b is an iammeter on the hot water circuit.

surplus_power:

unit_of_measurement: 'W'

value_template: "{{ (states('sensor.modbus_power_b')|float(0)) + (states('sensor.feedin_power')|float(0)) }}"

And we need another template that calculates the available power for the DRED assuming that the air conditioner is not turned on. This adds back the actual power being used to surplus_power. This is measured by our Shelly 1 pm

- name: "dred_threshold"

state: "{{ states('sensor.surplus_power') | float(0) + (states( 'sensor.shelly1pm_bcff4dfcc2a3_power') | float(0))}}"

We want to make sure the dred is enabled during the day, so we add 2 automations. The first enables the DRED system mid morning

alias: DRED - 4 Hours after sunrise turn on DRED1 (0%)
description: >-
  While sleeping all DRED relays are off. After we wake up, turn DRED1 on (0%
  cooling)
trigger:
  - platform: sun
    event: sunrise
    offset: "+4:00"
condition:
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.100132ea23_1
mode: single

And we want to turn off all relays at sunset

alias: DRED Off at Sunset

alias: DRED Off at Sunset
description: Select Dred relay 4
trigger:
  - platform: sun
    event: sunset
    offset: 0
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.100132ea23_1
        - switch.100132ea23_2
        - switch.100132ea23_3
        - switch.100132ea23_4
mode: single

So the housekeeping is done, its time to set our arbitrary dred thresholds based on our air conditioner specifications. If you add a panel like this, you can disable the automations and flick the switches to observe what happens to the power consumptions at various DRED levels. This will also give you some idea how long it takes for the AC to change from one level to another. I choose 5 minutes.

I chose the following levels:

4: >1000 Watts
3: 750-500 watts
2: 500-750 watts
1. < 500 watts

So now we need a separate automation for each of these levels.

We will use a time pattern trigger to check things every 5 minutes so we don’t change values too frequently.
We want to do the conditions in a specific order so make for an efficient processing
If the integration is enabled
And it is between sunset and sunrise and
The available power is within our desired threshold and
If the water temperature is near the thermostat set point of 73 deg.

You can set these up in the automations tab without dropping to code but to share what I’ve done, its much easier to use show the code

So lets look at what they look like. First the 100% automation

alias: DRED4 100 % power

description: all terminals off

trigger:

- platform: time_pattern

minutes: /5

condition:

- condition: state
  entity_id: input_boolean.dred_enable
  state: "on"
- condition: sun
  before: sunset
  after: sunrise
- condition: numeric_state
  entity_id: sensor.shellyuni_98cdac24e53b_temperature  
  above: 72.5
- condition: numeric_state
  entity_id: sensor.surplus_power
  above: 0
- condition: numeric_state
  entity_id: sensor.dred_threshold
  above: 1000
  action:
- service: switch.turn_off
  data: {}
  target:
  entity_id:
  - switch.100132ea23_1
  - switch.100132ea23_2
  - switch.100132ea23_3
  - switch.100132ea23_4
mode: single

Then the 75% automation

alias: DRED3 75% power
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition:
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
  - condition: sun
    before: sunset
    after: sunrise
  - condition: numeric_state
    entity_id: sensor.shellyuni_98cdac24e53b_temperature
    above: 72.5
  - condition: numeric_state
    entity_id: sensor.surplus_power
    above: 0
  - condition: numeric_state
    entity_id: sensor.dred_threshold
    above: 749
    below: 1001
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.100132ea23_3
mode: single

And the 50% automation

alias: DRED2 50% power

alias: DRED2 50% power
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition:
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
  - condition: sun
    before: sunset
    after: sunrise
  - condition: numeric_state
    entity_id: sensor.shellyuni_98cdac24e53b_temperature
    above: 72.5
  - condition: numeric_state
    entity_id: sensor.surplus_power
    above: 0
  - condition: numeric_state
    entity_id: sensor.dred_threshold
    above: 500
    below: 750
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.100132ea23_2
mode: single

And the final 0% automation

alias: DRED1 0% power
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition:
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
  - condition: sun
    before: sunset
    after: sunrise
  - condition: numeric_state
    entity_id: sensor.shellyuni_98cdac24e53b_temperature
    above: 72.5
  - condition: numeric_state
    entity_id: sensor.dred_threshold
    below: 500
    above: 100
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.100132ea23_1
mode: single

So thats it! Enjoy your cool house!
Phew! Thats a big post!

7 Likes

Good write up. Interesting to learn about DRED

How are you switching the relays if the broadlink isn’t working?

It might be worth creating scripts for the broadlink commands with hold times or repeats to ensure the command is reaching the relay, and calling those in automations instead.

Rf433 is abit flakey at a large distance with the rm4 in my experience.

Edit: oh via ewelink is how you are switching the relays

1 Like

Yeh, I was just going to use the Broadlink to turn on the air conditioner. Its sitting on a bench about 1 meter below the Air con.

The relays are using an ewelink integration on their site so nothing to do with the Broadlink.

I went this way because it was supported in HA. There were a few other TUYA ones the same but I was worried with the integration.

now I have the Shelly measuring power, I might revisit the broadlink integration as I will be able to tell if its on or off!

1 Like

Hi, great post. I use below and do it all in software.

On/off, temp, fan speed, etc.

2 Likes

Thanks,
It seems the Broadlink wants to work for me now so 4 hours after sunrise, I check the aircon power consumption and if its turned off, I turn it on

alias: DRED - 4:00 hours after sunrise turn Aircon on if off
description: Turn on 2 minutse before DREDs start if off
trigger:
  - platform: sun
    event: sunrise
    offset: "4:00"
condition:
  - condition: numeric_state
    entity_id: sensor.shelly1pm_bcff4dfcc2a3_power
    below: 10
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
action:
  - service: script.aircon_power_on
    data: {}
mode: single

and 2 minutes later to give it time to run the script, I turn it to DRED 1 (0% power)

alias: DRED - 4:02 Hours after sunrise turn on DRED1 (0%)
description: >-
  While sleeping all DRED relays are off. After we wake up, turn DRED1 on (0%
  cooling)
trigger:
  - platform: sun
    event: sunrise
    offset: "+4:02"
condition:
  - condition: state
    entity_id: input_boolean.dred_enable
    state: "on"
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.100132ea23_1
mode: single

When the hot water is to temp, it should override the 0% settting based on available power by the other automations.

So now at sunset, I turn the aircon off

alias: DRED - aircon turn off Sunset if running
description: If the aircon is running turn it off.
trigger:
  - platform: sun
    event: sunset
    offset: 0
condition:
  - condition: numeric_state
    entity_id: sensor.shelly1pm_bcff4dfcc2a3_power
    above: 10
action:
  - service: script.aircon_power_on
    data: {}
mode: single

So basically now its fully automatic. Just enable the DRED and it will run without further attention.

3 Likes

@rodw How well do you think this will work for heating?

I am based in Victoria, and basically manually monitor my grid-export and then manullay trigger the broadlink accordingly.

We have generally low generation, and one issue is that the RCAC goes too hard and goes over the grid-export level, thus consuming grid power.

I suppose this will help the RCAC creep along at a lower rate and give some more control, but my unit is a 8kW heat, so 2.05kW input - so at 50% the lowest demand I can guarantee is 1000W.

I have ordered the eWeLink unit you have and the Shelly and will look to give it a go … … Any thoughts appreciated!!
J

Jarrod, I think it would still work. Some feed back elsewhere was to not go to 0% for 2 minutes to avoid any small fluctuations. I must say I have not done much more on this. We’ve had too much sun so it only triggers close to the days end for a few minutes while we are generating 40 kW on a cloudless day…

Thanks for the inspiration and info @rodw , I have used a Sonoff 4CH Pro (flashed to Tasmota) in conjunction with my Actron Advance unit 24kW (3 phase).

Just playing around with how much performance it has when set at the two DRED modes. My main goal is to limit overnight noise for heating, and if summer ever shows up, keep it below the solar generation threshold.

2 Likes

Hello I am new to this site. I am trying to control loads during on peak times for my customers by disabling certain loads if there is too much coming from the grid (demand management) So im looking at using the shelly pro 3EM Energy meter and some of the shelly plus 1 with contactors to control loads like the water heater ect. I want to prioritize the loads to keep under a certain threshold.Thanks.