Skip to content

Instantly share code, notes, and snippets.

@MortenVinding
Created November 12, 2023 23:10
Show Gist options
  • Save MortenVinding/1e301b1b8099a30f01ef7ece9e7d0eb1 to your computer and use it in GitHub Desktop.
Save MortenVinding/1e301b1b8099a30f01ef7ece9e7d0eb1 to your computer and use it in GitHub Desktop.
ESPHome fridge shed
esphome:
name: fridge-shed
platform: ESP8266
board: esp01_1m
switch:
- platform: gpio
name: "relay"
pin: GPIO12
id: relay
dallas:
- pin: GPIO2
# Individual sensors
sensor:
- platform: dallas
address: 0x7D031602BD05FF28
id: evaporator
- platform: dallas
address: 0x5E031602BD76FF28
id: ambient
name: fridge_shed_ambient
- platform: duty_cycle
pin: GPIO12
name: Fridge power
id: power
unit_of_measurement: 'W'
device_class: power
state_class: measurement
accuracy_decimals: 0
filters:
- multiply: 0.75 # Power consumption of compressor
- platform: total_daily_energy
name: 'Total Daily Energy'
id: sensor_total_daily_energy
power_id: power
unit_of_measurement: 'kWh'
state_class: total_increasing
device_class: energy
accuracy_decimals: 3
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
time:
- platform: homeassistant
id: homeassistant_time
# Example configuration entry
climate:
- platform: bang_bang
name: "Bang Bang Climate Controller"
sensor: ambient
default_target_temperature_low: -20 °C
default_target_temperature_high: 4 °C
visual:
min_temperature: -30 °C
max_temperature: 10 °C
temperature_step: 0.5 °C
cool_action:
- switch.turn_on: relay
idle_action:
- switch.turn_off: relay
wifi:
ssid: "BSDMVN"
password: !secret WiFi_Password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Fridge-Shed Fallback Hotspot"
password: "Vx9dwPOte1Rm"
captive_portal:
# Enable logging
logger:
level: debug
# Enable Home Assistant API
api:
web_server:
port: 80
ota:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment