Kaffeemaschine Coffeemachine

I want to show you how i implemented my Coffee-Mchine into HA.
Goal was to switch an 230V Outlet (wich is easy with Shelly) but it should have an pushbutton to activate the Automatic or just turn always on.
I used 1 Pushbutton and 2 LEDs, one for “Auto-Mode” and one for “always-on-mode”.
I desoldered the input parts on SHELLY1 so the Input comes TTL levels.
I used GPIO1 wich is available on the UART Port in SHELLY1 for AUTO-LED and soldered the ON-LED to the Relays Coil. (ofcourse with series resistors)

In ESPHOME it looks like this:

esphome:
  name: kaffeemaschine
  platform: ESP8266
  board: esp01_1m
  on_boot:
    priority: 600
    # ...
    then:
      - switch.turn_off: kaffee_relays
      - switch.turn_on: kaffee_led_auto
      
# Enable Home Assistant API
api:
  password: "xxxxxx"

ota:
  password: "xxxxxx"

wifi:
  networks:
  - ssid: "xxxxxxxxxe"
    password: "xxxxxxxxxe"
  - ssid: "xxxxxxxxxe"
    password: "xxxxxxxxxe"
  manual_ip:
    static_ip: 192.168.2.250
    gateway: 192.168.2.1
    subnet: 255.255.252.0

web_server:
  port: 80

        
binary_sensor:
  - platform: gpio
    pin:
      number: 5
      inverted: true
      mode:
        input: true
        pullup: true
    id: 'kaffee_taster'
    name: "Kaffeemaschine_Taster"
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
    on_press:
      then:
        - switch.toggle: 'kaffee_relays'
        - switch.toggle: 'kaffee_led_auto'

switch:
  - platform: gpio
    pin: 4
    name: "Kaffeemaschine_Relays"
    id: 'kaffee_relays'
    inverted: false
    restore_mode:
        RESTORE_DEFAULT_OFF
  - platform: gpio
    pin: 1
    name: "Kaffeemaschine_LED_Auto"
    id: 'kaffee_led_auto'
    inverted: false
    restore_mode:
        RESTORE_DEFAULT_ON
 

the Automation in HA looks like this:

alias: Kaffeemaschine aus
description: ''
trigger:
  - platform: time
    at: '09:00'
condition:
  - condition: state
    entity_id: switch.kaffeemaschine_led_auto
    state: 'on'
action:
  - type: turn_off
    device_id: 1777159456453bf3b2ae1d8053f852b4
    entity_id: switch.kaffeemaschine_relays
    domain: switch
mode: single

and

alias: Kaffeemaschine ein
description: ''
trigger:
  - platform: time
    at: '08:00'
condition:
  - condition: state
    entity_id: switch.kaffeemaschine_led_auto
    state: 'on'
action:
  - type: turn_on
    device_id: 1777159456453bf3b2ae1d8053f852b4
    entity_id: switch.kaffeemaschine_relays
    domain: switch
mode: single

This runs very well.

To the Outlet:
i drilled 3 3mm holes above the Outlet for the two LEDs and the pushbutton,
it looks much nicer as a ugly timerbox…

Just for your Insparation, maybe someone can use this.

Wolfram