From 3e563c57dab670c8c2440ebde4e4d10ddc995a41 Mon Sep 17 00:00:00 2001 From: Jon Caruana Date: Thu, 24 Nov 2016 10:06:17 -0800 Subject: [PATCH] =?UTF-8?q?LiteJet:=20Add=20held=5Fmore=5Fthan=20and=20hel?= =?UTF-8?q?d=5Fless=5Fthan=20options=20for=20the=20automa=E2=80=A6=20(#146?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * LiteJet: Add held_more_than and held_less_than options for the automation trigger. LiteJet: Fix unrelated documentation details. * LiteJet: Formatting tweak. --- source/_components/litejet.markdown | 31 ++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/source/_components/litejet.markdown b/source/_components/litejet.markdown index f2c4db330e8..3770bb024be 100644 --- a/source/_components/litejet.markdown +++ b/source/_components/litejet.markdown @@ -8,7 +8,7 @@ comments: false sharing: true footer: true ha_category: Hub -ha_iot_class: "Local Polling" +ha_iot_class: "Local Push" ha_release: 0.32 --- @@ -27,18 +27,12 @@ Your LiteJet MCP should be configured for 19.2 K baud, 8 data bits, 1 stop bit, You can also configure the Home Assistant to ignore lights, scenes, and switches via their name. This is highly recommended since LiteJet has a fixed number of each of these and with most systems many will be unused. -```yaml -litejet: -``` - Configuration variables: - **port** (*Required*): The path to the serial port connected to the LiteJet. - **exclude_names** (*Optional*): A list of light or switch names that should be ignored. - **include_switches** (*Optional*): Cause entities to be created for all the LiteJet switches. Default is `false`. This can be useful when debugging your lighting as you can press/release switches remotely. - - ```yaml litejet: exclude_names: @@ -49,3 +43,26 @@ litejet: - 'LV Rel #' - 'Fan #' ``` + +### Trigger + +LiteJet switches can be used as triggers too to allow those buttons to behave differently based on hold time. For example, automation can distinguish quick tap versus long hold. + +- **platform** (*Required*): Must be 'litejet'. +- **number** (*Required*): The switch number to be monitored. +- **held_more_than** (*Optional*): The minimum time the switch must be held before the trigger can activate. +- **held_less_than** (*Optional*): The maximum time the switch can be held for the trigger to activate. + +The trigger will activate at the earliest moment both `held_more_than` and `held_less_than` are known to be satisfied. If neither are specified, the trigger activates the moment the switch is pressed. If only `held_more_than` is specified, the trigger will activate the moment the switch has been held down at least that time. If `held_less_than` specified, the trigger can only activate when the switch is released. + +```yaml +automation: +- trigger: + platform: litejet + number: 55 + held_more_than: + milliseconds: 1000 + held_less_than: + milliseconds: 2000 + ... +```