Multiple entities custom widget


Trying to put several scenes triggers/switches into one widget as shown on mockup:

Tried to reverse engineering the scene and heater widgets :slight_smile: , but totally lost.
Can somebody help?

My dashboard entry should be look something like this:

    widget_type: scenex
    widget_style: "background-color: #2e4226"
    entity: scene.switch
    entity1: scene.switch1
    entity2: scene.switch2
    entity3: scene.switch3
    entity4: scene.switch4

thats very hard to do for a custom widget that we dont know.
do you have a link to the custom widget?
did you copy the custom widget to the right place? with the right filerights?
do you get errors?
is there any kind of description?
leaving things empty after a : is most of the times a bad idea.
if its written correct then those lines are not needed.

Rene, there’s no such widget) I’m trying to make one.
Looking for some examples how I can add additional switch toggle to corner of the exist widget with additional entity_id.

it’s just an example/skeleton, of course it will come with icon/style definitions…

first you need to create a working custom widget. (for instance by copying an existing one and modifying it.)
then you can start to change it.

but you really need to know your way around in programming javascript, css and html
you can compare the base_heater with base_switch files.

base_switch has only 1 entity, base_heater has 2 entities.

the problem is that a widget like that isnt that usefull in most cases.
you need at least the space from four widgets to make it workable (or else the toucharea would be to small)
so you could also use 4 widgets to do the trick.

That’s done.

That’s true but I don’t understand how to use post_service_active/inactive for different entities when the service is the same service.

    service: homeassistant/turn_on
    entity_id: {{entity}}
    service: homeassistant/turn_off
    entity_id: {{entity}}

Useful or not it depends)
For my setup heater is absolutely useless, but I’m not stating that it isn’t useful for others)

4 widgets can work but it’s ugly, same as having 4 widgets for the heater (temperature sensor, fan, minus and plus buttons for the temperature)

In my setup I want to use for example big button (2x2) to turn on/off the tv, and the small buttons/icons in the corners will control tv input (usually no need to change, only sometimes) so it will accessible but not taking too much extra space.

i meant it isnt usefull like it wont be workable unless you set the size to 2x2
and then you can use 4 widgets which takes the same place and just configere it so that they look as 1 widget.

this is 1 of my dashboards but i didnt create 1 widget that has 15 entities :wink:

the services that are in the yaml file are called in the functions from the javascript file

in the switch widget it is like this:

        if (self.state == self.parameters.state_active)
            args = self.parameters.post_service_inactive
            args = self.parameters.post_service_active
        self.call_service(self, args);

but you need to connect the function to an event and a location
and you need to data bind the styles and values to that same location.

Still, the idea is one big “main” trigger (often use, common/standard scene) and several small (not often use, advanced entities). I started a repository, tried to put additional entity as I saw in baseheater, but no luck, the icon updating on both buttons:


The repository is:

Do you have any idea how to separate entity and entity1?

you need to set extra callbacks which you connect to
you need to use different functions for different entities
you need to change the set_view.

you need to understand what the javascript does, or else it would be a very difficult process.

by the way, the best way to learn how to create custom widgets is by following the instructions from the one who created the dashboard program.
he did a hell of a job writing instructions down.

so you might want to read through the docs and figure it out that way.

it probably answers more questions then i can :wink:

Can you tell me how to nest more widgets inside one as you show in this picture? Do i need a custom widget ? Where to find examples?

at the moment it is not possible to nest more widgets inside 1.
i adchieved that by creating a background picture.

Ok, thanks…