You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This addon 'embeds' the energy / power sensors 'into' the original device:
It's a super clean way of presenting this kind of information, as it reduces the number of individual devices on the system, and puts the energy information directly within the device, so it's available immediately when looking at the device.
Unsure of your thoughts on this, it could be complicated - I'm not 100% on the actual implementation details from powercalc.
I just wanted to draw attention to it as you may not have seen this pattern before, and it could be a good fit.
Unsure.
The text was updated successfully, but these errors were encountered:
I just can't get it to work. Must be something like this:
@propertydefdevice_info(self):
"""Return device information to link this sensor with the integration or a specific device."""entity_registry=er.async_get(self.hass)
entity_entry=entity_registry.async_get(self._energy_sensor_id)
ifentity_entryandentity_entry.device_id:
# If there is a device linked to the user-inputted energy sensor, link the sensor to it.return {
"identifiers": {(DOMAIN, self._energy_sensor_id)}, # Unique identifier for your sensor"name": self._device_name,
"via_device": entity_entry.device_id# Link to the device of the original energy sensor
}
else:
# Fallback if no device is linked to the energy sensorreturn {
"identifiers": {(DOMAIN, self._energy_sensor_id)},
"name": self._device_name,
"manufacturer": "Custom Integration"
}
Not doing the template for this one, sorry! I couldn't work out how to structure it into the headings!
I use https://github.com/bramstroker/homeassistant-powercalc for some devices (virtual power meter for devices, calculated by setting on, off, idle power draw readings).
This addon 'embeds' the energy / power sensors 'into' the original device:
It's a super clean way of presenting this kind of information, as it reduces the number of individual devices on the system, and puts the energy information directly within the device, so it's available immediately when looking at the device.
Unsure of your thoughts on this, it could be complicated - I'm not 100% on the actual implementation details from powercalc.
I just wanted to draw attention to it as you may not have seen this pattern before, and it could be a good fit.
Unsure.
The text was updated successfully, but these errors were encountered: