Generic Sensor with attributes

I used Home Assistant for a while and I found that working with automation leads me to create a lot of helpers, like, a lot.
For example, I created a smart multiroom ac system and used multiple input_number for each situation (Away/Indoor/Night…) which allows me to modify those values easily without modifying automations.
I now would like to have different temperatures for bedroom/kitchen !

Would it be possible to create a sensor called “Kitchen temperatures” with attributes like “away temp” or “present temp” and those attributes would be input_numbers ?
I’ve seen some examples around templates or customization but not really what I search for

Can you clarify what you mean by “those attributes would be input_numbers”?

Do you mean that you have the ability to modify the value by changing an Input number helper? That can be done using a Template sensor.

Template Sensor Example

It is unclear what your want the state of the sensor to be so I will leave it blank. You will need to define a state as it is a required variable but it could just be a static value if that’s what you want

template:
  - sensor:
    - name: Kitchen Temperatures
      state: 
      attributes:
        present_temp: >
          {{ states('sensor.kitchen_thermometer')|float(0) }}
        away_temp: >
          {{ states('input_number.kitchen_away_temp')|float(0) }}
        occupied_temp: >
          {{ states('input_number.kitchen_occupied_temp')|float(0) }}

I mean the values (AwayTemp/OccupiedTemp) are only configured ones, not comming from any other sensor.
For now I have those in the Sensor Helper :


But for each room, it makes a lot of helpers. I was thinking of a “virtual” sensor with all those helpers included to sort things up.

I mean for now I have like 20 helpers to configure and I have very little sensors. In a bigger installation I would have hundred of helpers :laughing:

You could use something like the Variable+History custom integration to create the sensor and it’s attributes, and then use a couple core helpers and a script or two to allow you to set each value from the frontend. The UX of setting the values would be a little different and it would only “save” you creating any helpers in cases where you needed more than three total attributes.

I’ve been doing things the way you are with helpers but I know some people said they were using MQTT to store variable as well.

Seems to answer my need ! I will test it right now. Helpers are nice but tere is no way to keep them organised … Having something like folders or anything else could be a good solution, but will test vwith variables !
And if not working, I will check MQTT stuff.

If the problem is just organization you need a naming convention. On my system anything related to heating starts with HVAC so I can use a filter to find those helpers. I also assign an “Area” using the advanced section of the helper menu. I have strict naming conventions for automation too.