Open rschoell opened 2 days ago
I'm missing that too. Implementation shouldn't be to hard though, here's some example code:
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the sensor platform."""
# Register both sensor entities under the same device
add_entities([MyTemperatureSensor(hass)])
class MyTemperatureSensor(SensorEntity):
"""Representation of a Temperature Sensor."""
@property
def device_info(self):
return DeviceInfo(
identifiers={(self.__class__.__name__, "my_sensor_device")},
name="My Custom Sensor Device",
manufacturer="Custom Manufacturer",
model="Custom Sensor Model 1.0",
)
The problem
I've recently switched my Keba integration from the internal integration (based on unreliable UDP protocol) to Modbus TCP. So far this is far more stable and controllable, as TCP is stateful protocol. One thing that bothers me (and others: https://community.home-assistant.io/t/modbus-sensors-unique-id-and-device-support/373428) is, that we create a "device" in yaml, under which we place binary_sensors, sensors, switches, ... If you then look in Settings - Devices, it only lists the sensors as entities, but does not list the "main" device. It would be cumbersome to have some correction of this. My config looks like this:
I would expect to see
I cannot fix this myself, but hope that you'll help the community and me. Many thanks.
What version of Home Assistant Core has the issue?
core-2024.10.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Modbus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response