Tx20/Tx23 Wind Speed/Direction Sensor

The tx20 sensor platform allows you to use your Tx20/Tx23 (Amazon, lacrosse_tx23) wind direction and speed sensors with ESPHome. The only required pin is the black or brown cable (which is used to transmit data.) The red cable should be connected to VCC (3.3V), green initiates the data transfer when connected to GND and should therefore be directly connected to GND and the yellow cable should be always connected to ground. The difference from the Tx20 to the Tx23 seems to be that the green cable does not matter anymore and the wind sensor is just sending a datagram every 2 seconds - pretty much the same as when the green cable was connected to GND in the Tx20.

../../_images/tx201.jpg

Tx20 / Tx23 Wind Speed / Direction.

# Example configuration entry
sensor:
  - platform: tx20
    wind_speed:
      name: "Windspeed"
    wind_direction_degrees:
      name: "Winddirection Degrees"
    pin:
      number: GPIO04

Configuration variables:

  • wind_speed (Required): The information for the wind speed sensor.
    • name (Required, string): The name for the wind speed sensor.
    • id (Optional, ID): Set the ID of this sensor for use in lambdas.
    • All other options from Sensor.
  • wind_direction_degrees (Required): The information for the direction in degrees sensor.
    • name (Required, string): The name for the direction sensor.
    • id (Optional, ID): Set the ID of this sensor for use in lambdas.
    • All other options from Sensor.
  • pin (Required, Pin): The pin, where the black or brown cable are connected.

Note

In order to create a text sensor to show the textual representation of the wind direction the following config can be used. “tx20_id” needs to be replaced with the id of the Tx20 sensor.

text_sensor:
- platform: template
  name: "Textual Representation Wind Direction"
  lambda: |-
    return {id(tx20_id).get_wind_cardinal_direction()};
  update_interval: 2s