From c71133b1e23275c5c4e0a922569d393edc26edc3 Mon Sep 17 00:00:00 2001 From: Joshua Clark Date: Tue, 22 Oct 2024 21:21:40 -0600 Subject: [PATCH] automations, floorplan, remove hue remote - Remove Hue Dimmer Remote, it just dies way too fast - Fix temperature sensors on floorplan - Change Event Sniffer automation to pick up Dreame vac events - Fix startup automation due to hass.agent change - Change Main Bedroom fan to shut off at night - Add default light status for Main bedroom fan - Add School departure light indicator - Attempt to fix Hyundai remote start script - Update Inovelli blueprint --- README.md | 9 +- automations.yaml | 231 ++++-- .../EPMatt/philips_324131092621.yaml | 731 ------------------ .../zanix/inovelli_blue_led_zigbee2mqtt.yaml | 25 +- lovelace/dashboards/floorplan.yaml | 2 +- scripts.yaml | 8 + www/floorplan/floorplan.svg | 8 +- 7 files changed, 194 insertions(+), 820 deletions(-) delete mode 100644 blueprints/automation/EPMatt/philips_324131092621.yaml diff --git a/README.md b/README.md index a00116c2..e46efe43 100644 --- a/README.md +++ b/README.md @@ -674,7 +674,7 @@ A Material You and Google Home app influenced theme for Home Assistant > [!NOTE] > For more details, see the [automations.xml][automations] file and `automation:` blocks in [integrations]. -
501 Automations +
502 Automations > Keymaster automations are hidden @@ -702,7 +702,7 @@ A Material You and Google Home app influenced theme for Home Assistant - βš™οΈ Battery Level Low - βš™οΈ Clear TTS Cache 🚫 - βš™οΈ Disk Space Low -- βš™οΈ Event Sniffer [Actionable Event] 🚫 +- βš™οΈ Event Sniffer 🚫 - βš™οΈ Event Sniffer [Z-Wave JS] 🚫 - βš™οΈ Failed Login - βš™οΈ Offline Devices @@ -732,6 +732,7 @@ A Material You and Google Home app influenced theme for Home Assistant - πŸ’‘ Front Lights off at Sunrise - πŸ’‘ Front Lights on at Sunset - πŸ’‘ Living Room Lamps on/off +- πŸ’‘ School Departure Light Indicator - πŸ’‘ Turn Lights On when Arrive - πŸ’§ Shut-Off Valve Overheated - πŸ’§ Softener Salt Level Low @@ -761,7 +762,6 @@ A Material You and Google Home app influenced theme for Home Assistant - πŸ“… Grow Light On/Off 🚫 - πŸ“… Living Room Fan On/Off - πŸ“… Main Bedroom Fan On/Off -- πŸ“‹ [Controller] Hue Dimmer Remote - πŸ“‹ [Controller] Ikea Remote Main Bedroom - πŸ“‹ [Inovelli] Amy Office Switch - πŸ“‹ [Inovelli] Emma Switch @@ -786,13 +786,14 @@ A Material You and Google Home app influenced theme for Home Assistant - πŸ”” Doorbell Ring - πŸ”” Frigate Doorbell - Event Handler - πŸ”” Frigate Doorbell - Object Seen +- πŸ•— Main Bedroom Ceiling Fan Default Light Status - πŸ–₯️ [Ardena] Power Actions - πŸ–₯️ [Ardena] Power on Activity - πŸ–₯️ [Quest] Charge Complete - πŸ–₯️ [Quest] Interactive - πŸ–¨οΈ Low Toner - πŸ–¨οΈ Out of Paper -- πŸ—ΊοΈ Arriving Home +- πŸ—ΊοΈ Arriving Home 🚫 - πŸ—ΊοΈ Leaving Zone - 🚦 Amy Office Light Switch Status - 🚦 Emma Light Switch Status diff --git a/automations.yaml b/automations.yaml index 2eea4a40..eed90da8 100644 --- a/automations.yaml +++ b/automations.yaml @@ -2126,21 +2126,32 @@ data: {} mode: restart - id: '1665696446379' - alias: βš™οΈ Event Sniffer [Actionable Event] - description: Listen for Actionable events - trigger: - - platform: event - event_type: mobile_app_notification_action - - platform: event - event_type: hass_agent_notifications - condition: [] - action: + alias: βš™οΈ Event Sniffer + description: Listen for events and output data + triggers: + - event_type: mobile_app_notification_action + trigger: event + enabled: false + - event_type: hass_agent_notifications + trigger: event + enabled: false + - event_type: dreame_vacuum_task_status + trigger: event + - event_type: dreame_vacuum_consumable + trigger: event + - event_type: dreame_vacuum_information + trigger: event + - event_type: dreame_vacuum_warning + trigger: event + - event_type: dreame_vacuum_error + trigger: event + conditions: [] + actions: - data: title: Actionable Event Sniffer - message: '{{ trigger.event.data | default("") }}' + message: '{{ trigger.event.data | to_json }}' action: persistent_notification.create mode: parallel - initial_state: false - id: '1665696464819' alias: βš™οΈ Battery Level Low description: Sends a notification when a device battery level is low @@ -2372,11 +2383,11 @@ - id: '1665696596579' alias: βš™οΈ Startup description: Actions to run at startup - trigger: - - platform: homeassistant - event: start - condition: [] - action: + triggers: + - event: start + trigger: homeassistant + conditions: [] + actions: - data: message: Startup automation starting... action: browser_mod.notification @@ -2385,9 +2396,10 @@ - data: {} target: device_id: - - 046ad4016aea54916dd414935e0008da - - fd4ff1a9970156bb319e4d85d4450657 - 1dee4aa37e70d346348224829cd7c84f + - fd4ff1a9970156bb319e4d85d4450657 + - c72e54dada7a18b12e5d2a42cd2a94ab + - 49d046eb766685131c0c5deb9f0d2250 action: homeassistant.reload_config_entry - data: entity: @@ -2416,18 +2428,24 @@ - id: '1665696688106' alias: βš™οΈ Event Sniffer [Z-Wave JS] description: Listen for Z-Wave JS events - trigger: - - platform: event - event_type: zwave_js_value_notification + triggers: + - event_type: zwave_js_value_notification alias: When Central Scene event is fired - - platform: event - event_type: zwave_js_notification + trigger: event + - event_type: zwave_js_notification alias: When Notification Command Class, Entry Control Command Class is fired - condition: + trigger: event + conditions: - condition: template value_template: '{{ event_label.endswith("lock operation") == False }}' alias: 'Ignore events already identified: Manual deadbolt operation' - action: + actions: + - variables: + event_data: '{{ trigger.event.data | default("") }}' + event_type: '{{ trigger.event.event_type | default("") }}' + event_label: '{{ event_data.event_label | default("") }}' + notification_label: '{{ event_data.label | default("") }}' + node_id: '{{ event_data.node_id | default("") }}' - data: title: ZWaveJS Event Sniffer message: 'event_type: {{ event_type }} @@ -2442,12 +2460,6 @@ action: persistent_notification.create mode: parallel initial_state: false - variables: - event_data: '{{ trigger.event.data | default("") }}' - event_type: '{{ trigger.event.event_type | default("") }}' - event_label: '{{ event_data.event_label | default("") }}' - notification_label: '{{ event_data.label | default("") }}' - node_id: '{{ event_data.node_id | default("") }}' - id: '1665696751056' alias: βš™οΈ Action Sniffer [Zigbee] description: Listen for Zigbee actions @@ -2903,36 +2915,6 @@ - wait_template: '{{ is_state(trigger.to_state.entity_id, "off") }}' timeout: 00:05:00 mode: parallel -- id: '1665723292840' - alias: "\U0001F4CB [Controller] Hue Dimmer Remote" - description: '' - use_blueprint: - path: EPMatt/philips_324131092621.yaml - input: - integration: Zigbee2MQTT - controller_entity: sensor.hue_remote_joshua_office_action - helper_last_controller_event: input_text.hue_dimmer_remote_event - helper_double_press_delay: 400 - action_button_on_short: - - data: {} - target: - entity_id: light.wled_joshua_office_desk - action: light.turn_on - action_button_off_short: - - data: {} - target: - entity_id: light.wled_joshua_office_desk - action: light.turn_off - action_button_up_short: - - data: {} - target: - entity_id: switch.joshua_office_shelf_led - action: switch.turn_on - action_button_down_short: - - data: {} - target: - entity_id: switch.joshua_office_shelf_led - action: switch.turn_off - id: '1665723372482' alias: "\U0001F4CB [Controller] Ikea Remote Main Bedroom" description: '' @@ -4142,17 +4124,17 @@ - id: '1699834405375' alias: "\U0001F4C5 Main Bedroom Fan On/Off" description: '' - trigger: - - platform: state - entity_id: schedule.main_bedroom_fan + triggers: + - entity_id: schedule.main_bedroom_fan id: 'on' to: 'on' - - platform: state - entity_id: schedule.main_bedroom_fan + trigger: state + - entity_id: schedule.main_bedroom_fan id: 'off' to: 'off' - condition: [] - action: + trigger: state + conditions: [] + actions: - choose: - conditions: - condition: trigger @@ -4167,11 +4149,11 @@ - condition: trigger id: 'off' sequence: - - action: fan.turn_on + - action: fan.turn_off target: - entity_id: fan.main_bedroom_ceiling - data: - percentage: 33 + entity_id: + - fan.main_bedroom_ceiling + data: {} mode: single - id: '1702017706466' alias: βš™οΈ Scan Interval @@ -4623,11 +4605,11 @@ alias: βš™οΈ Reload Addons and Integrations description: Reload AddOns and Integrations since they don't work after Home Assistant is restarted. - trigger: - - platform: homeassistant - event: start - condition: [] - action: + triggers: + - event: start + trigger: homeassistant + conditions: [] + actions: - metadata: {} data: addon: 45df7312_zigbee2mqtt @@ -4639,7 +4621,7 @@ device_id: - 1dee4aa37e70d346348224829cd7c84f - fd4ff1a9970156bb319e4d85d4450657 - - 046ad4016aea54916dd414935e0008da + - c72e54dada7a18b12e5d2a42cd2a94ab - 49d046eb766685131c0c5deb9f0d2250 mode: single - id: '1713385133443' @@ -5233,6 +5215,43 @@ title: Energy Tariff Changed message: '{{ message }}' mode: single +- id: '1727824341800' + alias: "\U0001F557 Main Bedroom Ceiling Fan Default Light Status" + description: Adjusts the Main Bedroom ceiling fan light status based on the time + of day. + trigger: + - platform: time + at: '20:00:00' + id: dim + - platform: time + at: 04:00:00 + id: bright + condition: [] + action: + - choose: + - conditions: + - condition: trigger + id: + - dim + sequence: + - action: script.inovelli_blue_led_set_defaults + metadata: {} + data: + entity_id: + - fan.main_bedroom_ceiling + color_on: Red + - conditions: + - condition: trigger + id: + - bright + sequence: + - action: script.inovelli_blue_led_set_defaults + metadata: {} + data: + entity_id: + - fan.main_bedroom_ceiling + color_on: Green + mode: single - id: '1728402022145' alias: ⏯ Living Room Sound Night Mode description: Changes the soundbar night mode @@ -5271,3 +5290,59 @@ target: entity_id: input_boolean.samsung_soundbar_night_mode mode: restart +- id: '1728622562146' + alias: "\U0001F4A1 School Departure Light Indicator" + description: Changes some light colors when it's time to go school. + triggers: + - at: 07:15:00 + trigger: time + conditions: + - condition: state + entity_id: cover.garage_door + state: closed + - condition: state + entity_id: binary_sensor.workday_sensor + state: 'on' + actions: + - data: + rgb_color: + - 255 + - 255 + - 0 + brightness_pct: 100 + action: light.turn_on + target: + entity_id: light.kitchen_island + - delay: + minutes: 5 + - data: + rgb_color: + - 255 + - 0 + - 0 + action: light.turn_on + target: + entity_id: light.kitchen_island + - wait_for_trigger: + - trigger: state + entity_id: + - cover.garage_door + from: open + to: closed + timeout: + hours: 0 + minutes: 10 + seconds: 0 + milliseconds: 0 + - action: light.turn_on + metadata: {} + data: + kelvin: 3000 + target: + entity_id: light.kitchen_island + - action: light.turn_on + metadata: {} + data: + flash: short + target: + entity_id: light.kitchen_island diff --git a/blueprints/automation/EPMatt/philips_324131092621.yaml b/blueprints/automation/EPMatt/philips_324131092621.yaml deleted file mode 100644 index aac7bc42..00000000 --- a/blueprints/automation/EPMatt/philips_324131092621.yaml +++ /dev/null @@ -1,731 +0,0 @@ -# Blueprint metadata -blueprint: - name: Controller - Philips 324131092621 Hue Dimmer switch - description: | - # Controller - Philips 324131092621 Hue Dimmer switch - - Controller automation for executing any kind of action triggered by the provided Philips 324131092621 Hue Dimmer switch. Allows to optionally loop an action on a button long press. - Supports deCONZ, ZHA, Zigbee2MQTT. - - Automations created with this blueprint can be connected with one or more [Hooks](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks) supported by this controller. - Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. - See the list of [Hooks available for this controller](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/philips_324131092621#available-hooks) for additional details. - - πŸ“• Full documentation regarding this blueprint is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/philips_324131092621). - - πŸš€ This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints) project**. - - ℹ️ Version 2022.08.08 - source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/philips_324131092621/philips_324131092621.yaml - domain: automation - input: - integration: - name: (Required) Integration - description: Integration used for connecting the remote with Home Assistant. Select one of the available values. - selector: - select: - options: - - deCONZ - - ZHA - - Zigbee2MQTT - controller_device: - name: (deCONZ, ZHA) Controller Device - description: The controller device to use for the automation. Choose a value only if the remote is integrated with deCONZ, ZHA. - default: '' - selector: - device: - controller_entity: - name: (Zigbee2MQTT) Controller Entity - description: The action sensor of the controller to use for the automation. Choose a value only if the remote is integrated with Zigbee2MQTT. - default: '' - selector: - entity: - domain: sensor - helper_last_controller_event: - name: (Required) Helper - Last Controller Event - description: Input Text used to store the last event fired by the controller. You will need to manually create a text input entity for this, please read the blueprint Additional Notes for more info. - default: '' - selector: - entity: - domain: input_text - # inputs for custom actions - action_button_on_short: - name: (Optional) On button short press - description: Action to run on short on button press. - default: [] - selector: - action: - action_button_on_long: - name: (Optional) On button long press - description: Action to run on long on button press. - default: [] - selector: - action: - action_button_on_release: - name: (Optional) On button release - description: Action to run on on button release after long press. - default: [] - selector: - action: - action_button_on_double: - name: (Optional) On button double press - description: Action to run on double on button press. - default: [] - selector: - action: - action_button_off_short: - name: (Optional) Off button short press - description: Action to run on short off button press. - default: [] - selector: - action: - action_button_off_long: - name: (Optional) Off button long press - description: Action to run on long off button press. - default: [] - selector: - action: - action_button_off_release: - name: (Optional) Off button release - description: Action to run on off button release after long press. - default: [] - selector: - action: - action_button_off_double: - name: (Optional) Off button double press - description: Action to run on double off button press. - default: [] - selector: - action: - action_button_up_short: - name: (Optional) Up button short press - description: Action to run on short up button press. - default: [] - selector: - action: - action_button_up_long: - name: (Optional) Up button long press - description: Action to run on long up button press. - default: [] - selector: - action: - action_button_up_release: - name: (Optional) Up button release - description: Action to run on up button release after long press. - default: [] - selector: - action: - action_button_up_double: - name: (Optional) Up button double press - description: Action to run on double up button press. - default: [] - selector: - action: - action_button_down_short: - name: (Optional) Down button short press - description: Action to run on short down button press. - default: [] - selector: - action: - action_button_down_long: - name: (Optional) Down button long press - description: Action to run on long down button press. - default: [] - selector: - action: - action_button_down_release: - name: (Optional) Down button release - description: Action to run on down button release after long press. - default: [] - selector: - action: - action_button_down_double: - name: (Optional) Down button double press - description: Action to run on double down button press. - default: [] - selector: - action: - # inputs for looping custom actions on long button press events until the corresponding release event is received - button_on_long_loop: - name: (Optional) On button long press - loop until release - description: Loop the on button action until the button is released. - default: false - selector: - boolean: - button_on_long_max_loop_repeats: - name: (Optional) On button long press - Maximum loop repeats - description: >- - Maximum number of repeats for the custom action, when looping is enabled. - Use it as a safety limit to prevent an endless loop in case the corresponding stop event is not received. - default: 500 - selector: - number: - min: 1 - max: 5000 - mode: slider - step: 1 - button_off_long_loop: - name: (Optional) Off button long press - loop until release - description: Loop the off button action until the button is released. - default: false - selector: - boolean: - button_off_long_max_loop_repeats: - name: (Optional) Off button long press - Maximum loop repeats - description: >- - Maximum number of repeats for the custom action, when looping is enabled. - Use it as a safety limit to prevent an endless loop in case the corresponding stop event is not received. - default: 500 - selector: - number: - min: 1 - max: 5000 - mode: slider - step: 1 - button_up_long_loop: - name: (Optional) Up button long press - loop until release - description: Loop the up button action until the button is released. - default: false - selector: - boolean: - button_up_long_max_loop_repeats: - name: (Optional) Up button long press - Maximum loop repeats - description: >- - Maximum number of repeats for the custom action, when looping is enabled. - Use it as a safety limit to prevent an endless loop in case the corresponding stop event is not received. - default: 500 - selector: - number: - min: 1 - max: 5000 - mode: slider - step: 1 - button_down_long_loop: - name: (Optional) Down button long press - loop until release - description: Loop the down button action until the button is released. - default: false - selector: - boolean: - button_down_long_max_loop_repeats: - name: (Optional) Down button long press - Maximum loop repeats - description: >- - Maximum number of repeats for the custom action, when looping is enabled. - Use it as a safety limit to prevent an endless loop in case the corresponding stop event is not received. - default: 500 - selector: - number: - min: 1 - max: 5000 - mode: slider - step: 1 - # inputs for enabling double press events - button_on_double_press: - name: (Optional) Expose on button double press event - description: Choose whether or not to expose the virtual double press event for the on button. Turn this on if you are providing an action for the on button double press event. - default: false - selector: - boolean: - button_off_double_press: - name: (Optional) Expose off button double press event - description: Choose whether or not to expose the virtual double press event for the off button. Turn this on if you are providing an action for the off button double press event. - default: false - selector: - boolean: - button_up_double_press: - name: (Optional) Expose up button double press event - description: Choose whether or not to expose the virtual double press event for the up button. Turn this on if you are providing an action for the up button double press event. - default: false - selector: - boolean: - button_down_double_press: - name: (Optional) Expose down button double press event - description: Choose whether or not to expose the virtual double press event for the down button. Turn this on if you are providing an action for the down button double press event. - default: false - selector: - boolean: - # helpers used to properly recognize the remote button events - helper_double_press_delay: - name: (Optional) Helper - Double Press delay - description: Max delay between the first and the second button press for the double press event. Provide a value only if you are using a double press action. Increase this value if you notice that the double press action is not triggered properly. - default: 500 - selector: - number: - min: 100 - max: 5000 - unit_of_measurement: milliseconds - mode: box - step: 10 - helper_debounce_delay: - name: (Optional) Helper - Debounce delay - description: - Delay used for debouncing RAW controller events, by default set to 0. A value of 0 disables the debouncing feature. Increase this value if you notice custom actions or linked Hooks running multiple times when interacting with the device. When the controller needs to be debounced, - usually a value of 100 is enough to remove all duplicate events. - default: 0 - selector: - number: - min: 0 - max: 1000 - unit_of_measurement: milliseconds - mode: box - step: 10 -# Automation schema -variables: - # convert input tags to variables, to be used in templates - integration: !input integration - button_on_long_loop: !input button_on_long_loop - button_on_long_max_loop_repeats: !input button_on_long_max_loop_repeats - button_on_double_press: !input button_on_double_press - button_off_long_loop: !input button_off_long_loop - button_off_long_max_loop_repeats: !input button_off_long_max_loop_repeats - button_off_double_press: !input button_off_double_press - button_up_long_loop: !input button_up_long_loop - button_up_long_max_loop_repeats: !input button_up_long_max_loop_repeats - button_up_double_press: !input button_up_double_press - button_down_long_loop: !input button_down_long_loop - button_down_long_max_loop_repeats: !input button_down_long_max_loop_repeats - button_down_double_press: !input button_down_double_press - helper_last_controller_event: !input helper_last_controller_event - helper_double_press_delay: !input helper_double_press_delay - helper_debounce_delay: !input helper_debounce_delay - # integration id used to select items in the action mapping - integration_id: '{{ integration | lower }}' - # adjusted debounce delay so that the resulting double press delay is exactly as specified by the user when running the action, taking also account of debouncing - # make sure it never goes below the minimum double press delay - adjusted_double_press_delay: '{{ [helper_double_press_delay - helper_debounce_delay, 100] | max }}' - # mapping between actions and integrations - actions_mapping: - deconz: - button_on_short: ['1000'] - button_on_long: ['1001'] - button_on_release: ['1003'] - button_off_short: ['4000'] - button_off_long: ['4001'] - button_off_release: ['4003'] - button_up_short: ['2000'] - button_up_long: ['2001'] - button_up_release: ['2003'] - button_down_short: ['3000'] - button_down_long: ['3001'] - button_down_release: ['3003'] - zha: - button_on_short: [on_short_release] - button_on_long: [on_hold] - button_on_release: [on_long_release] - button_off_short: [off_short_release] - button_off_long: [off_hold] - button_off_release: [off_long_release] - button_up_short: [up_short_release] - button_up_long: [up_hold] - button_up_release: [up_long_release] - button_down_short: [down_short_release] - button_down_long: [down_hold] - button_down_release: [down_long_release] - zigbee2mqtt: - button_on_short: [on_press] - button_on_long: [on_hold] - button_on_release: [on_hold_release] - button_off_short: [off_press] - button_off_long: [off_hold] - button_off_release: [off_hold_release] - button_up_short: [up_press] - button_up_long: [up_hold] - button_up_release: [up_hold_release] - button_down_short: [down_press] - button_down_long: [down_hold] - button_down_release: [down_hold_release] - # pre-choose actions for buttons based on configured integration - # no need to perform this task at automation runtime - button_on_short: '{{ actions_mapping[integration_id]["button_on_short"] }}' - button_on_long: '{{ actions_mapping[integration_id]["button_on_long"] }}' - button_on_release: '{{ actions_mapping[integration_id]["button_on_release"] }}' - button_off_short: '{{ actions_mapping[integration_id]["button_off_short"] }}' - button_off_long: '{{ actions_mapping[integration_id]["button_off_long"] }}' - button_off_release: '{{ actions_mapping[integration_id]["button_off_release"] }}' - button_up_short: '{{ actions_mapping[integration_id]["button_up_short"] }}' - button_up_long: '{{ actions_mapping[integration_id]["button_up_long"] }}' - button_up_release: '{{ actions_mapping[integration_id]["button_up_release"] }}' - button_down_short: '{{ actions_mapping[integration_id]["button_down_short"] }}' - button_down_long: '{{ actions_mapping[integration_id]["button_down_long"] }}' - button_down_release: '{{ actions_mapping[integration_id]["button_down_release"] }}' - # build data to send within a controller event - controller_entity: !input controller_entity - controller_device: !input controller_device - controller_id: '{% if integration_id=="zigbee2mqtt" %}{{controller_entity}}{% else %}{{controller_device}}{% endif %}' -mode: restart -max_exceeded: silent -trigger: - # trigger for zigbee2mqtt - - platform: event - event_type: state_changed - event_data: - entity_id: !input controller_entity - # trigger for other integrations - - platform: event - event_type: - - deconz_event - - zha_event - event_data: - device_id: !input controller_device -condition: - - condition: and - conditions: - # check that the button event is not empty - - >- - {%- set trigger_action -%} - {%- if integration_id == "zigbee2mqtt" -%} - {{ trigger.event.data.new_state.state }} - {%- elif integration_id == "deconz" -%} - {{ trigger.event.data.event }} - {%- elif integration_id == "zha" -%} - {{ trigger.event.data.command }} - {%- endif -%} - {%- endset -%} - {{ trigger_action not in ["","None"] }} - # only for zigbee2mqtt, check if the event is relative to a real state change, and not only some minor changes in the sensor attributes - # this is required since multiple state_changed events are fired for a single button press, with the result of the automation being triggered multiple times - - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state }}' -action: - # debouncing - when automation is triggered multiple times, the last automation run is the one which completes execution, due to mode restart - # therefore previous runs must wait for the debounce delay before executing any other action - # if the delay expires and the automation is still running it means it's the last run and execution can continue - - delay: - milliseconds: !input helper_debounce_delay - # extract button event from the trigger - # provide a single string value to check against - - variables: - trigger_action: >- - {%- if integration_id == "zigbee2mqtt" -%} - {{ trigger.event.data.new_state.state }} - {%- elif integration_id == "deconz" -%} - {{ trigger.event.data.event }} - {%- elif integration_id == "zha" -%} - {{ trigger.event.data.command }} - {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' - # update helper - - service: input_text.set_value - data: - entity_id: !input helper_last_controller_event - value: '{{ {"a":trigger_action,"t":as_timestamp(now())} | to_json }}' - # choose the sequence to run based on the received button event - - choose: - - conditions: '{{ trigger_action | string in button_on_short }}' - sequence: - - choose: - # if double press event is enabled - - conditions: '{{ button_on_double_press }}' - sequence: - - choose: - # if previous event was a short press - - conditions: '{{ trigger_action | string in states(helper_last_controller_event) and trigger_delta | int <= helper_double_press_delay | int }}' - sequence: - # store the double press event in the last controller event helper - - service: input_text.set_value - data: - entity_id: !input helper_last_controller_event - value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' - # run the double press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_on_double - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_on_double - # previous event was not a short press - default: - # wait for the double press event to occur, within the provided delay - # if the second press is received, automation is restarted - - delay: - milliseconds: '{{ adjusted_double_press_delay }}' - # if delay expires, no second press was received, therefore run the short press action - # run the short press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_on_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_on_short - # if double press event is disabled run the action for the single short press - default: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_on_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_on_short - - conditions: '{{ trigger_action | string in button_on_long }}' - sequence: - # fire the event only once before looping the action - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_on_long - - choose: - # if looping is enabled, loop the action for a finite number of iterations - - conditions: '{{ button_on_long_loop }}' - sequence: - - repeat: - while: '{{ repeat.index < button_on_long_max_loop_repeats | int }}' - sequence: !input action_button_on_long - # if looping is not enabled run the custom action only once - default: !input action_button_on_long - - conditions: '{{ trigger_action | string in button_on_release }}' - sequence: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_on_release - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_on_release - - conditions: '{{ trigger_action | string in button_off_short }}' - sequence: - - choose: - # if double press event is enabled - - conditions: '{{ button_off_double_press }}' - sequence: - - choose: - # if previous event was a short press - - conditions: '{{ trigger_action | string in states(helper_last_controller_event) and trigger_delta | int <= helper_double_press_delay | int }}' - sequence: - # store the double press event in the last controller event helper - - service: input_text.set_value - data: - entity_id: !input helper_last_controller_event - value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' - # run the double press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_off_double - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_off_double - # previous event was not a short press - default: - # wait for the double press event to occur, within the provided delay - # if the second press is received, automation is restarted - - delay: - milliseconds: '{{ adjusted_double_press_delay }}' - # if delay expires, no second press was received, therefore run the short press action - # run the short press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_off_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_off_short - # if double press event is disabled run the action for the single short press - default: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_off_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_off_short - - conditions: '{{ trigger_action | string in button_off_long }}' - sequence: - # fire the event only once before looping the action - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_off_long - - choose: - # if looping is enabled, loop the action for a finite number of iterations - - conditions: '{{ button_off_long_loop }}' - sequence: - - repeat: - while: '{{ repeat.index < button_off_long_max_loop_repeats | int }}' - sequence: !input action_button_off_long - # if looping is not enabled run the custom action only once - default: !input action_button_off_long - - conditions: '{{ trigger_action | string in button_off_release }}' - sequence: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_off_release - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_off_release - - conditions: '{{ trigger_action | string in button_up_short }}' - sequence: - - choose: - # if double press event is enabled - - conditions: '{{ button_up_double_press }}' - sequence: - - choose: - # if previous event was a short press - - conditions: '{{ trigger_action | string in states(helper_last_controller_event) and trigger_delta | int <= helper_double_press_delay | int }}' - sequence: - # store the double press event in the last controller event helper - - service: input_text.set_value - data: - entity_id: !input helper_last_controller_event - value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' - # run the double press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_up_double - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_up_double - # previous event was not a short press - default: - # wait for the double press event to occur, within the provided delay - # if the second press is received, automation is restarted - - delay: - milliseconds: '{{ adjusted_double_press_delay }}' - # if delay expires, no second press was received, therefore run the short press action - # run the short press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_up_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_up_short - # if double press event is disabled run the action for the single short press - default: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_up_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_up_short - - conditions: '{{ trigger_action | string in button_up_long }}' - sequence: - # fire the event only once before looping the action - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_up_long - - choose: - # if looping is enabled, loop the action for a finite number of iterations - - conditions: '{{ button_up_long_loop }}' - sequence: - - repeat: - while: '{{ repeat.index < button_up_long_max_loop_repeats | int }}' - sequence: !input action_button_up_long - # if looping is not enabled run the custom action only once - default: !input action_button_up_long - - conditions: '{{ trigger_action | string in button_up_release }}' - sequence: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_up_release - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_up_release - - conditions: '{{ trigger_action | string in button_down_short }}' - sequence: - - choose: - # if double press event is enabled - - conditions: '{{ button_down_double_press }}' - sequence: - - choose: - # if previous event was a short press - - conditions: '{{ trigger_action | string in states(helper_last_controller_event) and trigger_delta | int <= helper_double_press_delay | int }}' - sequence: - # store the double press event in the last controller event helper - - service: input_text.set_value - data: - entity_id: !input helper_last_controller_event - value: '{{ {"a":"double_press","t":as_timestamp(now())} | to_json }}' - # run the double press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_down_double - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_down_double - # previous event was not a short press - default: - # wait for the double press event to occur, within the provided delay - # if the second press is received, automation is restarted - - delay: - milliseconds: '{{ adjusted_double_press_delay }}' - # if delay expires, no second press was received, therefore run the short press action - # run the short press action - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_down_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_down_short - # if double press event is disabled run the action for the single short press - default: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_down_short - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_down_short - - conditions: '{{ trigger_action | string in button_down_long }}' - sequence: - # fire the event only once before looping the action - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_down_long - - choose: - # if looping is enabled, loop the action for a finite number of iterations - - conditions: '{{ button_down_long_loop }}' - sequence: - - repeat: - while: '{{ repeat.index < button_down_long_max_loop_repeats | int }}' - sequence: !input action_button_down_long - # if looping is not enabled run the custom action only once - default: !input action_button_down_long - - conditions: '{{ trigger_action | string in button_down_release }}' - sequence: - # fire the event - - event: ahb_controller_event - event_data: - controller: '{{ controller_id }}' - action: button_down_release - # run the custom action - - choose: - - conditions: [] - sequence: !input action_button_down_release diff --git a/blueprints/script/zanix/inovelli_blue_led_zigbee2mqtt.yaml b/blueprints/script/zanix/inovelli_blue_led_zigbee2mqtt.yaml index f215e859..a4aa755c 100644 --- a/blueprints/script/zanix/inovelli_blue_led_zigbee2mqtt.yaml +++ b/blueprints/script/zanix/inovelli_blue_led_zigbee2mqtt.yaml @@ -3,7 +3,7 @@ blueprint: description: | Set LED effects for Inovelli Blue Series Switches using Zigbee2MQTT. - ℹ️ Version: 2024.8.0 + ℹ️ Version: 2024.10.0 To update this blueprint, read [Re-importing a blueprint](https://www.home-assistant.io/docs/automation/using_blueprints/#re-importing-a-blueprint) @@ -388,6 +388,27 @@ variables: {% endif %} {# Detect switches #} {% for label in labels.labels %} + {# Parse areas #} + {% for area in label_areas(label) %} + {% for ent in area_entities(area) %} + {% for model in models %} + {% if model in device_attr(ent, 'model') | default('', true) and ent.split('.')[0] in domains %} + {% set switch.entities = switch.entities + [ent|string|trim] %} + {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} + {# Parse devices #} + {% for device in label_devices(label) %} + {% for ent in device_entities(device) %} + {% for model in models %} + {% if model in device_attr(ent, 'model') | default('', true) and ent.split('.')[0] in domains %} + {% set switch.entities = switch.entities + [ent|string|trim] %} + {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} + {# Parse entities #} {% for ent in label_entities(label) %} {% for model in models %} {% if model in device_attr(ent, 'model') | default('', true) and ent.split('.')[0] in domains %} @@ -630,7 +651,7 @@ sequence: service: mqtt.publish data: topic: '{{ command_path }}' - payload: "{{ payload }}" + payload: '{{ payload }}' icon: mdi:led-on mode: parallel diff --git a/lovelace/dashboards/floorplan.yaml b/lovelace/dashboards/floorplan.yaml index e52fe2d0..868fd73e 100644 --- a/lovelace/dashboards/floorplan.yaml +++ b/lovelace/dashboards/floorplan.yaml @@ -199,7 +199,7 @@ views: - name: Weather entities: - - sensor.owm_daily_temperature + - sensor.ecowitt_outdoor_temperature state_action: - service: floorplan.text_set service_data: '${entity.state ? Math.round(entity.state) + "Β°F" : "undefined"}' diff --git a/scripts.yaml b/scripts.yaml index 86015fd9..26608c49 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -341,6 +341,14 @@ kona_remote_start: - data: duration: 10 device_id: f27d2038fd3fe30bc627505de54ddea8 + climate: true + temperature: 70 + heating: '0' + defrost: false + flseat: '0' + frseat: '0' + rlseat: '0' + rrseat: '0' action: kia_uvo.start_climate description: Starts the Kona and opens the garage door. icon: fapro:hyundai diff --git a/www/floorplan/floorplan.svg b/www/floorplan/floorplan.svg index 61700406..3c6ec6b2 100644 --- a/www/floorplan/floorplan.svg +++ b/www/floorplan/floorplan.svg @@ -2320,9 +2320,9 @@ xml:space="preserve">00Β°F