Wth can't I add a helper to a existing device?

I have helpers like input_booleans and input_select that I have made to help control a certain device it would be great if I could just add these entities to the relevant device.

Relates to this one but you question is boarder than just templates: Why can't we add template entities to existing devices?

1 Like

Helpers are not provided by a device in any way. So I’m not sure how that would work?

A template entity… yeah, maybe, if it provided/extracted information from a device. However, for an input/helper that isn’t the case.

1 Like

it’s more an organise kinda thing.

If I set up an esphome device that relies on a helper for example then adding that helper to the device in HA would make it more “logic”. More a “related to” instead of “stemming from”…

I agree. Most of my helpers are also related with one device. Usually via some automation but still meant for this particular device. All Riemann sum and Utility Meters are always related with one device.

2 Likes

I agree on those, as these consume the device itself (unlike input_* helpers).
But those cases could just be fixed/handled by the respective integrations already. For example, when using a Switch as X, the replacement entity gets added to the device.

So from that perspective, I think “Wth can’t I add a helper an existing device” would maybe be better described as “Wth don’t Riemann sum and Utility Meters add themselves to their respective devices”.

…/Frenck

Yeah, “helpers” that use one source entity should always be under this device. I agree that it would be nice to get Riemann sum and Utility meters (what periods?) somehow automatically.

There are also “helpers” that are not obvious like “Derivative sensor” or statistics min/max/avg sensor.

One simple solution would be to automatically assign all other sensors whose input is from device, under the same device but show them like “related”. It is still good to have distinction what sensors are coming from device/integration and what are added extra by user.

Sometimes the “Related” doesn’t work even with the entity itself - again both Rieman sum and Utility Meter are the first ones I see this information missing.

1 Like

It would just be a UI upgrade though right? So it would be similar to how you currently can assign any entity to any area. But it would just be another drop down, which would allow you to assign any entity to any device. The backend stuff is pretty much already in the place, because the likes of MQTT sensors uses it - mapping a sensor to a device. So on the backend surely it would be as simple as storing in the JSON config - that an entity belongs to a particular device. The only things it wouldn’t work for - would be YAML defined entities that have no unique_id (which is fine, because they can’t be configured in the UI anyway)

1 Like

You can assign a unique id to most yaml defined entities. just add unique_id: like you would add friendly_name: (enjoy updating your yaml files :smiley:

Oh I know, as I’ve updated from the old format for things like MQTT and Template stuff, I’ve added unique IDs to stuff. But not everything in YAML has always been able to have a unique ID - it’s reasonably recent that that has improved. Once an entity has a unique ID - there is no reason it can’t be added to a device, because it’s uniquely identifiable

It should also be possible to assign a device for various template sensors, or SQL sensors. I create various template sensors from power use states of devices and it would be nice to have those appear on the device page.

I like this idea.

Here is my NS panel and it groups the automations and scripts I have to this device in the left panel.
It would be very nice if these included a edit and this input_* filed.

And please make sure there is a edit button so that we can add them manually because my scripts are not here in the list.
That would make it very easy to organize and find everything related to one device.

I fully concur with this WTH. It is very similar to one from last year (WTH can’t I manually create a device from entities?).

I would extend this WTH to be more general, as in the one I linked above. WTH can I not add/link entities to a device, or even compile several into a ‘virtual’ device? For example, I have a smart plug on my dishwasher that allows me to monitor the power consumption. I have a template that uses this power consumption to create a dishwasher state (off, idle, drying, washing). Currently, this template entity state just floats by itself rather than being linked to the Dishwasher device.

The powercalc integration create sensors about power and energy from a device. The new sensor is added to the device overview. It’s perfect! But why I can’t do it manually? I want it :smile:

1 Like

You are very right. Powercalc is able to add a new Sensor box in the device overview.

I created a Real power sensor for my TV feeding from the socket Power, which creates an Energy sensor for the device (the actual TV).

[It doesn’t actually create/duplicate the power sensor into the TV, it creates a new Energy one that feeds off the power, but that is by design of the creator to avoid duplication I guess).

So, it’s possible to do this (add a sensor to a device). As you pointed, the quesiton is how to do this manually. I have sensors, template entities, etc floating around that I would love to merge into the device…