EtsHere
(Ets Here)
February 15, 2022, 8:46am
1
How to create a dynamic list of multiple items instead of adding each sensor and switch individually in yaml?
I have multiple items:
- platform: snmp
name: "energy_rack_1"
baseoid: .1.3.6.5.1
to
- platform: snmp
name: "energy_rack_10"
baseoid: .1.3.6.5.10
Thanks.
tom_l
February 15, 2022, 9:27am
2
There is no provision to do this. You will have to create each one. Copy and paste should make short work of it.
EtsHere
(Ets Here)
February 15, 2022, 9:43am
3
What about a script that creates the relevant yaml file that i can then point to in the configuration?
tom_l
February 15, 2022, 9:53am
4
Sure if you feel that writing a Python script or other external program to construct the file for you would be less effort, then go for it. Home Assistant will have to be restarted after you update the file.
If you mean a Home Assistant script, then no.