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

rtl_433_mqtt_hass: MQTT entity name starts with device name (Home Assistant 2023.8.0) #2591

Closed
noahwilliamsson opened this issue Aug 9, 2023 · 5 comments · Fixed by #2594

Comments

@noahwilliamsson
Copy link
Contributor

As of Home Assistant 2023.8.0, the examples/rtl_433_mqtt_hass.py script causes Home Assistant to log warnings such as:

WARNING (MainThread) [homeassistant.components.mqtt.mixins] 
  MQTT entity name starts with the device name in your config
  {
    'device_class': <SensorDeviceClass.HUMIDITY: 'humidity'>,
    'name': 'Bresser-3CH-1-176-H',
    'unit_of_measurement': '%',
    'value_template': Template<template=({{ value|float }}) renders=0>,
    'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
    'state_topic': 'rtl_433/devices/Bresser-3CH/1/176/humidity',
    'unique_id': 'Bresser-3CH-1-176-H',
    'device': {
      'identifiers': ['Bresser-3CH-1-176'],
      'name': 'Bresser-3CH-1-176',
      'model': 'Bresser-3CH',
      'manufacturer': 'rtl_433',
      'connections': []
    },
    'force_update': False,
    'qos': 0,
    'enabled_by_default': True,
    'payload_not_available': 'offline',
    'encoding': 'utf-8',
    'availability_mode': 'latest',
    'payload_available': 'online'
  }
  , this is not expected. Please correct your configuration.
  The device name prefix will be stripped off the entity name and becomes '-UTC'

There's a bug report at home-assistant/core#97656 for a different Home Assistant integration. Via links in that report, I found:

There's an example of how they want things to be named in:

The thread also refers to the MQTT breaking changes re: naming in the Home Assistant 2023.8.0 release notes.

@zuckschwerdt
Copy link
Collaborator

If I read that right the first 'name': 'Bresser-3CH-1-176-H', should now be just 'name': 'H',?

Does this need to be a toggle? This feels like it won't be compatible with pre HA 2023.8.0?

@noahwilliamsson PR if you like and it's clear what to do. Also maybe @unverbraucht can help?

@gdt
Copy link
Collaborator

gdt commented Aug 10, 2023

I'm unclear on the details and will try to have a look -- but my take is that rtl_433 master branch need only be compatible with the most recent release of HA. rtl_433 doesn't even have releases on a regular basis, so it seems beyond reasonable to try to maintain compat with old HA releases. People who want to run old HA can run old scripts from the repo. But I think the right thing to do is update HA regularly, for all the usual "run the latest stable release" reasons.

@zuckschwerdt
Copy link
Collaborator

Sounds reasonable. (sidenote: something in HA broke for me when upgrading from 2023.4.6 and I rolled back and didn't update since)

@unverbraucht
Copy link
Contributor

Yes, seems that we need to drop the device name from the entity_name, in the release notes they say:

This means any MQTT entity which is part of a device will automatically have its friendly_name attribute prefixed with the device name.

Today I'll look into the other issue #2554 , maybe I can take a stab at both.

@unverbraucht
Copy link
Contributor

unverbraucht commented Aug 11, 2023

Actually it looks like HA already goes ahead and removes the device name with the current release. This is latest HA with no changes from my side:

image

BTW would it make sense to rename entities to something more verbose like "temperature" instead of "T"? The original topics that RTL433 create are already named "temperature" and so on, so we could reuse these.

unverbraucht added a commit to unverbraucht/rtl_433 that referenced this issue Aug 11, 2023
zuckschwerdt pushed a commit that referenced this issue Aug 11, 2023
* Fixes #2591: Remove device name from entity name, use more readable entity names
* Remove changes that slipped in from  #2593
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this issue Sep 29, 2023
* Fixes merbanan#2591: Remove device name from entity name, use more readable entity names
* Remove changes that slipped in from  merbanan#2593
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 a pull request may close this issue.

4 participants