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
872
872
allows multiple arguments with and without ``not ``. The condition will be met if the current time
873
873
matches any of the positive arguments, and none of the negative arguments.
874
874
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
+
875
885
@webhook_trigger
876
886
^^^^^^^^^^^^^^^^
877
887
You can’t perform that action at this time.
0 commit comments