I have a Solar PV system. Every unit I export to the grid I am paid a pittance and every unit I import from the grid is pretty expensive. What I would like to do is set home assistant to lower the temp on my 2 AC units down to the lowest whilst only using the power I generate as much as possible.
The AC and the solar system are both already integrated into HA so its just the automations I need to figure out.
Has anyone done this already? If not can someone give me some guidance as to how best to do this?
I have installed nodered but not used it as yet.
At the moment with my knowledge of YAML I think I could do it fairly easy with one AC unit but it gets a lot more complicated with 2.
Im thinking of making an automation that turns on the first unit then turn on a automation to turn on the second one when the power is exporting enough again but its going to be difficult to slowly get it down to 18 on both then back up as the power generation slows down.
have you considered Node Red for the logic , i found YAML automation too restrictive.
You may want to do some testing first to work out how much each AC unit uses and build that into your logic
ie
unit 1 ac on setting 1 used 2 kw , if more than 2 kw going to the grid , turn on unit 1
Nah I never found anything. At the moment I just turn them on manually and have a rule to send me a message when power is using from grid then after 5 mins turn them off.
Please let me know if you find anything! I would love to get this working but I don’t think I have the smarts for it.
Using PV directly is OK, but you need to do some smoothing, and you end up sacrificing some comfort for economy. I want the A/C to work when my lounge room is >26degC because I don’t want my pampered dogs to roast, and I want my house to be live-able when I get home from work. Unfortunately because PV power can be a little choppy, you need to apply a bit of smoothing/averaging and even then on hot but over-cast days you can end up with your A/C not running when you need to cool the house. Conversely, on sunny but cool days I don’t want my A/C to kick in when there’s no need - feed in tarriffs are pitiful, but I’ll take them over intentionally wasting the energy cooling a cold house. If the averaging window is too short you end up turning it on and off all the time.
In the end I just decided that sun elevation > 45deg, plus 2 temperature levels was the way to do it. When the sun is >45deg elevation I’m making pretty good power (typically 2kW+). At 26degC my A/C turns on cool and low, at 27degC it turns to high. When the sun falls to 45deg elevation in the afternoon I turn everything off.
On top of this, to bank a bit of cold air when the day is going to be a scorcher I use YrNo forecasting to see if the forecast temp for mid-afternoon is >26, and if so I start the A/C at 45deg elevation. Typically at this time it’s too early for the temperature triggers to be in effect, but the power is effectively free so I figure I might as well get ahead of the curve.
This is all a bit mish-mash, but it works in the Aussie summer.
What I’d like to do to avoid it turning on and off is lower / raise the temp depending on the PV use over 10 mins. So if it was importing for 10mins raise the temp until its exporting again. I really don’t care for the feed in tariffs and want to use as much as possible.
Here is my first pass.
If the temp sensor in the room is > 26, and its not winter
Check if current PV production > 2000
if it is, set the ac to cool
If its less than 2000, check that ive produced more than 20000wh today
if this is true, set the ac to cool
threw a HA mobile notification in for good measure.
This is what I have come up with so far. I know I could have used templates to compact this down a fair bit but I had some trouble. So far it seems to be doing the trick, I’d love to hear any suggestions.
sensor:
- platform: statistics
name: GridPower10min
entity_id: sensor.fronius_grid_usage
state_characteristic: mean
max_age:
minutes: 10
input_number:
autocool:
name: Autocool Mode
min: 0
max: 10
step: 1
automation:
- alias: Autocool up
trigger:
- platform: time_pattern
minutes: /10
condition:
- condition: numeric_state
entity_id: sensor.gridpower10min
below: -0.5
- condition: numeric_state
entity_id: input_number.autocool
above: 0
action:
service: input_number.set_value
data_template:
entity_id: input_number.autocool
value: "{{ (states.input_number.autocool.state | int ) + 1 }}"
- alias: Autocool down
trigger:
- platform: time_pattern
# Matches every hour at 5 minutes past whole
minutes: /10
condition:
- condition: numeric_state
entity_id: sensor.gridpower10min
above: 0.1
- condition: numeric_state
entity_id: input_number.autocool
above: 1
action:
service: input_number.set_value
data_template:
entity_id: input_number.autocool
value: "{{ (states.input_number.autocool.state | int ) - 1 }}"
- alias: Autocool change
trigger:
platform: state
entity_id: input_number.autocool
action:
- choose:
- conditions:
- condition: state
entity_id: input_number.autocool
state: "1.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool1
- conditions:
- condition: state
entity_id: input_number.autocool
state: "2.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool2
- conditions:
- condition: state
entity_id: input_number.autocool
state: "3.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool3
- conditions:
- condition: state
entity_id: input_number.autocool
state: "4.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool4
- conditions:
- condition: state
entity_id: input_number.autocool
state: "5.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool5
- conditions:
- condition: state
entity_id: input_number.autocool
state: "6.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool6
- conditions:
- condition: state
entity_id: input_number.autocool
state: "7.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool7
- conditions:
- condition: state
entity_id: input_number.autocool
state: "8.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool8
- conditions:
- condition: state
entity_id: input_number.autocool
state: "9.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool9
- conditions:
- condition: state
entity_id: input_number.autocool
state: "10.0"
sequence:
- service: scene.turn_on
target:
entity_id: scene.autocool10
scene:
- name: "Autocool1"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 22
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 24
- name: "Autocool2"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 20
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 24
- name: "Autocool3"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 20
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 22
- name: "Autocool4"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 22
- name: "Autocool5"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 20
- name: "Autocool6"
entities:
climate.bedroom_ac:
fan_mode: auto
state: auto
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 18
- name: "Autocool7"
entities:
climate.bedroom_ac:
fan_mode: auto
state: cool
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: auto
temperature: 18
- name: "Autocool8"
entities:
climate.bedroom_ac:
fan_mode: auto
state: cool
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: cool
temperature: 18
- name: "Autocool9"
entities:
climate.bedroom_ac:
fan_mode: high
state: cool
temperature: 18
climate.living_room_ac:
fan_mode: auto
state: cool
temperature: 18
- name: "Autocool10"
entities:
climate.bedroom_ac:
fan_mode: high
state: cool
temperature: 18
climate.living_room_ac:
fan_mode: high
state: cool
temperature: 18