I have the following automation. When I trigger it is working, so both switches turn on. However when its the right time for automation to work it only turns on the first switch.
#Bed Heat
- id: Bed Heat
alias: Bed Heat
trigger:
platform: time
at: '21:15:00'
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
entity_id: switch.sonoff_10001baf48, switch.sonoff_10007b436c
If @briis suggestion doesn’t work, then there might be a bigger issue with your system. Both suggestions should work equally well and I’m surprised that it turns on both switches when you trigger it manually, but only one when it is triggered by the time.
Yes, I don’t know if OP is aware of that, however doesn’t change the fact that only a part of the action gets executed when the automation is triggered manually and this seems strange to me as there are no conditions, wait templates or anything like that in his action part.
Wow, there’s a whole lot of repetition in this thread telling the OP to try the same things he said he already tried (at least according to his first post).
In the OP both ways should work (minus the extraneous “switch:” that you said didn’t actually exist). You need to do some testing to see what might be the issue.
If not then try one then the other. if both work individually then try reversing the order of the entities.
you can even try adding the entities as a bulleted list instead of individually or in a single line.
Makis, can you understand the confusion ?
You say you have a problem with THIS
Then people point out the problems with THIS and how it should be THAT.
You say that THIS is not THIS but something else (and don’t post your something else) it’s very hard to diagnose something we can’t see.
Finity has given you every permutation you should try.
Test them out and report back posting the updated config you are having issues with
I’m not really sure what is different between the first one in your OP and what you say is now working.
It has “data:” in the action but that isn’t needed to make a comma separated list work. To test that I just wrote a test automation and this works just fine:
- alias: test
trigger:
- platform: state
entity_id: input_boolean.bool_15
to: 'on'
condition:
- condition: state
entity_id: input_boolean.bool_14
state: 'on'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.bool_16, input_boolean.bool_17
There had to be something else wrong that you weren’t showing us.
Sorry, but I don’t know what was wrong.
Now tested @finity code and it worked too.
#Bed Heat SS
- id: Bed Heat SS
alias: Bed Heat SS
trigger:
platform: time
at: '14:04:00'
condition:
condition: time
weekday:
- mon
- sun
action:
- service: switch.turn_on
entity_id: switch.sonoff_10007b436c
- service: switch.turn_on
entity_id: switch.sonoff_10001baf48
I installed the second switch (sonoff outlet) yesterday. I tried a few times with different codes but nothing worked. I don’t know why today it is working.
ok, right now I am at work but I can see that both switches turned on. I just tried my original code and both switches turned on…
Really sorry for your time. Right now I am not sure why it wasn’t working. I assume that I didn’t reload automations when I changed the code? So that’s why it turned on only the first one.
Just find out what the problem is. Although HA turns on both switches there is a problem with the one I installed yesterday. It turns off in HA after 2-3 minutes. In the sonoff app I can see that its not turning on.
So I have to reinstall the switch and I hope that it will work ok