Serial Sensor and history graph

I made and arduino lighting detector that sends information down the usb port. It sends a 3 digit number starting with the middle around 512 then moves up and down. That is not the issue. I create the sensor. I can see it in the lovelace card. When I click on it. It will not give a history. It stops the system. It will not keep running. So then I tried to create it with a value_template.

- platform: serial
  baudrate: 115200
  serial_port: /dev/ttyACM0
  value_template: "{{ states('sensor.serial_sensor') | float }}"

This keeps telling me unknown on the data. I tried with out the float and still did the same thing. When lighting comes. I need to see the results on the graph to get this to do automations. But I have to see the numbers. There come in so fast that you can no see it on a bar graph. I need a line graph. But how can I get this to start displaying the numbers in a usable way to not keep the system from slowing down.

Any ideas welcome.

Thanks

Add any unit_of_measurement to your sensor to get a line graph.

That does not work. Unit of measurement is for template not for the sensor. But when I use the template after the sensor. I still can not get it to pull the value from the serial sensor.