Anyone successfully used Pimoroni Badger with ESPHOME?

Good news! I did some digging and after mashing up the code from above, with some more from a github issue and adding a dash of random experimentation I have the Badger 2040W working with ESPHome (screen included!). The trick is to use the ‘gdew029t5’ display type!

The display code looks like this:

spi:
  clk_pin: ${clk_pin}
  mosi_pin: ${mosi_pin}
  miso_pin: ${miso_pin}

display:
  - platform: waveshare_epaper
    cs_pin: ${cs_pin}
    dc_pin: ${dc_pin}
    busy_pin: ${busy_pin}
    reset_pin: ${reset_pin}
    model: gdew029t5
    rotation: 270
    update_interval: 5s
    lambda: |-
      it.line(0, 0, 100, 50);
      it.rectangle(5, 20, 30, 42);
      it.filled_rectangle(40, 40, 30, 42);
      it.circle(20, 40, 10);
      it.filled_circle(20, 75, 10);
      it.filled_ring(75, 75, 30, 20);
      it.filled_gauge(75, 75, 30, 20, 80);
      it.triangle(25, 5, 100, 5, 80, 25);
      it.filled_triangle(115, 5, 95, 25, 125, 70);
      it.filled_regular_polygon(170, 45, 20, EDGES_HEXAGON);
      it.regular_polygon(170, 45, 40, EDGES_OCTAGON, VARIATION_FLAT_TOP);

and the full code with everything I have working so far looks like this:

substitutions:
  clk_pin:   GPIO18
  mosi_pin:  GPIO19
  miso_pin:  GPIO16
  cs_pin:    GPIO17
  dc_pin:    GPIO20
  busy_pin:  GPIO26
  reset_pin: GPIO21
  button_a: GPIO12
  button_b: GPIO13
  button_c: GPIO14
  button_down: GPIO11
  button_up: GPIO15
  badger_led: GPIO22
  pico_led: GPIO32

esphome:
  name: badger-rp2040
  friendly_name: Badger RP2040

rp2040:
  board: rpipicow

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ufkAYb7WCVvqHYe20deUknnTb8SSFUb2mSQ1X6y4Lng="

ota:
  - platform: esphome
    password: "9ec6880a365c267827789d294a5b9209"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


text_sensor:
  - platform: homeassistant
    name: "House state From Home Assistant"
    entity_id: sensor.house_state
    id: ha_house_state
    
spi:
  clk_pin: ${clk_pin}
  mosi_pin: ${mosi_pin}
  miso_pin: ${miso_pin}

display:
  - platform: waveshare_epaper
    cs_pin: ${cs_pin}
    dc_pin: ${dc_pin}
    busy_pin: ${busy_pin}
    reset_pin: ${reset_pin}
    model: gdew029t5
    rotation: 270
    update_interval: 5s
    lambda: |-
      it.line(0, 0, 100, 50);
      it.rectangle(5, 20, 30, 42);
      it.filled_rectangle(40, 40, 30, 42);
      it.circle(20, 40, 10);
      it.filled_circle(20, 75, 10);
      it.filled_ring(75, 75, 30, 20);
      it.filled_gauge(75, 75, 30, 20, 80);
      it.triangle(25, 5, 100, 5, 80, 25);
      it.filled_triangle(115, 5, 95, 25, 125, 70);
      it.filled_regular_polygon(170, 45, 20, EDGES_HEXAGON);
      it.regular_polygon(170, 45, 40, EDGES_OCTAGON, VARIATION_FLAT_TOP);
  



binary_sensor:
  - platform: status
    name: "Status"
    id: device_status

  - platform: gpio
    pin:
      number: ${button_a}
      inverted: false
      mode:
        input: true
        pulldown: true
    name: "Button a"
    on_press:
      then:
      - output.turn_on: badger_led
    on_release:
      then:
      - output.turn_off: badger_led
  - platform: gpio
    pin:
      number: ${button_b}
      inverted: false
      mode:
        input: true
        pulldown: true
    name: "Button b"  

  - platform: gpio
    pin:
      number: ${button_c}
      inverted: false
      mode:
        input: true
        pulldown: true
    name: "Button c"  

  - platform: gpio
    pin:
      number: ${button_up}
      inverted: false
      mode:
        input: true
        pulldown: true
    name: "Button up" 

  - platform: gpio
    pin:
      number: ${button_down}
      inverted: false
      mode:
        input: true
        pulldown: true
    name: "Button down"


output:
  - platform: rp2040_pwm
    pin: ${badger_led}
    id: badger_led
  - platform: gpio
    pin: ${pico_led}
    id: pico_led

light:
  - platform: monochromatic
    name: "Badger LED"
    output: badger_led
  - platform: binary
    name: "Pico LED"
    id: picow_led
    output: pico_led

sensor:
  - platform: internal_temperature
    name: "Internal Temperature"
    update_interval: 60s
    id: processor_internal_temperature

button:
  - platform: shutdown
    name: "Shutdown"
  - platform: restart
    name: "Restart"