Error while setting up template platform for number
The problem
I was trying to set up a helper -> template number. That didn't work despite the right coding and format. Error required key not provided occurs. I am not able to delete it via UI as the delete button does not show like usually with other helpers.
Thanks for taking a look at this.
What version of Home Assistant Core has the issue?
2024.10.0
What was the last working version of Home Assistant Core?
Not sure, but probably 2024.9
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.components.number
Quelle: helpers/entity_platform.py:361
Integration: Nummer (Dokumentation, Probleme)
Erstmals aufgetreten: 01:55:03 (1 Vorkommnisse)
Zuletzt protokolliert: 01:55:03
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']
Additional information
No response
Can you share your template which caused this issue?
Hey there @phracturedblue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of template can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign templateRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
template documentation template source (message by IssueLinks)
According to the template editor, the value should be 26.
Thanks a lot for the quick response.
Can you share your template which caused this issue?
It's the action missing! What should happen when you change the value of your helper? Once you maintain that the error will vanish...
Remark: your min/max settings don't fit to the example of 26, I could imagine this will cause issues when as well.
That did the trick.
Many thanks. 🙂👍
Von: Nerdix @.> Gesendet: Samstag, 5. Oktober 2024 09:05 An: home-assistant/core @.> Cc: MonkeyTrunky @.>; Author @.> Betreff: Re: [home-assistant/core] Error while setting up template platform for number (Issue #127509)
It's the action missing! What should happen when you change the value of your helper? Once you maintain that the error will vanish...
Remark: your min/max settings don't fit to the example of 26, I could imagine this will cause issues when as well.
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/127509#issuecomment-2394958253 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AWN5FHBJIVA5ZEQ5ZWU3J4LZZ6FTJAVCNFSM6AAAAABPK2IQLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUHE2TQMRVGM . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AWN5FHGMBZBNKRQT7ARP4BTZZ6FTJA5CNFSM6AAAAABPK2IQLSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUOYAU22.gif Message ID: @.*** @.***> >
It is not possible to delete a helper without an action:
- Create a new template helper (type number)
- Fill the name and a state template and submit
- Click "show settings"
- The strange error message
required key not provided @ data['set_value']. Got Noneis still shown - and it is impossible to delete that helper without providing an action
- Improve the error message
required key not provided @ data['set_value']. Got None - Allow to delete a number helper without an action
It is not possible to delete a helper without an action:
Create a new template helper (type number)
Fill the name and a state template and submit
![]()
![]()
Click "show settings"
The strange error message
required key not provided @ data['set_value']. Got Noneis still shown - and it is impossible to delete that helper without providing an action
Improve the error message
required key not provided @ data['set_value']. Got NoneAllow to delete a number helper without an action
It is possible, also without an action. Make sure the state template is correct, save and refresh the UI. You can then delete the entity as usual:
Issue is still reproducible (fresh 2024.11.3 installation):
https://github.com/user-attachments/assets/446c751c-0806-41a7-9ff9-f4385e1c27a3
@MonkeyTrunky Please reopen this issue
This line should use vol.Required instead of vol.Optional:
https://github.com/home-assistant/core/blob/3af751c129dc99ff02e293fe0bb6f027dd6385cc/homeassistant/components/template/config_flow.py#L160