Open cpw opened 1 week ago
Suggestion: use something other than the MAC identity as the unique identifier in the configuration, please?
That's not a suggestion. We came up with the MAC idea because there's no unique identifier for OPNsense, and MACs are in the list of possible unique_id values recommended by HA devs. If you have a better idea please tell us. Trust me, we thought about it and discussed it.
If you don't want to edit config registry, simply delete the integration and reinstall it.
Another hint: replace MAC with old MAC. It's doable in OPNsense, on the interface, IIRC.
Regarding editing API/Secret pair, I agree, it should be configurable in config_flow also after the installation. (cc @Snuffy2)
Yes, it will break if you move to new hardware or replace/add hardware to your router. In addition to the challenges in getting a unique ID, hardware changes will likely change names of interfaces/gateways/rules, etc. Thus, it is advised to uninstall and reinstall the integration.
What happened?
I've just upgrade my opnsense instance to newer hardware (10gig time!). The MAC address has obviously changed. It appears this integration has completely broken. Dozens of sensors have been recreated, because you seem to be tying the configuration to (one of the) mac address of the opnsense instance.
It looks like I have to deep edit the core.entity_registry to update literally hundreds of unique_ids that encode the legacy MAC address as part of the entity unique ID.
Fixing the dozens of existing integrations and dashboard scripts I have around opnsense and this integration seems just as daunting as hard editing the core HA files.
Suggestion: use something other than the MAC identity as the unique identifier in the configuration, please?
Also, make it possible to update API keys - hard editing the config file to change an API key is NOT a friendly user experience.
hass-opnsense Version
1.0
OPNsense Firmware
24.7.8
Home Assistant Version
2024.10.3
Relevant logs
No response
Additional Details
I did a hardware upgrade, and rebuilt my OPNsense instance from scratch to "trim the fat" as it were - because my config was over 6 years old at this point. Fundamentally, the configuration is basically identical, but obviously a lot of internal OPNsense identities have changed. Do note that this is often the recommended upgrade path for OPNsense consumers - dump the config xml and reimport into a "clean instance".
I am also unsure how this will affect CARP related operations.