First off please don’t post screenshots of code. use copy/paste of the yaml directly and make you properly format it using ``` on the line before and after the code block.
If we need to correct the code then that means we need to type the whole thing out from scratch instead of just copy/pasting/editing what you already have.
second, at a minimum you need to remove the second “- sensor:” line from the code. you only can have one of those sections.
last, how did you include the “template:” section in your config?
Did you use an !include to split the config or is it directly in your configuration.yaml?
Part of my problem arose from two, interacting issues:
The persistence of zombie entities (e.g. sensor.server_power, sensor.server_power_1, sensor.server_power_2, etc.) despite deleting all relevant integrations, removing all relevant configuration code, and restarting Home Asssistant.
The failure the ‘localtuya’ integration to pick up Antela ‘SPL-W-TY-PM-UK’ smart plug power, current, and voltage data after a restart of Home Assistant.
These created (i) entities that never updated (ii) other entities that sometimes updated. I was incorrectly ascribing these to failure of my configuration file specification.
This was solved by:
(i) writing down on a piece of paper the entity name corresponding to the actual feed, and keeping it next to my computer for reference (I kid you not)
(ii) setting a scan interval in localtuya for the device