File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -791,9 +791,22 @@ optional ``kwargs`` argument to a ``dict`` with the keywords and values.
791791Wildcards in topics are supported. The ``topic `` variables will be set to the full expanded topic
792792the message arrived on.
793793
794+ Wildcards are:
795+ - ``+ `` matches a single level in the topic hierarchy.
796+ - ``# `` matches zero or more levels in the topic hierarchy, can only be last.
797+
794798NOTE: The `MQTT Integration in Home Assistant <https://www.home-assistant.io/integrations/mqtt/ >`__
795799must be set up to use ``@mqtt_trigger ``.
796800
801+ .. code :: python
802+
803+ @mqtt_trigger (' zigbee2mqtt/carport/motion' , " payload_obj['occupancy'] != None" )
804+ @time_active (" range(sunset - 30m, sunrise - 30m)" )
805+ def carport_motion ():
806+ light.turn_on(entity_id = " light.carport" )
807+ task.sleep(300 )
808+ light.turn_off(entity_id = " light.carport" )
809+
797810 @state_active
798811^^^^^^^^^^^^^
799812
You can’t perform that action at this time.
0 commit comments