Who doesn’t like Free Cold Beer? (total click bait)
Running a second fridge can take around 350kwh per year. This can be around $80 per year (depending on the cost of energy in your area).
Here is a simple ESPHome configuration for a Sonoff that will only turn the device on when your house is exporting energy to the grid (750w in this example).
Note that you will need a sensor inside HomeAssistant that knows the value of what you are Exporting/Importing.
## Beer Fridge
## filename: espbeerfridge.yaml
# Sonoff POW R2
# Button toggles power on/off
# Cron'd to check Solar every 15 minutes, on if there is Solar Exporting.
substitutions:
upper_devicename: Beer Fridge
devicename: espbeerfridge
esphome:
name: espbeerfridge
platform: ESP8266
board: esp8285
arduino_version: 2.4.2
sun:
latitude: !secret gps_latitude
longitude: !secret gps_longitude
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
# Enable logging
logger:
baud_rate: 0
uart:
rx_pin: RX
baud_rate: 4800
# Enable Home Assistant API
api:
password: !secret api_pass
ota:
password: !secret ota_pass
status_led:
pin: GPIO13
sensor:
- platform: uptime
name: $upper_devicename Uptime
- platform: wifi_signal
name: $upper_devicename WiFi Signal
update_interval: 15s
- platform: cse7766
current:
name: $upper_devicename Current
voltage:
name: $upper_devicename Voltage
power:
name: $upper_devicename Power
- platform: homeassistant
name: "House Grid Power"
entity_id: sensor.iotawatt_output_live_gridusage ###this is the sensor in Home Assistant that holds the value of your Solar Export
id: gridpower
switch:
## restart
- platform: restart
name: $upper_devicename Restart
## relay / pump / compressor
- platform: gpio
pin: GPIO12
name: $upper_devicename Compressor
id: compressor
icon: mdi:glass-mug
binary_sensor:
- platform: status
name: $upper_devicename Status
## button - toggle relay
- platform: gpio
name: $upper_devicename Button
pin:
number: GPIO0
inverted: true
# Toggle pump when user presses the Sonoff Button
on_press:
- switch.toggle: compressor
## Use time
time:
- platform: homeassistant
on_time:
- seconds: 0
minutes: /15 ###Note that Compressors should run for at leas 15min
then:
- if:
condition:
lambda: 'return id(gridpower).state > -750;'
then:
- logger.log: "Low or No solar export. Less than 750w. Turn Off"
- switch.turn_off: compressor
- delay: 5s
else:
- logger.log: "Good solar export. More than 750w. Turn On"
- switch.turn_on: compressor