#hi, is there any way in an Action to
1 messages · Page 1 of 1 (latest)
hello, ok but how does that apply to all the lights in that Area?
sorry I'm new to this
ok so long as all my Leviton switches are in that area, it will trigger that action to them
and HA does the rest
I don't get the Area option in my Action
You picked the same service?
This only works if you use services, not device actions
here is my YAML script ```description: ""
mode: single
trigger:
- type: motion
platform: device
device_id: 1e...
entity_id: fa7...
domain: binary_sensor
condition: - condition: and
conditions:- condition: time
after: "00:00:00" - condition: sun
before: sunrise
action:
- condition: time
- device_id: ""
domain: ""
entity_id: ""```
ah ok services is key then
i had picked Device I think
Devices are limiting, don't use them
where is that Services? I am looking everywhere for it
my Automations screen shows this
weird i can't add an attachment here for screenshot
Please use imgur or other image sharing web sites, and share the link here.
Image posting is blocked in most channels to discourage people from sharing text as images. Sharing text as images assumes that everybody sees the world as you do, which isn't the case. Some people are colour blind, or have visual impairment that means they can't make sense of an image of text.
That's blocked by default because too many people post images of text, or walls of irrelevant images
No
i want the condition to be: after 12.00 and before Sunrise
Ok, so that's an or with two conditions
One for after 12:00 and one for before sunrise
ok
ok here is my Automation ```description: ""
mode: single
trigger:
-
type: motion
platform: device
device_id: 1e..
entity_id: fa7..domain: binary_sensor
condition: -
condition: time
after: "00:00:00"
weekday:- sun
- mon
- tue
- wed
- thu
- fri
- sat
-
condition: and
conditions:- condition: sun
before: sunrise
action:
- condition: sun
-
service: light.turn_on
target:
entity_id: []
device_id: []
area_id:
- outdoors
data: {} -
delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0 -
service: light.turn_off
target:
area_id: outdoors
data: {}
you don't need to obfiscate the enttiy_id and device_id, they are just randomly genereated id's which are created when you integrate the device. Nobody can do anything with them
I would advice to use a state trigger anyway, so the total thing would be
description: ""
mode: single
trigger:
- platform: state
entity_id: binary_sensor.motion_outdoor #change to correct sensor
to: "on"
condition:
- condition: time
after: "00:00:00"
- condition: sun
before: sunrise
action:
- service: light.turn_on
target:
area_id:
- outdoors
- delay:
minutes: 15
- service: light.turn_off
target:
area_id: outdoors
note that this will turn off your light regardless if there is still motion
yup, the motion sensor triggers once and then stops
you might want to use either mode: restart or use a wait_for_trigger instead of the delay
the wait_for_trigger would be for?
ah the motion sensor don't work this way unfortunately... it's a ON then off for 1 min... then a new trigger if new motion is sensed
so i see this working as follows (rural long driveway about 300 feet long and winding) - sensor trips, all lights go on.. the only way for a driver to get out now is to continue up the driveway, turn around, then go back out... another trigger happens, but the lights are already on
- service: light.turn_on
target:
area_id:
- outdoors
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.motion_outdoor #change to correct sensor
to: "off"
for: "00:15:00"
- service: light.turn_off
target:
area_id: outdoors
That's the other way
ok
as i can see, so many ways to slice and dice this
will play with a few and see which works in my situation, will add a few more sensors once I see how this works and add even more specific lighting to zones etc
thank you for the help, very very helpful
how do i close this room if no longer needed?