Can anyone help with a statistics sensor?

Hello all

I am trying to make a statistics sensor so that for my 3d printer when the bed is heating the icon chance.
So when its cold and doing nothing that u see icon A. When its heating that you see icon B and when its cooling down that u see icon C.

I have tried different codes but nothing works.
Can anyone tell me what iam dong wrong?

Here is my code for now.

- platform: statistics
   name: ender 3 pro nummer 2 bed 0
   entity_id: sensor.ender_3_pro_nummer_2_bed_0
   state_characteristic: change
   max_age:
     minutes: 60

 - platform: template
   sensors:
     ender_3_pro_nummer_2_bed_0:
       friendly_name: Bed temperatuur
       value_template: "{{ states('sensor.ender_3_pro_nummer_2_bed_0') }}"
       unit_of_measurement: '°C'
       icon_template: >-
         {%- if states('sensor.ender_3_pro_nummer_2_bed_0') | float < 0.01 %}
           mdi:arrow-down-bold
         {% else %}
           mdi:arrow-up-bold
         {% endif %}

Well for a start - the entity_id of the statistics sensor should be pointing at the sensor for your printer. You are pointing the sensor at the sensor you have just created. Which is obviously not going to do anything.

Thanks for your anwser
The entity_id is sensor.ender_3_pro_nummer_2_bed_0
So i make a mistake elswhere.
I am new to home assistant and want to learn it.
So i hope people can help me understand what i do wrong.
And what it need to be so i can learn from it.

Well that is the entity_id of the sensor you are creating, which means you will either have an error, or you will have another sensor with the same entity_id followed by _2 at the end (eg: sensor.ender_3_pro_nummer_2_bed_0_2). You should change this to something else. Your template sensor is correct - but again it is pointing to the printer’s entity_id and not the statistics sensor.

I got a error yes and that it because i put ender_3_pro_nummer_2_bed_0 where it doenst belong?
The sensor of the bed for my 3d printer is 100% ender_3_pro_nummer_2_bed_0.

sensors:
     ender_3_pro_nummer_2_bed_0:
       friendly_name: Bed temperatuur
       value_template: "{{ states('sensor.ender_3_pro_nummer_2_bed_0') }}"
       unit_of_measurement: '°C'
       icon_template: >-
         {%- if states('sensor.ender_3_pro_nummer_2_bed_0') | float < 0.01 %}

Is this the sensor i need to create? So do i need another name here?
I am sorry if im sound stupid. But i want to learn to understand what it does. And what i do wrong so in the futher i can do it right.

OK so your configuration wants to be more like this:

sensor:
  - platform: statistics
    entity_id: sensor.ender_3_pro_nummer_2_bed_0
    state_characteristic: change
    max_age:
      minutes: 60
    name: Printer Temperature Change

template:
  - sensor:
      - name: Printer Temperature
        state: "{{ states('sensor.ender_3_pro_nummer_2_bed_0')|float(0) }}"
        unit_of_measurement: '°C'
        device_class: temperature
        unique_id: e70628f7-ca1d-414a-92e7-14ef1c470c51
        icon: >-
          {% set t = states('sensor.printer_temperature_change')|float(0) %}
          {%- if t < 0.0 %}
           mdi:arrow-down-bold
          {% elif t > 0.0 %}
            mdi:arrow-up-bold
         {% else %}
           mdi:arrow-right-bold
         {% endif %}

Something like that. There is a lot of guesswork here though, because it is not entirely clear what the template sensor should be using for it’s state - only the different icons are something you have made clear. It’s not clear if the state of the template sensor should be the printer temperature or the change in the temperature - or rather it’s not clear if the state should be the actual printer temperature, or the state of the statistics sensor.