File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -872,6 +872,16 @@ true if the current time doesn't match any of the "not" (negative) specification
872872allows multiple arguments with and without ``not ``. The condition will be met if the current time
873873matches any of the positive arguments, and none of the negative arguments.
874874
875+ .. code :: python
876+
877+ @state_trigger (" binary_sensor.motion_detected == 'on'" ) # trigger on motion detection
878+ @state_active (" input_boolean.motion_light_automation == 'on'" ) # but only if the automation is enabled
879+ @time_active (" range(8:00, 22:00)" ) # but only during the day
880+ def motion_controlled_light (** kwargs ):
881+ log.info(f " got motion. turning on the lights " )
882+ light.turn_on(entity_id = " light.hallway" )
883+
884+
875885 @webhook_trigger
876886^^^^^^^^^^^^^^^^
877887
You can’t perform that action at this time.
0 commit comments