Required key not provided @ data['set_value']. Got None

Am trying to create a number template helper and struggling to understand what might be causing the error in the screenshot (and in the log message following). I also have an issue that I seem unable to delete the helper that isn’t working, and can’t find any references to it in the YAML in the config folder either…

Any ideas? The error isn’t particularly helpful.

2024-10-18 21:57:37.934 ERROR (MainThread) [homeassistant.components.number] Error while setting up template platform for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/template/number.py", line 129, in async_setup_entry
    validated_config = NUMBER_CONFIG_SCHEMA(_options)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 549, in validate_dict
    return base_validate(path, data.items(), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 382, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['set_value']
1 Like

You need to assign an action, then the error will go away. The action is what you want to happen when a number is chosen.

And if my question doesn’t make sense, it might be that you just want to template a sensor. A sensor is an entity that simply reports a value (or any state).

A number is a special entity that allows you to input a number into HA, for example if you wanted to create a volume slider and wanted to choose a number from 0->10 and when that number is selected you’d have an action to run some script that might change the volume on your receiver.

So, are you certain you wanted a template number and not a template sensor?

Aha, thank you.

I think I probably do want a template sensor then as this helper is for use in automations rather than to be interacted with.

If I add an action then the error goes away, but HA still doesn’t assign an ID to the helper, and doesn’t let me delete it.

Do these helpers get put into a config file somewhere that I can manually remove?

Anyone who finds this in the future: restarting the system sorted out the issue with being unable to delete

I did restart and nothing, there is no delete option, working template sensor helpers do have option to delete after clicking on cog wheel, but my broken number one is impossible to delete.

Ok I understand now the previous post, after assigning bogus action it works, kinda, not great UI.

1 Like

Often times the “unable to delete” problem is because the entity has already been deleted but it remains in the browser cache. Try clearing cache or using incognito mode to confirm if the entity is still there or not.