Hi,
tl;dr: I am looking for a way to securely use sensor names that are generated during first adaption of an ESP in HomeAssistant (HA), so I can use these names in pre-generated automation scripts on HA.
I am having “some” ESP ePaper, that display the dates for $today from specific calendars that are in HomeAssistant. Connection between ESP and Calendars are N:M, so more than one ESP can display one of M calendars.
As the ESPs are mostly sleeping, I do need nearly for every “Variable” in the ESP I want to let the HA user change a “mirror” helper, that the user can use to change the value in the HA frontend anytime, and the value is than pushed over to the ESP when it wakes up.
This all works, because I have a script, that creates the IMHO needed automations to trigger the change from the helper to the ESP “Variable” “on connect” of the specific ESP. The script generates automations for each ESP from a template file by replacing e.g. $$$ESPNAME$$$ within the template and than generating the relevant automation within a package in for each ESP. (Helpers, automations, scripts, … you name it).
There is another template which takes care, that the ESP individual firmware YAMLs are also generated. These individual YAMLs include the “common” files which I have for two sorts of hardware.
It all works. My problem: It more and more feels to me, that I am re-inventing a wheel I cannot find ![]()
What I want to achive:
a.) Have HA automations that are needed for displaying and booking slots on the ESP hardaware pre-generated so the user that wants to install a new system has everything in place. But not onyl new users on new system, also existing users on existing systems.
b.) Change Firmware on ESP (I managed to get a stable OTA with mainly sleeping EPSs, so this is not the issue), where I can give the users new features in the firmware.
My general problem ist, that I made assumptions how names are generated from new ESPs that “arise”. They seems to collide with the reality
I e.g. had to change a variable I had on the ESP, as the naming was really bad and misleading. When doing so, I had to learn, that now, the sensors are not named number.s03_max_wake_interval_during_work but number.homeoffice_s03_max_wake_interval_during_work, where s03 is my testing system within my HomeOffice.
Problem I have: I do not know how I can generate “unchangeable” ESP ids, that i can use within HA. Reason: I now have “10” or so without the “homeoffice_” in fron, and this one with the “homeOffice” in front, which might come in due to the reason, that I disconnected the ESP from HA, and re-connected it, and added “HomeOffice” as his area. Maybe before the very first inclusion of this ESP I was not using this area at all. Other problem: If I rename the area, the sensor is not renamed. So what is the technical “most sticky” name I can rely on, and go from there within my automations to use the sensors from my ESPs.
So the idea of having automated sensor ids during an adaption is not working for me (or I fundamentally got something wrong, which I still assume).
As this might happen with new installations by other users as well, I need a stable way to automate this, and reliably rely on the naming.
My quesion: What am I doing wrong? Is there a way, I can read me thru? If this really is “as is”, my simplest solution would be to tell the users NOT to use any location when a new ESP arises.
thank you for readying till here. My journey started about 2 years ago, and I am damn close before a release, but I cannot support user questions, that IMHO will arise from this with a 99.5% chance.
Any hints welcome, but please no KI generated untest help. I digged thru KI and internet the last 4 weeks, whith no luck; help from real people that I will adore afterwards welcome ![]()
all the best
Juergen