LocalDeck (24-button keypad) Blueprint

Hey all, I finally got my hands on a LocalBytes LocalDeck, an ESPHome-powered Steam Deck.

LocalBytes recommends using their Configurator tool to hard-code Home Assistant service/action calls into the compiled code running on the deck. However, I didn’t want to have to go through the trouble of recompiling and reflashing the device each time I wanted to check a button mapping. So instead, I wrote an automation blueprint that allows you to configure the “on-press” and “on-release” action for each individual button via the typical Home Assistant automation process.

Blueprint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Source code redacted due to length. View at: https://github.com/nwithan8/configs/blob/1302a3ff49efe1ecd75083e6045d653d46aceb4a/home_assistant/blueprints/automations/localbytes_localdeck.yaml

Setup

Select each button entity corresponding to each physical button on the LocalDeck, and then the action to perform when each button is pressed and released (or leave it blank for no action).

Unfortunately, there was no easy way to derive each button entity’s ID from the parent device, so sorry, you’ll have to add each button in manually. A quick shortcut would be adding the following in the YAML editor (adjust your prefix accordingly):

  input:
    button_1: binary_sensor.localdeck_button_01
    button_2: binary_sensor.localdeck_button_02
    button_3: binary_sensor.localdeck_button_03
    button_4: binary_sensor.localdeck_button_04
    button_5: binary_sensor.localdeck_button_05
    button_6: binary_sensor.localdeck_button_06
    button_7: binary_sensor.localdeck_button_07
    button_8: binary_sensor.localdeck_button_08
    button_9: binary_sensor.localdeck_button_09
    button_10: binary_sensor.localdeck_button_10
    button_11: binary_sensor.localdeck_button_11
    button_12: binary_sensor.localdeck_button_12
    button_13: binary_sensor.localdeck_button_13
    button_14: binary_sensor.localdeck_button_14
    button_15: binary_sensor.localdeck_button_15
    button_16: binary_sensor.localdeck_button_16
    button_17: binary_sensor.localdeck_button_17
    button_18: binary_sensor.localdeck_button_18
    button_19: binary_sensor.localdeck_button_19
    button_20: binary_sensor.localdeck_button_20
    button_21: binary_sensor.localdeck_button_21
    button_22: binary_sensor.localdeck_button_22
    button_23: binary_sensor.localdeck_button_23
    button_24: binary_sensor.localdeck_button_24

On the plus side, this allows you to reconfigure the order of the buttons. Out of the box, the LocalDeck buttons are ordered left-to-right, bottom-to-top, meaning Button 1 is in the lower left corner and Button 24 is in the top right. Here, you can remap them so that, for example, Button 1 is binary_sensor.localdeck_button_19 (top left) and Button 24 is binary_sensor.localdeck_button_6 (lower right)

Usage

  • Press any button to trigger the “On Press” action for that button
  • Release any button to trigger the “On Release” action for that button

NOTE: This blueprint relies on detecting the state of each button going from “on” to “off” and vice versa. Sometimes if you press a button too quickly, only the “on-release” trigger is recognized, so keep that in mind.

Notes

  • This automation works independently of any service/actions configured into the ESP firmware running on the device. If you are using the Configurator tool to flash your LocalDeck, make sure not to double-down on service calls.
  • This automation does not directly control the backlight behind each key. That said, you can disable the backlight via the ESP configuration and use the automation “On Press” action to change the backlight of the corresponding key.

Credit

  • @AAllport for creating the LocalBytes LocalDeck and documenting the setup process on their YouTube channel

Hopes this helps!

1 Like

Seeing what people get up to with their decks is always great.
Thanks for sharing!

Please also consider cross-posting this onto the LocalBytes forum

1 Like