Why can't I change state in automation actions?

I have a helper input_boolean that controls two switches using automation and it works well when I toggle it manually…
But when I automate these switches the auto-switch doesn’t update state and I can’t add an extra action to toggle it’s state!!
Thanks in advance

EDIT:
the “auto-switch” is a helper of type input_boolean

You’ll need to give more info (and less shouting)

1 Like

@nickrout
Ok cool, so I have a helper input_boolean and I use it from a dashboard toggle, I automate pressing two switches from it to be at the same state, but also have timed automations on these switches and I want to update this input_boolean helper’s status to the new one…

I meant I was surprised there was no control over state in actions and I didn’t mean to shout

Could you please post the yaml of your automations?

1 Like

@nickrout
automation to toggle switches with helper toggle:

alias: One click boiler 2
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.master_water_heater
    from: "on"
    to: "off"
condition: []
action:
  - type: turn_off
    device_id: a61e92e369733f8bc7e7c5a4e628f8a1
    entity_id: switch.wemosmywaterheater_water_heater_l1
    domain: switch
  - type: turn_off
    device_id: a61e92e369733f8bc7e7c5a4e628f8a1
    entity_id: switch.wemosmywaterheater_water_heater_l2
    domain: switch
mode: single

automation to turn off switches:

alias: 11:20 am water heater OFF
description: 6:20 am turn on water heater
trigger:
  - platform: time
    at: "11:20:00"
condition: []
action:
  - type: turn_off
    device_id: a61e92e369733f8bc7e7c5a4e628f8a1
    entity_id: switch.wemosmywaterheater_water_heater_l1
    domain: switch
  - type: turn_off
    device_id: a61e92e369733f8bc7e7c5a4e628f8a1
    entity_id: switch.wemosmywaterheater_water_heater_l2
    domain: switch
mode: single

Why don’t you just make a turn off the boolean helper, in your turn off switches automation ?

@ha_user22323 This is EXACTLY what I want to do but you apparently cant change its state from automation actions unless I’m missing something…

Try make them as input_boolean instead of a switch .

The Helper SKIFT (in danish)

image

Are you expecting the input boolean to turn off when the switches are turned off?

That’s not going to happen unless you automate it.

Use a switch group instead. You can turn the group on and off to control the switches and when your time triggered automation turns the switches off the switch group will turn off.

@tom_l Yes I know about the switch group but I want just one switch for both I dont want to have three switches on my dashboard is it possible?
I also want to automate the toggle I have but as title says I CANNOT ADD A TOGGLE OR STATE TO AN ACTION IN AUTOMATIONS FOR SOME REASON.
Thank you so much for trying to help

@ha_user22323 Thank you so much! you gave me instructions to do what I have already done
I mean toggle = skift
also thanks for the danish lesson

The thing you seem to be missing is that many things in Home Assistant are done by using services. What you have found so far are device actions, but those are best avoided because they make things hard if you decide to swap out a device for another.

What you need to do is pick “call a service” in the automations. Then pick a service that is suitable for the device you wish to control. So for lights you could use light.turn_on, etc. There’s also the generic homeassistant.turn_on, homeassistant.turn_off, homeassistant.toggle, …

From there you can pick entities that the service should act on, so you can pick multiple lights, switches, input_booleans etc. if you wish. Many services also have other parameters you can set, e.g. the light.turn_on service also lets you control brightness, hue, etc if your light supports it.

1 Like

There no need to YELL.

Create the group and hide the switches.

1 Like

@tom_l Didn’t mean to yell I just felt like you missed the title somehow
I’m fasting btw so I could be a little too nervous

@Edwin_D Thank you so much, I was able to do it using “call a service” action
finally I can actually see the status on the dashboard with only one toggle

And to add on it: what others were trying to explain is that a group is an easy way to get the same thing done without the need for automations. So they also answered the question, just not in the way you expected. Pleasant fasting.

1 Like

@Edwin_D Yes but it’s not very practical to have the two switches show up as they are not useful if used separately and I already knew about the switch group.
Thank you again

Where do the individual switches appear then? Maybe only in automatic dashboards, but not if you add the group as a single entity as far as I know. The group should be able to be used in exactly the same way. And, as also explained, you can hide the individual switches from the UI (the automatic one) from the settings page of the individual switches.

1 Like

I mean when you add a switch group you mean on the dashboard right? Because I haven’t found a way to keep the header switch but hide the other switches, unless you mean switch group somewhere else…

What was meant was a group helper. Found in Settings.

1 Like