Hello all,
I also would like to create devices out of entities.
I also think of device as a physical or virtual object with multiple entities (as attributes of the devices - do not confuse this concept with attributes of entities).
I also read last years thread: WTH can’t I manually create a device from entities? , which I totally agree to.
I have a lot of entities floating around, and would love to bring them together in a device to more easily find them.
Same is true for the mass of entities created by eg. the “Sungrow-Modbus-Integration” - which actually is “only” a package/config to create entities as yaml-config.
see: GitHub - mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant: Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
here it would be good if I could simply enhance the script / sensor-configurations to all be part of one device …
e.g. (non existing yaml-configuration option as sample-code):
modbus:
- name: SungrowSHx
type: tcp
host: !secret sungrow_modbus_host_ip
port: !secret sungrow_modbus_port
retries: 10
sensors:
- name: Sungrow device type code
unique_id: sg_dev_code
slave: !secret sungrow_modbus_slave
address: 4999 # reg 5000
input_type: input
data_type: uint16
scan_interval: 600
device:
device_id: 'modbus_sungrow_sh10rt_sw'
manufacturer: "Sungrow"
model: "SH10RT-v112"
name: "Sungrow SH10RT v112"
The idea would be, that by adding the “device: > device_id:” I would create a device, and add the sensor-entity to the device.
It would help me a lot finding the entities, as they are then all structured in a device.
I think creating an automation to add every entity in only this “Sungrow-modbus” would be massive overkill for these 50+ entities (so there is a workaround - but it is massively inconcenient!)
I think a new config item in the configuration.yaml would even be better - where one could create a device and add the entities to the device there (as shared in last years WTH):
device:
- device_id: 'modbus_sungrow_sh10rt_sw'
manufacturer: "Sungrow"
model: "SH10RT-v112"
name: "Sungrow SH10RT v112"
entities:
- entity: sensor.sungrow_device_type_code
Wouldn’t that make a lot of sense?