Solar output and AC

hi all,

just wondering if anyone has tried to tie the output of your solar panel with AC?

currently i’m trying to automate the AC to turn on if there’s excess output.

is there a way for me to automate it to check whether i have manually turned it on myself?
i am using SmartIR to turn on the AC.

Also should i be using automation or script?

thanks,
Sam

This was exactly the reason why I started with HASS in the first place and did manage it to solve it using 2 automations, some sensors and a helper. My goal was to turn on the AC automatically if I have more than 1kW of power delivery to grid and then turn it off automatically when the grid power gets lower. I also did not want it to turn off automatically when I turned it on manually. Below my solution:

automations.yaml

- id: '1607169830764'
  alias: Airco An
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.solar_grid_power
    below: '-1'
  condition:
  - condition: state
    entity_id: climate.33031685500291bdc81d
    state: 'off'
  action:
  - device_id: f8b1ed21127cd75a2cbeca607cf2724d
    domain: climate
    entity_id: climate.33031685500291bdc81d
    type: set_hvac_mode
    hvac_mode: heat
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.airco_an_auto
  mode: single

- id: '1607169874990'
  alias: Airco aus
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.solar_grid_power
    above: '-1'
  condition:
  - condition: state
    entity_id: climate.33031685500291bdc81d
    state: heat
  - condition: state
    entity_id: input_boolean.airco_an_auto
    state: 'on'
  action:
  - device_id: f8b1ed21127cd75a2cbeca607cf2724d
    domain: climate
    entity_id: climate.33031685500291bdc81d
    type: set_hvac_mode
    hvac_mode: 'off'
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.airco_an_auto
  mode: single

So the “input_boolean.airco_an_auto” is my helper detecting if it was turned on manually or not.
sensor.solar_grid_power is my power delivery to grid in kW

I use following sensor definition in my sensors.yaml. I had to convert the SolarEdge Sensor to numeric value:

     solar_grid_power:
        friendly_name: "grid power"
        unit_of_measurement: 'kW'
        value_template: "{{ states('sensor.solaredge_grid_power') | float }}"

Of course I could also have used the value template definition within the automation somewhere, but this seems cleaner to me.
With this combination it all works as it should…

Good luck!

2 Likes

This is awesome Remko
this is pretty much what i wanted, let’s see if this works :smiley:

edit: i just put it in, when i do an execute and it works, we will see whether the auto off would work later today…

This is a very similar setup to what I want to be able to do, turning on a pump when solar is high, also I am in an off-grid house so I have a generator backup.

little extra help for me, please.

I don’t have a Home Assistant set up yet, so a steep learning curve coming.

What physical sensors do I need to buy to allow the HA to measure solar power?
Also would love to include an option to leave the pump on if the generator is supplying power, what physical sensor would be recommended for this?

Shelly EM
integrated via MQTT (this is the documentation)

Since I don’t know what kind of pump is it, how is connected, if you have access to the electrical connection or if you are willing to integrate a relay on the electrical connection here are a few options:

Depending on your setup/proximity/wiring you can use the same device (Shelly EM) since it has an integrated relay (up tp 2Amps) … but that depends on how you control the pump.

If you need a dry contact relay / separate device to control the pump you can use Shelly 1

If you need a 110-230V, 16A relay with power monitoring you can use Shelly 1PM

If you don’t want to mess with the electrical connection and operating the pump is as easy as plugging it in you can use Shelly smart plugs, depending on there you live, here are 2 options: EU or US

Going with any Shelly device, integrated in Home Assistant via MQTT, setup is the same and no soldering is required to make them work locally. Those devices are more expensive than Tuya but more reliable and a lot easier/faster to integrate.

1 Like

Once again, thank you for a brilliant summary.

I’m in Australia and the local guys I have seen were not listing the Shelly EM.

I have some vague idea I could wire up the Shelly 1PM to the house batteries, not to actually control anything, but just as a way of getting a reading of current voltage.

Ciao, ho trovato molto interessante la tua soluzione, provo a fare la stessa cosa, ho il fotovoltaico e
i condizionatori quale unica fonte di riscaldamento, vorrei automatizzarli. Sono nuova di Home Assistant e sto prendendo ora un po’ di confidenza. Ho copiato il tuo codice modificando le voci id condizionatori mettendo i miei nomi e valori, funziona l’accensione e lo spegnimento se do io il comando esegui, ma non vedo accadere nulla in riferimento al solare. Ovviamente ho modificato il nome del sensore che legge la produzione solare inserendo il mio e variando il numero riferito ai Kw, che da me è comunicato in Watt. Non so però quale id mettere al posto del tuo riferito ad Airco-an ed Airco-aus, sempre se devo cambiarli. Posso chiederti consiglio per favore? Ti ringrazio tanto in anticipo
Aggiornamento:
Sembra funzionare, stamane il condizionatore si è acceso da solo. Ho spento poi manualmente, si è riacceso una volta e poi non più…
?
Comunque grazie mille per la tua soluzione semplice e pulita…