So I was following the second part of this tutorial he uses a custom yaml file to alter the gauge and change the lbs from the scale to a percentage based on a formula. Starts about 6 min in. I added a custom template within the config.yaml file like so…
# Loads default set of integrations. Do not remove.
default_config:
customize: !include keg-management-system.yaml
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
Are you sure you are customizing an existing sensor?
The YAML code you have copied (although not correctly formatted) looks to me like you are trying to create a new template sensor based on the existing one.
I believe that’s what he does in the video. I’ve created two helpers keg_1_empty and keg_1_full. It’s supposed to use those two numbers to calculate the percentage of beer left in the keg and change the gauge.
Not sure if I’m doing it right though. His code uses a unique_id but I’m not sure if that is supposed to target that gauge component instance.
He puts all his code directly into the config.yaml file but I thought it might be safer to include the code instead. The code seems to validate fine but I don’t think it’s being implemented.
Apologies I’m a total noob with Home Assistant and coding in yaml. I’m a web developer so I know my way around a lot of coding languages but this is my first time coding in yaml.
Does it matter what order I place that include in the config file?
Thanks for all your help. I updated my config file and template file. Still looks like it’s not calculating the percentage correctly though. The % is still the same weight as lbs.