Change the MQTT base topic for states, replacing "system_sensors" #768
Replies: 2 comments 3 replies
-
Hey, Makes sense 🤔 it will however be a breaking change which I'd rather avoid if you have an idea on how. Ideally only new installs should default to the new root topic, so existing automations don't break. |
Beta Was this translation helpful? Give feedback.
-
Hmm, the change would only break automations that directly call MQTT functions on the broker relating to the old topic. I would not think of anyone calling MQTT functions directly, at least not in HA. There would be very little benefit or reason. Outside of HA this would be different, keeping in mind that MQTT publish is not just for HA and others might be using it for functionality outside of HA. It would be easy to allow for both old and new format in the script if we had an option to determine if its' an existing or a new install? |
Beta Was this translation helpful? Give feedback.
-
At the moment, we use a state topic as follows (from the json config section):
system-sensors/{sensor|binary_sensor|device_tracker}/{DEVICE_ID}/state
Ideally, this should rather be
{NETALERTX SELECTABLE BASE TOPIC}/{sensor|binary_sensor|device_tracker}/{DEVICE_ID}/state
NETALERTX SELECTABLE BASE TOPIC would be
NetAlertX
by default, which would make itNetAlertX/{sensor|binary_sensor|device_tracker}/{DEVICE_ID}/state
Basically, we'd replace the fixed
system_sensors
with a more meaningful value.Reason being is that you'd see directly where the sensor belongs to.
For example, zigbee2mqtt uses
zigbee2mqtt/{DEVICE_ID}/{various states]
and openbeken uses
openbeken/{DEVICE_ID}/{various states]
Happy to develop, test and issue PR if that sounds like an acceptable solution.
Beta Was this translation helpful? Give feedback.
All reactions