Features Wishlist

Use GPIO on the Board

marcolino7Suggested this wish ·

What would you like to add

In my CYD I have connected 2 physical button to GPIO to turn on and off the light in the hallway and control the light outside the door. On another display I have a 18b20 connected to GPIO and I woulk like to mantain temperature reading. Is this possible to handle these GPIO with Tessera?

Thanks

How this relates to Home Assistant

Handle physiscal button connected and temperature sensor to GPIO

Pictures, mockups, or examples

No response

Before submitting

  • I searched the existing issues and this has not already been requested

Originally shared on GitHubOriginal authors and dates are preserved.

View original

Discussion 2

Add a comment
MaxGramser

Hi Marco, thanks for asking! Yes, both work today, with no new firmware needed. Every screen has its own Override YAML, a small file that loads after the shared package and stays in place through every update. Anything you add there is built into that screen's firmware and shows up in Home Assistant as an entity of the screen.

How to add it

  1. Open the screen in Tessera, press ··· and choose Override YAML (advanced).
  2. Paste the snippet below and change the entity ids to your two lights.
  3. Press Save & check. ESPHome checks the whole profile before anything is built.
  4. Press Update firmware. It builds and installs over Wi-Fi.

The two buttons on your CYD

On the CYD, GPIO22 and GPIO27 are free on the CN1 connector (GND, GPIO22, GPIO27, 3.3V). Wire each button between its pin and GND. The pin's internal pull-up does the rest, so no resistor is needed.

binary_sensor:
  - platform: gpio
    id: hallway_button
    name: "Hallway button"
    pin:
      number: GPIO22
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on_off: 30ms
    on_press:
      - homeassistant.action:
          action: light.toggle
          data:
            entity_id: light.hallway
  - platform: gpio
    id: porch_button
    name: "Porch button"
    pin:
      number: GPIO27
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on_off: 30ms
    on_press:
      - homeassistant.action:
          action: light.toggle
          data:
            entity_id: light.porch

Each press toggles its light. The 30 ms filter keeps one press from toggling the light twice when the contacts bounce. If you use rocker switches that stay where you flip them, write on_state: instead of on_press:. If you'd rather switch the lights from a Home Assistant automation, leave out the on_press part and use the two button entities as triggers.

The DS18B20 on your other screen

Which board is that one? The free pins depend on it. The sensor goes on a free pin, with its other wires on 3.3V and GND, and a 4.7 kΩ resistor between data and 3.3V (some DS18B20 modules have it on board already). With the pin filled in:

one_wire:
  - platform: gpio
    pin: GPIO27

sensor:
  - platform: dallas_temp
    name: "Temperature"
    update_interval: 60s

GPIO27 is the CYD's pin here. Tell me the board and I'll give you the right one. It becomes a temperature entity of that screen, so you can also put it on a tile. Keep the sensor a little away from the screen itself: the board and the backlight get warm, and a sensor inside the case reads a few degrees too high.

I checked that both snippets build on the current CYD firmware. I don't have buttons or a DS18B20 on my bench screens, so I couldn't try them on real hardware. I'd love to hear how it works for you! I also wrote it up in the manual, with wiring drawings and a few more recipes (a rocker switch, a motion sensor, a relay): Buttons, sensors and other hardware.


Got a screen running? Tell others which board you have and what works on the Tessera website. It helps everyone pick a screen that works.

Want me to keep building? Consider supporting monthly or buying me a coffee, much appreciated!

Original on GitHub

marcolino7

I use a CYD as board.

Thanks

Original on GitHub

Add your thoughts, a screenshot or a useful link.

Markdown & basic HTML
Paste or drop images · URLs on their own line become previews0 / 10,000
Sign in with GitHub to commentYour draft stays in this browser tab.