Template - temperature sensor - error

What is wrong with this template:

  - platform: template
    sensors:
      template_433_temperature_01_outside:
        friendly_name: Temperature outside
        value_template: '{{ states.sensor.433_temperature_01_temperature.state }}'

looks good to me. The only questions would be:

what error are you getting?

Why are you doing this when you are just passing a temperature to another template? Why not rename sensor.433_temperature_01_temperature’s friendly name “Temperature outside”? Then skip all this templating.

Looks good. But I think the problem is that it starts with a number probably. Seems like it throws an error then. Try change your sensor name to sensor.temperature_433 or something that not starts with a number and check if that works.

Sensor is rfxtrx, don’t know how to add friendly name?

sensor code:

  - platform: rfxtrx
 
    devices:
      08500a20390100e269:
        name: 433_temperature_01

The name: sensor.433_temperature_01_temperature is auto generated.

error:

Error rendering template: TemplateSyntaxError: expected token 'end of print statement', got '_temperature_01_temperature'

Every entity can be customized in the customize config section:

I will try that.

For floorplan you need another entity_id, changing friendly name doesn’t fix anything.
Just change the name here:

devices:
  08500a20390100e269:
    name: 433_temperature_01

to:

devices:
  08500a20390100e269:
    name: temperature_433_01
1 Like

[quote="devices:
08500a20390100e269:
name: 433_temperature_01
to:

devices:
08500a20390100e269:
name: temperature_433_01
[/quote]

Yes. This is exact problem. Now template working. Thanks.

Good. Didn’t know this myself, but I saw the template showed error as fast as it got a number instead of a letter as entity_id.

Now I can find my template I created under developer tools - states? Why?

template:

  - platform: template
    sensors:
      temperature_433_01_outside_templated:
        friendly_name: Temperatura zunaj
        value_template: '{{ states.sensor.temperature_433_01_temperature.state }}'°C

Can you or can’t you find it? If you can everything is good. If you can’t find sensor.temperature_433_01_outside_templated it’s a problem.
That is probably because you haven’t included the document you wrote your sensor in configuration.yaml under sensors.
If you have a folder named sensor in your config folder, you include all documents inside that folder like this in configuration.yaml:

sensor: !include_dir_merge_list sensor

Yes. In configuration.yaml I added:

sensor: !include_dir_merge_list sensor

and in folder i have my template file:
/config/sensor/template.yaml

no errors, but I can find in developer tools - states:
sensor.temperature_433_01_outside_templated

Sorry my mistake I disabled the file earlyer.

template.yaml.disable :grinning: