But then, after reloading HA-config, the sensor gets unknown.
What is wrong?
It would be no problem for me that I have to reload the config after an topic_number-change.
Is there any other way to modify the topic number within my configuration (e.g. with env-variable) without copy&replacing the number within the config.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.