Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send proper Manufacturer and Model strings to hassio mqtt device discovery #3174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fallenpegasus
Copy link
Contributor

Currently setting hassio mqtt device discovery model to "Mfgr-Model" from rtl_433 data and device discovery manufacturer to "rtl_433".

Instead actually set correct model and manufacturer strings.

currently setting device discovery model to "Mfgr-Model" from rtl_433 data and device discovery manufacturer to "rtl_433". Fix to actually set correct model and manufacturer strings.
@zuckschwerdt
Copy link
Collaborator

The "model" key is just a short and unique identifier, it is not a good source of information. Also being too precise here will lead to confusion as we can only decode "protocols" and those are shared by sometimes very different devices and manufactureres.

@fallenpegasus
Copy link
Contributor Author

While that is true, having hassio display "manufacturer" "Acurite" and "model" "Tower" is still better than having hassio display "manufacturer" "rtl_433" and "model" "Acurite-Tower". Its more correct and no more confusing when there is a weird decode.

@zuckschwerdt
Copy link
Collaborator

It might somewhat work for your use-case and with the example you have but not in the general case. E.g. "BurnhardBBQ", "Elantra2012" can't be split and are not plain model names, "WS2032" can't be split and isn't some manufacturer name. "FT-004B" isn't anything recognizable when split. "Lightwave-RF", "Oil-SonicStd", "Secplus-v2" are fixed terms pertaining a protocol and confusing when split.

The "model" key is a machine-readable short unique identifier for a decoder protocol and should not be used for advanced display purposes. There is generally no structured info to be extracted.

@fallenpegasus
Copy link
Contributor Author

fallenpegasus commented Feb 3, 2025

The model key is described in docs/DATA_FORMAT.md as "Device model. Human readable string concisely describing the device by manufacturer name and manufacturers model designation according to the following syntax: "Manufacturer-Model"". A non splitable name is a bug.

Lightwave-RF when presented to [examples/rtl_433_mqtt_hass.py] is "LightwaveRF-Lightwave-RF" and will split properly.

Oil-SonicStd when presented to [examples/rtl_433_mqtt_hass.py] is "Oil Ultrasonic STANDARD FSK-Oil-SonicStd" and will split properly.

I can check the others, but I strongly suspect that the answer for all the others is also "and will split properly".

If it can't be split anyway, this patch falls back to the original behavior.

The "model" key is already being "used for advanced display purposes" by rtl_433_mqtt_hass.py to create human readable device names in hassio. That ship has sailed.

This is entirely about [examples/rtl_433_mqtt_hass.py] which is a convenience script used only by hassio users. This change has no impact on any other rtl433 users, or any other rtl433code, data flows, or decoders, and makes devices look better and be more reasonable inside the hassio ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants