Trying to install a serial sensor and getting a yaml parsing error, can't find the problem

I am trying to use a Digispark on my Pi usb port to feed in temperature data, I am running the latest Hassio version.

I used this guide:
[Simple analog sensor. It looked to easy and I had a couple of the boards sitting around.

Error"
ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.serial]: required key not provided @ data[‘serial_port’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.serial/

Relevent configuration.yaml

  - platform: serial
    port: /dev/ttyACM0

  - platform: template
    sensors:
      lr_temp:
        friendly_name: LRtemp
        unit_of_measurement: "°F"
        value_template: "{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}"

I have spent far more time playing with spaces, -'s and other formatting to try and make this work…

I have since tried a very basic configuration.yaml entry:

  - platform: serial
    port: /dev/ttyACM0
    unit_of_measurement: "°F"
    value_template: "{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}"

and get the following error:
ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.serial]: required key not provided @ data[‘serial_port’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.serial/

What the hell am I doing wrong?

Thanks Matt

Looks like the documentation on this component is wrong.
The error is trying to tell you that the component is expecting a value called serial_port (not port)
So I changed your code to the following and it does pass the config check.
I can’t tell you if it works though.

  - platform: serial
    serial_port: /dev/ttyACM0
    unit_of_measurement: "°F"
    value_template: "{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}"

Thanks! That did stop the error. But I am not getting any data inbound. I have tested the device on a PC and every few seconds it spits out the current temperature. The Pi is seeing the device as follows:

{
  "serial": [
    "/dev/ttyACM0"
  ],
  "input": [],
  "disk": [],
  "gpio": [
    "gpiochip0"
  ],
  "audio": {
    "0": {
      "name": "bcm2835 - bcm2835 ALSA",
      "type": "ALSA",
      "devices": {
        "0": "digital audio playback",
        "1": "digital audio playback"
      }
    }
  }
}

And the sensor is show up in the sensor list, but value unknown.

I trimmed the sensor entry to a minimum to just allow it to see raw data and not try to do any formatting.

  - platform: serial
    serial_port: /dev/ttyACM0
#    unit_of_measurement: "°F"
#    value_template: "{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}"

Any ideas?

Thanks again!

try to set the value_template to the raw value.

value_template: "{{ states('sensor.serial_sensor') }}"