Read data over UART?

Hey there,

I have this uart config:

uart:
  - id: uart_lorawan
    baud_rate: 9600
    rx_pin: 3
    tx_pin: 2
    parity: NONE
    stop_bits: 1

I’m able to send data through UART but I’m not sure how to read data from UART. I have this light switch that I want to turn off if the value read through UART is “00” :

switch:
  - platform: gpio
    pin: GPIO2
    name: "Light A"
    id: light_a

How could I accomplish this?

Thanks.

By far the easiest method.

2 Likes