#Platform error 'climate' from integration 'template' Config Warning

1 messages · Page 1 of 1 (latest)

north lynx
#

I am using the config below, but see the following error when I check config prior to rebooting. I only dabble around the edges of HA so I have absolutely no clue what it means:

** Platform error 'climate' from integration 'template' - Platform template.climate not found **

I have a nagging feeling something like this was indicated in an update's breaking changes but so far have failed to find anything helpful by searching for the error message.

If anyone can help explain what's going on I'd really appreciate it!

https://pastebin.com/kQFiAqjm

climate:
  - platform: generic_thermostat
    name: HA Thermostat
    unique_id: JFYEM....
    heater: switch.boiler_relay #Boiler Switch
    target_sensor: sensor.lounge_temperature

    min_temp: 12
    max_temp: 30
    target_temp: 18
    away_temp: 13
    precision: 0.5
    
    ac_mode: false
    
    cold_tolerance: 0.3
    hot_tolerance: 0.2
    
    min_cycle_duration:
      seconds: 180

    initial_hvac_mode: "heat"


#define temperature sensors                
  - platform: template  
    sensors:
      ha_current_temperature:
        value_template: "{{ states.sensor.lounge_temperature }}" #read downstairs temp as a sensor
        friendly_name: Current Lounge Temperature
      # upstairs_temp:
      ha_office_temperature:
        value_template: "{{ states.sensor.roaming_temperature }}" 

        friendly_name: Current Office Temperature
      # hvac_temperature_knob:
      ha_thermostat_temperature:
        value_template: "{{ states.climate.ha_thermostat.attributes.temperature }}" 
        friendly_name: Current Thermostat Temperature
latent sorrel
#

There is no template climate in HA? Has that been made by ChatGPT?

north lynx
#

Nope it's a 3-4 year old config - I just got around to updating and I'm cleaning up errors :/

#

Can confidently say that this setup pre-dates LLMs 😄

#

Ahh, have I perhaps put this in the wrong channel,,,

latent sorrel
#

I guess, those might have been old template sensors.

north lynx
#

Perhaps it should have been in integrations >?

#

I believe that's the thing I'm attempting.

#

So is it the sensor definitions that are causing the errors ?

latent sorrel
#

The sensor: before the -platform: template might be missing. It thinks, that is part of the climate integration.

north lynx
#

Ahhh!

#

You know... I'm not even certain that thing is required at all.

#

I'm looking for anywhere I might have used it , and I think it might have been a "Fiddling with this and giving up" moment 4 years ago coming back to haunt me.

latent sorrel
north lynx
#

I've commented them out, and will check on reboot. Thanks for rubber ducking, I think that might have been it. Years ago (before automations supported for: ) I was working on a 1hr boost switch for my heating and gave up - I think these things might be leftovers.

granite widget
#

all your templates are wrong too

#

well, accept the attribute temperature one

latent sorrel
#

To explain my GPT suspicion: it sometimes creates configs, that look plausible at first but contain nonsense. Unfortunately so well packed, that people still believe it.

granite widget
#

Also, in-line comments will mess up your template

#

Put all comments before or after the yaml field

#

as for your templates being wrong, use the states method, or the states object method. Right now you're using the states object method but you're outputting the whole object, not the state from it.

#

and jorg is correct, you're missing sensor: before your template entities

north lynx
#

I do believe those were fossils, I can't see anywhere in the system where they were even attempted to be used. I think I was trying to aggregate temperature values somehow (again, 4 years or so ago, so I don't remember)

#

I didn't realise inline comments were bad, either :/

granite widget
#

well, that section of code you posted would have never worked or validated

#

HA wouldn't even let you read that section

#

so, I'm not sure how you've been using it at all

north lynx
#

Exactly

granite widget
#

Do you use packages?

north lynx
#

What should that sensor definition look like ?

#

yeah this is in a heating package file.

#

to keep it separate

granite widget
#

ok, so that whole package has been skipped then

#

meaning none of that in the file was even created

north lynx
#

Nah because the thermostat is present and working,, though maybe only in the "last good" state before that extra guff got added?

granite widget
#

I could see it only taking the generic thermostat portion and ignoring the template but producing an error. So that is possible.

#

because your spacing is correct

#

you should have an error in your logs saying something like platform template is not a valid climate blah blah blah

north lynx
#

That's exatly it (Topic)

#

What should such a sensor definition look like though?

granite widget
#

literally just put sensor: before your template entities

north lynx
#

Just under a sensor: section

#

Ok, that's cool, I thought you were implying the definitions themselves were kaput

granite widget
#

they are, you'll see when they are created

#

the main state will be wrong for 2 of the 3 of them

north lynx
#

Aye, I just don' tknow why.

granite widget
#

Because you're outputting the state object, not the state

#

and because you're using in-line comments

north lynx
#

I've adjusted all the comments as per your earlier commnt.

#

But I don't know what "outputting the state object not the state" means in HA syntax.

#

That is, I know what outputting an object vs property is, I just don't know the HA syntax

granite widget
#

read each bullet

north lynx
#

Thankyou!

This feels awfully relevant... : Avoid using states.sensor.temperature.state, instead use states('sensor.temperature')

#

🙂

#

"The following example results in the number 20.001:

{{ states.sensor.temperature.state }}"

#

They're using in the example the exact thing they say not to do, no wonder I'm confused :/

#

Got it!

#
#define temperature sensors                
sensor:
  - platform: template  
    sensors:
      ha_current_temperature:
        #read downstairs temp as a sensor
        value_template: "{{ states('sensor.lounge_temperature') }}"
        friendly_name: Current Lounge Temperature
      
      ha_office_temperature:
        #read upstairs temp as a sensor
        value_template: "{{ states('sensor.ble_temperature_office') }}"
        friendly_name: Current Office Temperature

      ha_thermostat_temperature:
        #read thermostat temp as a sensor
        value_template: "{{ state_attr('climate.ha_thermostat','temperature') }}"
        friendly_name: Current Thermostat Temperature