Andy16
(Andy16)
November 17, 2024, 6:38pm
1
hi
trying and failing on something like:
mqtt:
broker: mqttbroker
username: !secret mqtt_user
password: !secret mqtt_password
topic_prefix: 'esp/${name}'
that prefix I cannot write like that… replacement does not take place.
As I’d like to come to includes and harmonise the settings, any chance to do something like that??
thanks so much!
Edit:
found: this
seems I cannot - really ??? How to keep a swarm of esp’s in sync with code changes… ???
Sir_Goodenough
((SG) WhatAreWeFixing.Today)
November 18, 2024, 1:58am
2
Hi Andy16 ,
If you add or change a secret to the secrets.yaml, you need to restart HA in order for it to be pulled into HA.
This may be why your stuff didn’t work.
If you did that, I didn’t have a lot to go on in the question, and I guessed the most likely.
Andy16
(Andy16)
November 19, 2024, 5:20pm
3
hi - thanks for reply!
It was not for the secrets but for the topic_prefix that I cannot concat with a variable…
Sir_Goodenough
((SG) WhatAreWeFixing.Today)
November 19, 2024, 8:31pm
4
You didn’t share much of your code, but I don;'t see why not.
Andy16:
'esp/${name}'
I don’t recognize that. (Wait, is the $ the path thing?. not sure. You didn’t share enough to actually help here…)
Maybe this will inspire you, I variable the hell put of my MQTT Discovery stuff in this blueprint.
HA_Blueprints/Automations/Octoprint_Additional_Buttons_Helper.yaml at d1c15d75a7b5fa3042d60f7eee2d7633ea8a27a3 · SirGoodenough/HA_Blueprints · GitHub .