Issues with XPT2046 Touch Screen Controller (Platform Not Found)

Trying to implement this component (here: XPT2046 Touch Screen Controller (Updated version) — ESPHome )

Just pasting the example code straight from the docs into ESPHome (latest version) gives me the error “Platform not found: ‘touchscreen.xpt2046’”

touchscreen:
  platform: xpt2046
  id: my_touchscreen
  cs_pin: 17
  update_interval: 50ms
  report_interval: 1s
  threshold: 400
  calibration_x_min: 3860
  calibration_x_max: 280
  calibration_y_min: 340
  calibration_y_max: 3860
  swap_x_y: false

This looks like perhaps it should have been the following, but this gives me the same error:

touchscreen:
  - platform: xpt2046
    id: my_touchscreen
    cs_pin: 15
    update_interval: 50ms
    report_interval: 1s
    threshold: 400
    calibration_x_min: 3860
    calibration_x_max: 280
    calibration_y_min: 340
    calibration_y_max: 3860
    swap_x_y: false

Any ideas?

This platform is new, what version of esphome are you using?

Sorry, I’m on ESPHome 2022.3.1

Well that is ancient. Update :slight_smile:

If you can’t see any updates, you may be using the wrong repository. It changed a few version back when Nabu Casa took over ESPHome.

It’s safe to uninstall ESPHome then reinstall, just make sure you back up all your YAML from ESPHome first.

Not needed. Uninstalling the addon does not delete /config/esphome

thanks @zoogara @nickrout - that was the problem; using wrong repository and did not realize I was not getting the latest version after updates (should have noticed based on the v. date). uninstall/reinstall solved it (w/o losing my configs). now on to the the new error!