Skip to content
Snippets Groups Projects
Select Git revision
  • a65762b9aea03ae0f8b60493ee101c62975e5b0b
  • main default protected
  • growscreen
3 results

propbox-fan.yaml

Blame
  • propbox-fan.yaml 2.13 KiB
    substitutions:
      devicename: "propbox-fan"
      domain: "faked.local"
      comment: "Propagator Fan Control"
      project_name: "groovy.propbox-fan"
      project_version: "1.0"
      
      current_res: "0.00280" # Higher value gives lower watt readout
      voltage_div: "775" # Lower value gives lower voltage readout
    
    <<: !include common.yaml
    
    esp8266:
      board: esp8285
    
    time:
      - platform: sntp
        id: sntp_time
        timezone: "Europe/Berlin"
        update_interval: 1h
    
    light:
      - platform: status_led
        id: "led_status"
        pin:
          number: GPIO13
          inverted: true
    
    binary_sensor:
      # toggle relay on/off
      - platform: gpio
        id: "button_state"
        pin:
          number: GPIO00
          mode: INPUT_PULLUP
        on_press:
          - switch.toggle: "power"
    
    switch:
      - platform: template
        name: "Power"
        optimistic: true
        id: "power"
        lambda: |-
          if (id(relay).state) {
            return true;
          } else {
            return false;
          }
        turn_on_action:
          - switch.turn_on: "relay"
          - light.turn_on: "led_status"
        turn_off_action:
          - switch.turn_off: "relay"
          - light.turn_off: "led_status"
      - platform: gpio
        id: relay
        pin: GPIO14
    
    sensor:
    ### Default Sensors
    
      - platform: wifi_signal
        name: "Wifi Signal"
        update_interval: 60s
    
      - platform: uptime
        name: "Uptime"
        update_interval: 60s