I do find it strange, that the missing dash before the sensor is only causing issues for the count template sensors. For other template sensors, itβs not a problem and they all load.
But glad it works.
Edit: updated all sensors, to hopefully prevent future issues.
If you add the unique_id: field you can edit some details in UI of a yaml created template sensor. I do not believe the UI helpers will cover advanced template sensors.
You can just comment out the legacy template sensors in the packages, one at a time, as you replace them with the new format. You can update this in each individual package just like they are today. I just did this for one of the packages I have in my setup.
FWIWβ¦
I had 25 repairs. They came from things in configuration.yaml and lights.yaml. I gave both of these files to chatgpt (version 5.1). I asked if it could fix the template definitions and it said it could. I then gave it an example from one of the repair warnings just to be sure this matched what it thought the format had to be. It put all of the template definitions into a templates.yaml file, and gave me updated versions of configuration and lights. I made copies of the current files, installed the new ones, checked config, then restarted HA. Everything works great and I have no more warnings.
A few notes:
-I am not suggesting anyone use chatgpt. I just thought it was worth trying it and was pleasantly surprised it worked. I am pretty good at prompting chatgpt as Iβve been using it quite a lot for almost a year.
-Iβm not an expert on templates but I do know my way around HA pretty well so I was able to sanity check what chatgpt did.
-So long as I didnβt prevent HA from starting with completely broken files (which I think may not even happen anymore), I think what would have been totally reversible. I also did a backup before messing with the files.
I ran into the exact same thing, and Petro identified the issue for me in a previous message. Technically a bug, but remove entity_id portion and it will work.
I removed the - entity_id: section and I donβt get an error.
But, it is still reporting that the template needs fixing and gives the same fix as mentioned above.
Could somebody please help me with this code, itβs driving me mental trying to work out what Ivβe done wrong. I read tons, have another thread as well but was pointed in this direction to read, which I did and followed Tomβs post but I still get errors.
template:
trigger:
- trigger: event
event_type: bubble_card_update_modules
sensor:
- name: "Bubble Card Modules"
state: "saved"
icon: "mdi:puzzle"
attributes:
modules: "{{ trigger.event.data.modules }}"
last_updated: "{{ trigger.event.data.last_updated }}"
cover:
cover.cinema_front_window: # unique ID
friendly_name: "Cinema Front Window" # your name
optimistic: true # default when no state is available
open_cover:
- action: cover.open_cover
target:
entity_id: cover.cinema_front_window # change to your device id
close_cover:
- action: cover.close_cover
target:
entity_id: cover.cinema_front_window # change to your device id
stop_cover:
- action: cover.stop_cover
target:
entity_id: cover.cinema_front_window # change to your device id
# cover:
cover.cinema_side_window: # unique ID
friendly_name: "Cinema Side Window" # your name
optimistic: true # default when no state is available
open_cover:
- action: cover.open_cover
target:
entity_id: cover.cinema_side_window # change to your device id
close_cover:
- action: cover.close_cover
target:
entity_id: cover.cinema_side_window # change to your device id
stop_cover:
- action: cover.stop_cover
target:
entity_id: cover.cinema_side_window # change to your device id