Need help creating scene switch

Hello,

I recently installed the Pentair Intellicenter custom integration through HACS. Unfortunately, my feature groups do not pull through, so I have attempted to circumvent that drawback by using scenes. I created the following 4 scenes:

  • Waterfall On
  • Waterfall Off
  • Waterslide On
  • Waterslide Off

Basically, the Waterfall On scene turns on certain entities, and the Waterfall Off scene turns off those same entities. I have a little more investigating I have to do with scenes though as the Waterfall On and Waterslide On scenes double-up on a couple of entities, so would like to make it so that the scenes work nicely together, but that is a future task as they otherwise serve their current functions.

I created a template switch, but it is a switch with separate buttons. I would like to create a switch that works like a typical entity switch with color changing states, if that is possible.

My current switches.yaml

#toggle switch for Waterfall Scene
- platform: template
  switches:
    waterfall_scene_switch: 
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterfall_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterfall_off
          
#toggle switch for Waterslide Scene
- platform: template
  switches:
    waterslide_scene_switch: 
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterslide_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterslide_off

This results in these switches (Under Water Feature Switches) instead of something that looks like any of the other entity switches in the screenshot.

The main reason for doing that is so I can use a more compact card like the custom Room Card for certain dashboards.

I appreciate any help.

TBH, I’m struggling to understand what you are trying to accomplish. Apart from what you write about scenes, what entities do you have - and what would you like to do with them, in what sort of grouped way?

I am trying to create a switch for scenes that resembles this type of switch:

Instead of the switch I created here:

Where switching the switch to the right turns on the “Waterfall Off” scene and flipping the switch to the left turns on the “Waterfall Off” scene.

The reason you don’t have a toggle for your template switches is that you have not provided a value_template to define their states in their configuration.

1 Like

Thanks.

I tried the following code and it created a toggle switch. If I turn the switch to on (for example to Waterfall On), the switch stays on only momentarily while activating the scene, but doesn’t give me the ability to turn to off to activate the Waterfall Off scene.

#toggle switch for Waterfall Scene
- platform: template
  switches:
    waterfall_scene_switch:
      value_template: "{{ is_state('scene.waterfall_on', 'on') }}"
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterfall_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterfall_off
          
#toggle switch for Waterslide Scene
- platform: template
  switches:
    waterslide_scene_switch:
      value_template: "{{ is_state('scene.waterslide_on', 'on') }}"
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterslide_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterslide_off


I’m wondering if I need to use one of the entities’ states in the value template, because the scene being activated can’t give it a true “on” state…

Okay, the hard part was figuring out the entities to use to set the switch state because the scenes double-up on a couple of entities. I ended up using the pump speeds (as they are separate switches in Home Assistant and Pentair’s app). So, by using the pumps to set the switch state (they only reason these pump speeds would need to be set to on would be in conjunction with the corresponding scene), I was able to create a scene switch with a toggle that works and looks the way I want it to.

#toggle switch for Waterfall Scene
- platform: template
  switches:
    waterfall_scene_switch:
      value_template: "{{ is_state('switch.waterfall_pump', 'on') }}"
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterfall_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterfall_off
          
#toggle switch for Waterslide Scene
- platform: template
  switches:
    waterslide_scene_switch:
      value_template: "{{ is_state('switch.waterslide_pump', 'on') }}"
      turn_on:
        service: scene.turn_on
        entity_id: scene.waterslide_on
      turn_off:
        service: scene.turn_on
        entity_id: scene.waterslide_off

With this, I was able to get these switches that work.

Thanks for the quick help. If you have a better suggestion for what to use to set the state value, I’d love to hear it.

1 Like