DenisSh
(Denis)
August 2, 2020, 2:26pm
1
code doesn’t works:
- id: '1595725268224'
alias: Включение света в маленьком аквариуме
description: ''
trigger:
- device_id: d6612380b1bd4b74857c8dd6fd173111
domain: switch
entity_id: switch.33808108bcddc2a8e5e0_2
platform: device
type: turned_on
condition:
- after: '06:00:00'
before: '10:00:00'
condition: time
- after: '17:00:00'
before: '21:00:00'
condition: time
action: []
mode: single
another question - how to switch on/off two or three switches by one event (at same time)
123
(Taras)
August 2, 2020, 2:40pm
2
DenisSh:
code doesn’t works:
It has no action. What is it supposed to do?
Also, the condition is incorrect. Multiple conditions are, by default, logically ANDed. For your two time periods you want them logically ORed. The documentation explains how to indicate a logical OR.
DenisSh
(Denis)
August 2, 2020, 3:17pm
3
- id: '1595725268222'
alias: Компрессор маленьком аквариуме вкл
description: ''
trigger:
- at: '08:00:00'
platform: time
- at: '15:00:00'
platform: time
action:
- service: switch.turn_on
entity_id: switch.33808108bcddc2a8e5e0_3
mode: single
- id: '1595725268223'
alias: Компрессор маленьком аквариуме выкл
description: ''
trigger:
- at: '12:00:00'
platform: time
- at: '18:00:00'
platform: time
action:
- service: switch.turn_off
entity_id: switch.33808108bcddc2a8e5e0_3
mode: single
have changed my code.
One more question has been left - can I put several devices to switch on/off at same time?
123
(Taras)
August 2, 2020, 4:30pm
4
Yes.
action:
- service: switch.turn_on
entity_id: >
- switch.first
- switch.second
- switch.third
- switch.etc
DenisSh
(Denis)
August 4, 2020, 3:01am
5
also have same question about several time intervals that I’d like to set for turn_on/turn_off, is it right:
trigger:
- at: '12:00:00'
platform: time
- at: '18:00:00'
platform: time
how i can to write it?
123
(Taras)
August 4, 2020, 1:55pm
6
Yes, that’s the correct format and how the documentation explains it: Multiple Triggers