You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adds "object_id" property support to the discovery message (which is used by HA to generate entity ids)
modifies the MQTT topic to use the "object_id" instead of "name" property (details below)
"object_id" will be composed of device name and sensor name if not explicitly assigned (details below)
removes all explicit device name additions in Multi Value Sensors
adds a warning message when a new sensor/command is to be created with name containing the device name, and the HASS.Agent is connected to HA version 2023.8 and up
Adds "compat_names" launch argument which will
convert all compatible sensors and commands to use new naming scheme (details below)
republish the MQTT discovery topics
exit
Modifies HassApiManager to expose public HaVersion property
Adds CompatHelper class which should contain all compatibility related functions
Adds "Compatibility Task" interface and form to easily handle any future compatibility tasks
"object_id" logic:
Unless explicitly assigned in given sensor's or command's code, it will follow "_" scheme
Sensor/command conversion logic:
if the current sensor/command doesn't contain device name it will be skipped and has to be renamed manually
if the current sensor/command contains device name and uses pre 2023.8 naming i.e. "SOME-PC_cpuload" it will be converted to "cpuload"
if the current sensor/command contains device name and uses custom naming i.e. "someprefix_SOME-PC_cpuload" it will be skipped and has to be renamed manually
Compatibility interface running the name change task:
Warning message when trying to add a sensor/command containing the device name, and HASS.Agent is connected to HA version 2023.8 and up:
Comparison between "normal" and converted sensors/commands:
Before:
After:
Since the entity IDs stay the same (conversion task has a check for this) the entity history is preserved for HA:
(examples are taken after conversion task was run on 11.08.2023)
(please note that the "cpuload" sensor values are garbage due to performance counter bug - #16)
Got it, started migrating already an hour ago, still on the first client. I now have plenty of MQTT topics: many with the old naming and few already with the new naming (formerly: Devicename_sensorname, now: DeviceUniqueID_sensorname). A bit of a mess in MQTT and therefore doubled entities (with _2 suffix) in Home Assistant... so it's a lot of work to clean everything and I still don't know if there's a more efficient way to do so (how to get rid of the old/original integrations' MQTT topics?).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
"object_id" logic:
Unless explicitly assigned in given sensor's or command's code, it will follow "_" scheme
Sensor/command conversion logic:
Compatibility interface running the name change task:

Warning message when trying to add a sensor/command containing the device name, and HASS.Agent is connected to HA version 2023.8 and up:

Comparison between "normal" and converted sensors/commands:
Before:


After:


Since the entity IDs stay the same (conversion task has a check for this) the entity history is preserved for HA:


(examples are taken after conversion task was run on 11.08.2023)
(please note that the "cpuload" sensor values are garbage due to performance counter bug - #16)