Skip to content
Snippets Groups Projects
esphome_display02.yaml 4.09 KiB
{% set devicename = "esphome_display02"  %}

{% include "/includes/ansible.inc.yaml" %}
{% include "/includes/board.esp32-doit-devkit-v1.inc.yaml" %}

  comment: Display Kuehlschrank
  platformio_options:
    lib_deps:
      - Wire                            # Also required by GFX.
      - SPI                             # Also required by GFX.
      - adafruit/Adafruit BusIO         # Required by GFX Library.
      - adafruit/Adafruit GFX Library   # Required for FrekvensPanel.
      - me-no-dev/ESPAsyncTCP

external_components:
  - source: github://phiten/esphome-ikea-led-matrix@master
    components: [ obegraensad_panel ]
    refresh: 0s
{% include "/includes/common.inc.yaml" %}

  on_message:
    - topic: ESPHome/{{ devicename }}/state/command
      payload: "ON"
      then:
        - light.turn_on: matrix_light
    - topic: ESPHome/{{ devicename }}/state/command
      payload: "OFF"
      then:
        - light.turn_off: matrix_light
    - topic: warpzone/door/status
      payload: "CLOSED"
      then:
        - light.turn_off: matrix_light

light:
  - platform: monochromatic
    name: 'Brightness'
    id: matrix_light
    output: matrix_brightness
    restore_mode: ALWAYS_ON

output:
  - platform: ledc
    # Enables brightness control.
    id: matrix_brightness
    pin:
      number: GPIO25
      inverted: True

globals:
  - id: coords
    type: int
    restore_value: no
    initial_value: '0'
  - id: length
    type: int
    restore_value: no
    initial_value: '0'

binary_sensor:
- platform: gpio
  pin: 
    number: GPIO26
    inverted: true
    mode:
      input: true
      pullup: true
  id: button
  name: button