From 1bb5b7d1269ab1409b9e8daed73e682b21bc237e Mon Sep 17 00:00:00 2001 From: Andrew Neisch Date: Mon, 29 Jul 2024 22:38:43 -0500 Subject: [PATCH] Changes --- README.md | 28 +-- automations.yaml | 185 ++++++++++++--- configuration.yaml | 2 +- .../alexa_media/.translations/de.json | 13 +- .../alexa_media/.translations/en.json | 13 +- .../alexa_media/.translations/it.json | 13 +- .../alexa_media/.translations/nl.json | 13 +- .../alexa_media/.translations/pl.json | 13 +- custom_components/alexa_media/__init__.py | 89 ++++--- .../alexa_media/alarm_control_panel.py | 1 + custom_components/alexa_media/alexa_entity.py | 16 +- custom_components/alexa_media/config_flow.py | 218 +++++++++++++----- custom_components/alexa_media/const.py | 7 +- custom_components/alexa_media/helpers.py | 1 + custom_components/alexa_media/light.py | 11 +- custom_components/alexa_media/manifest.json | 2 +- custom_components/alexa_media/media_player.py | 46 ++-- custom_components/alexa_media/notify.py | 1 + custom_components/alexa_media/sensor.py | 32 ++- custom_components/alexa_media/services.yaml | 17 -- custom_components/alexa_media/strings.json | 39 ++-- custom_components/alexa_media/switch.py | 8 +- .../alexa_media/translations/ar.json | 13 +- .../alexa_media/translations/de.json | 13 +- .../alexa_media/translations/en.json | 13 +- .../alexa_media/translations/es.json | 13 +- .../alexa_media/translations/fr.json | 13 +- .../alexa_media/translations/it.json | 13 +- .../alexa_media/translations/nb.json | 13 +- .../alexa_media/translations/nl.json | 13 +- .../alexa_media/translations/pl.json | 13 +- .../alexa_media/translations/pt-BR.json | 13 +- .../alexa_media/translations/pt.json | 13 +- .../alexa_media/translations/ru.json | 13 +- .../alexa_media/translations/zh-Hans.json | 13 +- custom_components/dahua/__init__.py | 12 +- custom_components/dahua/light.py | 5 +- custom_components/dahua/manifest.json | 2 +- custom_components/frigate/manifest.json | 2 +- custom_components/frigate/views.py | 7 + extras/Node-RED/flows.json | 2 +- extras/appdaemon/apps/apps.yaml | 4 +- extras/cloudflared/config.yml | 4 +- .../docker-compose/other/docker-compose.yml | 7 +- .../docker-compose/unified/docker-compose.yml | 7 +- extras/esphome/coffee_maker.yaml | 134 +++++++++-- extras/esphome/water_meter_s3.yaml | 11 +- images/nodered_1.png | Bin 33020 -> 33020 bytes images/nodered_2.png | Bin 35258 -> 35258 bytes packages/frigate.yaml | 136 +++++++---- packages/leak_detection.yaml | 28 +-- packages/zoom.yaml | 4 +- scripts.yaml | 67 +++++- template.yaml | 28 ++- ui-lovelace/.cards/thermostat.yaml | 2 - ui-lovelace/03-common.yaml | 43 ++-- ui-lovelace/13-tablet.yaml | 31 +-- www/community/lovelace-wallpanel/wallpanel.js | 27 ++- .../lovelace-wallpanel/wallpanel.js.gz | Bin 27823 -> 27849 bytes .../xiaomi-vacuum-map-card.js | 4 +- .../xiaomi-vacuum-map-card.js.gz | Bin 95272 -> 95312 bytes 61 files changed, 1102 insertions(+), 402 deletions(-) diff --git a/README.md b/README.md index 3da036f3..49b02e5c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://github.com/aneisch/home-assistant-config/actions/workflows/check-ha-release-compatibility.yml/badge.svg)](https://github.com/aneisch/home-assistant-config/actions) [![GitHub last commit](https://img.shields.io/github/last-commit/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/commits/master) [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/graphs/commit-activity) -[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.7.2%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest) +[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.7.3%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
Buy Me A Coffee I do my best to keep [Home Assistant](https://github.com/home-assistant/home-assistant) on the [latest release](https://github.com/home-assistant/home-assistant/releases/latest). I'm heavily utilizing [AppDaemon](http://appdaemon.readthedocs.io/en/latest/) and [NodeRed](https://flows.nodered.org/node/node-red-contrib-home-assistant-websocket) for advanced/templated automations. See [Appdaemon config](https://github.com/aneisch/home-assistant-config/tree/master/extras/appdaemon) and my NodeRed screenshots below for details. Most of my setup is run as Docker containers (see [docker-compose](https://github.com/aneisch/home-assistant-config/tree/master/extras/docker-compose) for container list). @@ -58,18 +58,18 @@ Home Assistant and other containers have ingress handled automatically by [Traef ## Some statistics about my installation: Description | value -- | -- -Lines of ESPHome YAML | 3157 -Lines of Home Assistant YAML | 9391 +Lines of ESPHome YAML | 3250 +Lines of Home Assistant YAML | 9631 [Integrations](https://www.home-assistant.io/integrations/) in use | 62 Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26 Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37 Description | value -- | -- -Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 125 -Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 156 -Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 36 -Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 15 +Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 127 +Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 157 +Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 45 +Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 16 Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1 Entities in the [`conversation`](https://www.home-assistant.io/components/conversation) domain | 2 Entities in the [`counter`](https://www.home-assistant.io/components/counter) domain | 1 @@ -79,7 +79,7 @@ Entities in the [`device_tracker`](https://www.home-assistant.io/components/devi Entities in the [`event`](https://www.home-assistant.io/components/event) domain | 14 Entities in the [`fan`](https://www.home-assistant.io/components/fan) domain | 3 Entities in the [`group`](https://www.home-assistant.io/components/group) domain | 19 -Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 7 +Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 8 Entities in the [`input_boolean`](https://www.home-assistant.io/components/input_boolean) domain | 30 Entities in the [`input_datetime`](https://www.home-assistant.io/components/input_datetime) domain | 32 Entities in the [`input_number`](https://www.home-assistant.io/components/input_number) domain | 6 @@ -88,23 +88,25 @@ Entities in the [`input_text`](https://www.home-assistant.io/components/input_te Entities in the [`light`](https://www.home-assistant.io/components/light) domain | 39 Entities in the [`lock`](https://www.home-assistant.io/components/lock) domain | 4 Entities in the [`media_player`](https://www.home-assistant.io/components/media_player) domain | 18 -Entities in the [`number`](https://www.home-assistant.io/components/number) domain | 12 +Entities in the [`notify`](https://www.home-assistant.io/components/notify) domain | 2 +Entities in the [`number`](https://www.home-assistant.io/components/number) domain | 15 Entities in the [`person`](https://www.home-assistant.io/components/person) domain | 2 Entities in the [`plant`](https://www.home-assistant.io/components/plant) domain | 1 Entities in the [`remote`](https://www.home-assistant.io/components/remote) domain | 4 -Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 48 +Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 50 Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 4 -Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 516 +Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 517 +Entities in the [`setter`](https://www.home-assistant.io/components/setter) domain | 1 Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1 Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1 -Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 178 +Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 179 Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 6 Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1 Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 35 Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1 Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 1 Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 6 -**Total state objects** | **1386** +**Total state objects** | **1410** ## The HACS integrations/plugins that I use: **Appdaemon**:
diff --git a/automations.yaml b/automations.yaml index dee08917..08cb9c56 100644 --- a/automations.yaml +++ b/automations.yaml @@ -183,12 +183,19 @@ from: 'off' to: 'on' action: - - service: input_datetime.set_datetime - data: - entity_id: input_datetime.{{trigger.entity_id | regex_replace(find='binary_sensor.', - replace='') | regex_replace(find='input_boolean.', replace='') | regex_replace(find='sensor.', - replace='') }}_last - datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}' + - if: '{{ trigger.entity_id == ''binary_sensor.garage_person_occupancy'' }}' + then: + - service: input_datetime.set_datetime + data: + entity_id: input_datetime.garage_motion_last + datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}' + else: + - service: input_datetime.set_datetime + data: + entity_id: input_datetime.{{trigger.entity_id | regex_replace(find='binary_sensor.', + replace='') | regex_replace(find='input_boolean.', replace='') | regex_replace(find='sensor.', + replace='') }}_last + datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}' - alias: Door Lock Alerts id: door_lock_alerts initial_state: true @@ -797,52 +804,129 @@ message: 'Home Assistant v{{ states(''sensor.ha_version'')}} has started! ' -- alias: Coffee Maker on With Alarm Clock - id: coffee_maker_alarm_clock - initial_state: true +- id: coffee_maker_alarm_clock + alias: Coffee Maker on With Alarm Clock trigger: - platform: state entity_id: sensor.andrew_phone_last_notification attribute: channel_id to: Firing + id: alarm + alias: Phone Alarm + - platform: event + id: respond + event_type: mobile_app_notification_action + event_data: + action: confirm_coffee_on + alias: Mobile Notification Response + - alias: Mobile Notification Response + platform: event + id: make + event_type: mobile_app_notification_action + event_data: + action: confirm_make_latte condition: - condition: and + - condition: and conditions: - - '{{ states(''binary_sensor.workday_sensor'') == ''on'' }}' - - '{{ states(''person.andrew'') == ''home'' }}' + - condition: template + value_template: '{{ states(''binary_sensor.workday_sensor'') == ''on'' }}' + alias: Workday? + enabled: false - condition: time after: 05:30:00 - before: 09:45:00 - - '{{ states(''sensor.andrew_phone_charger_type'') != ''none'' }}' + before: '10:00:00' + enabled: true + alias: Morning? + - condition: template + value_template: '{{ states(''person.andrew'') == ''home'' }}' + alias: Andrew Home? action: - - wait_template: '{{ is_state(''sensor.andrew_phone_charger_type'', ''none'') }}' - timeout: 00:05:00 - - service: switch.turn_on - entity_id: switch.coffee_maker - - service: switch.turn_on - entity_id: switch.under_cabinet_lights_coffee - - wait_template: '{{ is_state(''switch.under_cabinet_lights_coffee'', ''off'') }}' - timeout: 00:20:00 - if: - - '{{ wait.completed }}' + - condition: trigger + id: + - alarm then: - - service: switch.turn_off - entity_id: switch.coffee_maker -- alias: Coffee Maker Off - id: coffee_maker_off + - wait_template: '{{ is_state(''sensor.andrew_phone_charger_type'', ''none'') + }}' + timeout: 00:05:00 + - service: notify.mobile_app_andrew_phone + data: + message: Turn on Coffee Maker? + data: + persistent: true + tag: persistent + actions: + - action: confirm_coffee_on + title: 'Yes' + - action: ignore_coffee_on + title: 'No' + alias: Send Notification + - alias: Turn on Coffee Maker + if: + - condition: trigger + id: + - respond + then: + - service: switch.turn_on + data: {} + target: + entity_id: switch.coffee_maker_power_with_cleaning + alias: Turn on Coffee Maker + - wait_for_trigger: + - platform: state + entity_id: + - sensor.coffee_maker_status + to: Idle + for: + hours: 0 + minutes: 1 + seconds: 0 + timeout: + hours: 0 + minutes: 2 + seconds: 0 + milliseconds: 0 + alias: Wait For Idle Status + - service: notify.mobile_app_andrew_phone + data: + message: Make Double Latte? + data: + persistent: true + tag: persistent + actions: + - action: confirm_make_latte + title: 'Yes' + - action: ignore_make_latte + title: 'No' + alias: Send Make Late Question + - alias: Make Double Latte + if: + - condition: trigger + id: + - make + then: + - service: script.andrew_double_latte + data: {} initial_state: true +- id: coffee_maker_off + alias: Coffee Maker Off trigger: - platform: time at: '10:00:00' - condition: '{{ states(''switch.coffee_maker'') == ''on'' }}' + condition: + - condition: template + value_template: '{{ states(''switch.coffee_maker'') == ''on'' }}' action: - service: switch.turn_off - entity_id: switch.coffee_maker + data: {} + target: + entity_id: switch.coffee_maker_power_without_cleaning - service: notify.signal_homeassistant data: message: 'Turned coffee maker off! ' + initial_state: true - alias: Turn off AC Fan id: turn_off_ac_fan trigger: @@ -1095,3 +1179,46 @@ - cover.master_bedroom_blind_left - cover.master_bedroom_blind_right automation_mode: restart +- id: '1722280146692' + alias: Reset Master Bathroom Motion + description: '' + trigger: + - platform: state + entity_id: + - binary_sensor.433_motion_master_bathroom + to: 'on' + for: + hours: 0 + minutes: 1 + seconds: 0 + condition: [] + action: + - service: setter.set + data: + entity_id: binary_sensor.433_motion_master_bathroom + state: 'off' + attributes: + device_class: motion + friendly_name: 433 Motion Master Bathroom + mode: single +- id: '1722300479686' + alias: Turn off Master Bathroom Lights + description: '' + trigger: + - platform: state + entity_id: + - binary_sensor.433_motion_master_bathroom + to: 'off' + for: + hours: 0 + minutes: 30 + seconds: 0 + condition: [] + action: + - service: switch.turn_off + target: + entity_id: + - switch.master_bathroom_light_main + - switch.master_bathroom_light_secondary + data: {} + mode: single diff --git a/configuration.yaml b/configuration.yaml index f128af60..fe5107f3 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -518,7 +518,7 @@ scene: !include scene.yaml script: !include scripts.yaml -#setter: +setter: sensor: !include sensors.yaml diff --git a/custom_components/alexa_media/.translations/de.json b/custom_components/alexa_media/.translations/de.json index 1c50b00b..9e830f1e 100644 --- a/custom_components/alexa_media/.translations/de.json +++ b/custom_components/alexa_media/.translations/de.json @@ -34,10 +34,12 @@ "debug": "Erweitertes Debugging", "email": "E-Mail-Adresse", "exclude_devices": "Ausgeschlossene Geräte (Komma getrennt)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Home Assistant-URL", "include_devices": "Eingebundene Geräte (Komma getrennt)", "otp_secret": "Integrierter 2FA-App-Schlüssel (automatisch generierte 2FA-Code)", "password": "Passwort", + "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen", "scan_interval": "Sekunden zwischen den Scans", "securitycode": "2FA-Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B. amazon.de)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Erweitertes Debugging", + "exclude_devices": "Ausgeschlossene Geräte (Komma getrennt)", "extended_entity_discovery": "Schließen Sie Geräte ein, die über Echo verbunden sind", + "hass_url": "Öffentliche URL zum Zugriff auf Home Assistant (einschließlich '/' am Ende)", + "include_devices": "Eingebundene Geräte (Komma getrennt)", "public_url": "Öffentliche URL zum Zugriff auf Home Assistant (einschließlich '/' am Ende)", - "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen" - } + "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen", + "scan_interval": "Sekunden zwischen den Scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/.translations/en.json b/custom_components/alexa_media/.translations/en.json index 963267f4..610cb82c 100644 --- a/custom_components/alexa_media/.translations/en.json +++ b/custom_components/alexa_media/.translations/en.json @@ -34,10 +34,12 @@ "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes). This is not six digits long.", "password": "Password", + "queue_delay": "Seconds to wait to queue commands together", "scan_interval": "Seconds between scans", "securitycode": "[%key_id:55616596%]", "url": "Amazon region domain (e.g., amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Advanced debugging", + "exclude_devices": "Excluded device (comma separated)", "extended_entity_discovery": "Include devices connected via Echo", + "hass_url": "Public URL to access Home Assistant (including trailing '/')", + "include_devices": "Included device (comma separated)", "public_url": "Public URL to access Home Assistant (including trailing '/')", - "queue_delay": "Seconds to wait to queue commands together" - } + "queue_delay": "Seconds to wait to queue commands together", + "scan_interval": "Seconds between scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/.translations/it.json b/custom_components/alexa_media/.translations/it.json index 921ca71f..ab3df8e7 100644 --- a/custom_components/alexa_media/.translations/it.json +++ b/custom_components/alexa_media/.translations/it.json @@ -34,10 +34,12 @@ "debug": "Debug avanzato", "email": "Indirizzo email", "exclude_devices": "Dispositivi da escludere (separati da virgola)", + "extended_entity_discovery": "Includi dispositivi collegati tramite Echo", "hass_url": "URL per accedere a Home Assistant", "include_devices": "Dispositivi da includere (separati da virgola)", "otp_secret": "Chiave app 2FA integrata (genera automaticamente codici 2FA). Questo non è lungo sei cifre.", "password": "Password", + "queue_delay": "Secondi di attesa per accodare i comandi insieme", "scan_interval": "Tempo in secondi fra le scansioni", "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", "url": "Regione del dominio Amazon (ad es., amazon.it)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Debug avanzato", + "exclude_devices": "Dispositivi da escludere (separati da virgola)", "extended_entity_discovery": "Includi i dispositivi collegati tramite Echo", + "hass_url": "URL pubblico per accedere a Home Assistant (incluso il '/' finale)", + "include_devices": "Dispositivi da includere (separati da virgola)", "public_url": "URL pubblico per accedere a Home Assistant (incluso il '/' finale)", - "queue_delay": "Secondi di attesa per accodare i comandi insieme" - } + "queue_delay": "Secondi di attesa per accodare i comandi insieme", + "scan_interval": "Tempo in secondi fra le scansioni" + }, + "description": "Necessario *", + "title": "Alexa Media Player - Riconfigurazione" } } }, diff --git a/custom_components/alexa_media/.translations/nl.json b/custom_components/alexa_media/.translations/nl.json index efd7ce85..9809c51c 100644 --- a/custom_components/alexa_media/.translations/nl.json +++ b/custom_components/alexa_media/.translations/nl.json @@ -34,10 +34,12 @@ "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", "password": "Paswoord", + "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen", "scan_interval": "Aantal seconden tussen scans", "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Geavanceerd debuggen", + "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", "extended_entity_discovery": "Inclusief apparaten die zijn verbonden via Echo", + "hass_url": "Openbare URL om toegang te krijgen tot Home Assistant (inclusief afsluitende '/')", + "include_devices": "Apparaten toevoegen (Scheiding: komma)", "public_url": "Openbare URL om toegang te krijgen tot Home Assistant (inclusief afsluitende '/')", - "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen" - } + "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen", + "scan_interval": "Aantal seconden tussen scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/.translations/pl.json b/custom_components/alexa_media/.translations/pl.json index 8d653ffd..bd51a9da 100644 --- a/custom_components/alexa_media/.translations/pl.json +++ b/custom_components/alexa_media/.translations/pl.json @@ -34,10 +34,12 @@ "debug": "Zaawansowane debugowanie", "email": "Adres e-mail", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", + "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń", "scan_interval": "Interwał skanowania (sekundy)", "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", "url": "Region/domena Amazon (np. amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Zaawansowane debugowanie", + "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", "extended_entity_discovery": "Uwzględnij urządzenia podłączone przez Echo", + "hass_url": "Publiczny URL do dostępu do Home Assistant (z końcowym '/')", + "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "public_url": "Publiczny URL do dostępu do Home Assistant (z końcowym '/')", - "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń" - } + "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń", + "scan_interval": "Interwał skanowania (sekundy)" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/__init__.py b/custom_components/alexa_media/__init__.py index 7023b3a9..67e3c4de 100644 --- a/custom_components/alexa_media/__init__.py +++ b/custom_components/alexa_media/__init__.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import asyncio from datetime import datetime, timedelta from json import JSONDecodeError, loads @@ -64,6 +65,7 @@ DEFAULT_EXTENDED_ENTITY_DISCOVERY, DEFAULT_PUBLIC_URL, DEFAULT_QUEUE_DELAY, + DEFAULT_SCAN_INTERVAL, DEPENDENT_ALEXA_COMPONENTS, DOMAIN, ISSUE_URL, @@ -89,7 +91,6 @@ vol.Required(CONF_EMAIL): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_URL): cv.string, - vol.Optional(CONF_DEBUG, default=False): cv.boolean, vol.Optional(CONF_INCLUDE_DEVICES, default=[]): vol.All( cv.ensure_list, [cv.string] ), @@ -97,6 +98,9 @@ cv.ensure_list, [cv.string] ), vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL): cv.time_period, + vol.Optional(CONF_QUEUE_DELAY, default=DEFAULT_QUEUE_DELAY): cv.positive_float, + vol.Optional(CONF_EXTENDED_ENTITY_DISCOVERY, default=False): cv.boolean, + vol.Optional(CONF_DEBUG, default=False): cv.boolean, } ) @@ -145,18 +149,22 @@ async def async_setup(hass, config, discovery_info=None): CONF_EMAIL: account[CONF_EMAIL], CONF_PASSWORD: account[CONF_PASSWORD], CONF_URL: account[CONF_URL], - CONF_DEBUG: account[CONF_DEBUG], CONF_INCLUDE_DEVICES: account[CONF_INCLUDE_DEVICES], CONF_EXCLUDE_DEVICES: account[CONF_EXCLUDE_DEVICES], CONF_SCAN_INTERVAL: account[ CONF_SCAN_INTERVAL ].total_seconds(), + CONF_QUEUE_DELAY: account[CONF_QUEUE_DELAY], CONF_OAUTH: account.get( CONF_OAUTH, entry.data.get(CONF_OAUTH, {}) ), CONF_OTPSECRET: account.get( CONF_OTPSECRET, entry.data.get(CONF_OTPSECRET, "") ), + CONF_EXTENDED_ENTITY_DISCOVERY: account[ + CONF_EXTENDED_ENTITY_DISCOVERY + ], + CONF_DEBUG: account[CONF_DEBUG], }, ) entry_found = True @@ -171,12 +179,16 @@ async def async_setup(hass, config, discovery_info=None): CONF_EMAIL: account[CONF_EMAIL], CONF_PASSWORD: account[CONF_PASSWORD], CONF_URL: account[CONF_URL], - CONF_DEBUG: account[CONF_DEBUG], CONF_INCLUDE_DEVICES: account[CONF_INCLUDE_DEVICES], CONF_EXCLUDE_DEVICES: account[CONF_EXCLUDE_DEVICES], CONF_SCAN_INTERVAL: account[CONF_SCAN_INTERVAL].total_seconds(), + CONF_QUEUE_DELAY: account[CONF_QUEUE_DELAY], CONF_OAUTH: account.get(CONF_OAUTH, {}), CONF_OTPSECRET: account.get(CONF_OTPSECRET, ""), + CONF_EXTENDED_ENTITY_DISCOVERY: account[ + CONF_EXTENDED_ENTITY_DISCOVERY + ], + CONF_DEBUG: account[CONF_DEBUG], }, ) ) @@ -243,8 +255,8 @@ async def login_success(event=None) -> None: await setup_alexa(hass, config_entry, login_obj) if not hass.data.get(DATA_ALEXAMEDIA): - _LOGGER.info(STARTUP) - _LOGGER.info("Loaded alexapy==%s", alexapy_version) + _LOGGER.debug(STARTUP) + _LOGGER.debug("Loaded alexapy==%s", alexapy_version) hass.data.setdefault( DATA_ALEXAMEDIA, {"accounts": {}, "config_flows": {}, "notify_service": None} ) @@ -292,15 +304,21 @@ async def login_success(event=None) -> None: "second_account_index": 0, "should_get_network": True, "options": { - CONF_QUEUE_DELAY: config_entry.options.get( + CONF_INCLUDE_DEVICES: config_entry.data.get(CONF_INCLUDE_DEVICES, ""), + CONF_EXCLUDE_DEVICES: config_entry.data.get(CONF_EXCLUDE_DEVICES, ""), + CONF_QUEUE_DELAY: config_entry.data.get( CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY ), - CONF_PUBLIC_URL: config_entry.options.get( + CONF_SCAN_INTERVAL: config_entry.data.get( + CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL + ), + CONF_PUBLIC_URL: config_entry.data.get( CONF_PUBLIC_URL, DEFAULT_PUBLIC_URL ), - CONF_EXTENDED_ENTITY_DISCOVERY: config_entry.options.get( + CONF_EXTENDED_ENTITY_DISCOVERY: config_entry.data.get( CONF_EXTENDED_ENTITY_DISCOVERY, DEFAULT_EXTENDED_ENTITY_DISCOVERY ), + CONF_DEBUG: config_entry.data.get(CONF_DEBUG, False), }, DATA_LISTENER: [config_entry.add_update_listener(update_listener)], }, @@ -480,9 +498,11 @@ async def async_update_data() -> Optional[AlexaEntityData]: "%s: Found %s devices, %s bluetooth", hide_email(email), len(devices) if devices is not None else "", - len(bluetooth.get("bluetoothStates", [])) - if bluetooth is not None - else "", + ( + len(bluetooth.get("bluetoothStates", [])) + if bluetooth is not None + else "" + ), ) await process_notifications(login_obj, raw_notifications) @@ -622,12 +642,14 @@ async def async_update_data() -> Optional[AlexaEntityData]: ) if not entry_setup: _LOGGER.debug("Loading config entry for %s", component) - config_entry.async_create_task( - hass, - hass.config_entries.async_forward_entry_setups( + try: + await hass.config_entries.async_forward_entry_setups( config_entry, [component] ) - ) + except (asyncio.TimeoutError, TimeoutException) as ex: + raise ConfigEntryNotReady( + f"Timeout while loading config entry for {component}" + ) from ex else: _LOGGER.debug("Loading %s", component) hass.async_create_task( @@ -797,10 +819,12 @@ async def update_bluetooth_state(login_obj, device_serial): if bluetooth is not None and "bluetoothStates" in bluetooth: for b_state in bluetooth["bluetoothStates"]: if device_serial == b_state["deviceSerialNumber"]: - # _LOGGER.debug("%s: setting value for: %s to %s", - # hide_email(email), - # hide_serial(device_serial), - # hide_serial(b_state)) + _LOGGER.debug( + "%s: setting value for: %s to %s", + hide_email(email), + hide_serial(device_serial), + hide_serial(b_state), + ) device["bluetooth_state"] = b_state return device["bluetooth_state"] _LOGGER.debug( @@ -938,6 +962,7 @@ async def http2_handler(message_obj): await coord.async_request_refresh() if serial and serial in existing_serials: await update_last_called(login_obj, last_called) + _LOGGER.debug("Updating last_called: %s", last_called) async_dispatcher_send( hass, f"{DOMAIN}_{hide_email(email)}"[0:32], @@ -1008,8 +1033,9 @@ async def http2_handler(message_obj): bluetooth_state = await update_bluetooth_state( login_obj, serial ) - # _LOGGER.debug("bluetooth_state %s", - # hide_serial(bluetooth_state)) + _LOGGER.debug( + "bluetooth_state %s", hide_serial(bluetooth_state) + ) if bluetooth_state: async_dispatcher_send( hass, @@ -1050,7 +1076,7 @@ async def http2_handler(message_obj): ]: pass else: - _LOGGER.warning( + _LOGGER.debug( "Unhandled command: %s with data %s. Please report at %s", command, hide_serial(json_payload), @@ -1329,19 +1355,22 @@ async def update_listener(hass, config_entry): for key, old_value in hass.data[DATA_ALEXAMEDIA]["accounts"][email][ "options" ].items(): - new_value = config_entry.options.get(key) + new_value = config_entry.data.get(key) if new_value is not None and new_value != old_value: hass.data[DATA_ALEXAMEDIA]["accounts"][email]["options"][key] = new_value _LOGGER.debug( - "Changing option %s from %s to %s", + "Option %s changed from %s to %s", key, old_value, hass.data[DATA_ALEXAMEDIA]["accounts"][email]["options"][key], ) - if key == CONF_EXTENDED_ENTITY_DISCOVERY: - reload_needed = True + reload_needed = True if reload_needed: await hass.config_entries.async_reload(config_entry.entry_id) + _LOGGER.debug( + "%s options reloaded", + hass.data[DATA_ALEXAMEDIA]["accounts"][email], + ) async def test_login_status(hass, config_entry, login) -> bool: @@ -1391,9 +1420,11 @@ async def test_login_status(hass, config_entry, login) -> bool: CONF_DEBUG: account[CONF_DEBUG], CONF_INCLUDE_DEVICES: account[CONF_INCLUDE_DEVICES], CONF_EXCLUDE_DEVICES: account[CONF_EXCLUDE_DEVICES], - CONF_SCAN_INTERVAL: account[CONF_SCAN_INTERVAL].total_seconds() - if isinstance(account[CONF_SCAN_INTERVAL], timedelta) - else account[CONF_SCAN_INTERVAL], + CONF_SCAN_INTERVAL: ( + account[CONF_SCAN_INTERVAL].total_seconds() + if isinstance(account[CONF_SCAN_INTERVAL], timedelta) + else account[CONF_SCAN_INTERVAL] + ), CONF_OTPSECRET: account.get(CONF_OTPSECRET, ""), }, ) diff --git a/custom_components/alexa_media/alarm_control_panel.py b/custom_components/alexa_media/alarm_control_panel.py index 60ca05a5..92e9e8f3 100644 --- a/custom_components/alexa_media/alarm_control_panel.py +++ b/custom_components/alexa_media/alarm_control_panel.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + from asyncio import sleep import logging from typing import List, Optional diff --git a/custom_components/alexa_media/alexa_entity.py b/custom_components/alexa_media/alexa_entity.py index ae612fcc..ccd277b5 100644 --- a/custom_components/alexa_media/alexa_entity.py +++ b/custom_components/alexa_media/alexa_entity.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + from datetime import datetime import json import logging @@ -75,7 +76,10 @@ def is_local(appliance: dict[str, Any]) -> bool: # Ledvance/Sengled bulbs connected via bluetooth are hard to detect as locally connected # There is probably a better way, but this works for now. - if appliance.get("manufacturerName") == "Ledvance" or appliance.get("manufacturerName") == "Sengled": + if ( + appliance.get("manufacturerName") == "Ledvance" + or appliance.get("manufacturerName") == "Sengled" + ): return not is_skill(appliance) # Zigbee devices are guaranteed to be local and have a particular pattern of id @@ -115,8 +119,11 @@ def is_light(appliance: dict[str, Any]) -> bool: return ( is_local(appliance) and ( - "LIGHT" in appliance.get("applianceTypes", []) - or ("SMARTPLUG" in appliance.get("applianceTypes", []) and appliance.get("customerDefinedDeviceType") == "LIGHT") + "LIGHT" in appliance.get("applianceTypes", []) + or ( + "SMARTPLUG" in appliance.get("applianceTypes", []) + and appliance.get("customerDefinedDeviceType") == "LIGHT" + ) ) and has_capability(appliance, "Alexa.PowerController", "powerState") ) @@ -130,8 +137,9 @@ def is_contact_sensor(appliance: dict[str, Any]) -> bool: and has_capability(appliance, "Alexa.ContactSensor", "detectionState") ) + def is_switch(appliance: dict[str, Any]) -> bool: - """Is the given appliance a switch controlled locally by an Echo, which ist not redeclared as a light.""" + """Is the given appliance a switch controlled locally by an Echo, which is not redeclared as a light.""" return ( is_local(appliance) and ( diff --git a/custom_components/alexa_media/config_flow.py b/custom_components/alexa_media/config_flow.py index 37f7b3ac..8b8eb9bf 100644 --- a/custom_components/alexa_media/config_flow.py +++ b/custom_components/alexa_media/config_flow.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + from asyncio import sleep from collections import OrderedDict import datetime @@ -29,8 +30,9 @@ from homeassistant.components.http.view import HomeAssistantView from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_URL from homeassistant.core import callback -from homeassistant.data_entry_flow import UnknownFlow +from homeassistant.data_entry_flow import FlowResult, UnknownFlow from homeassistant.exceptions import Unauthorized +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.network import NoURLAvailableError, get_url from homeassistant.util import slugify import httpx @@ -55,9 +57,11 @@ CONF_SECURITYCODE, CONF_TOTP_REGISTER, DATA_ALEXAMEDIA, + DEFAULT_DEBUG, DEFAULT_EXTENDED_ENTITY_DISCOVERY, DEFAULT_PUBLIC_URL, DEFAULT_QUEUE_DELAY, + DEFAULT_SCAN_INTERVAL, DOMAIN, ISSUE_URL, STARTUP, @@ -66,6 +70,8 @@ _LOGGER = logging.getLogger(__name__) +CONFIG_VERSION = 1 + @callback def configured_instances(hass): @@ -83,7 +89,8 @@ def in_progess_instances(hass): class AlexaMediaFlowHandler(config_entries.ConfigFlow): """Handle a Alexa Media config flow.""" - VERSION = 1 + VERSION = CONFIG_VERSION + CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL proxy: AlexaProxy = None proxy_view: "AlexaMediaAuthorizationProxyView" = None @@ -111,15 +118,18 @@ def __init__(self): self.proxy_schema = None self.data_schema = OrderedDict( [ + (vol.Required(CONF_URL, default="amazon.com"), str), + (vol.Required(CONF_HASS_URL), str), (vol.Required(CONF_EMAIL), str), (vol.Required(CONF_PASSWORD), str), - (vol.Required(CONF_URL, default="amazon.com"), str), - (vol.Optional(CONF_SECURITYCODE), str), (vol.Optional(CONF_OTPSECRET), str), - (vol.Optional(CONF_DEBUG, default=False), bool), + (vol.Optional(CONF_SECURITYCODE), str), (vol.Optional(CONF_INCLUDE_DEVICES, default=""), str), (vol.Optional(CONF_EXCLUDE_DEVICES, default=""), str), (vol.Optional(CONF_SCAN_INTERVAL, default=60), int), + (vol.Optional(CONF_QUEUE_DELAY, default=1.5), float), + (vol.Optional(CONF_EXTENDED_ENTITY_DISCOVERY, default=False), bool), + (vol.Optional(CONF_DEBUG, default=False), bool), ] ) self.totp_register = OrderedDict( @@ -143,26 +153,19 @@ async def async_step_user(self, user_input=None): hass_url = "" self.proxy_schema = OrderedDict( [ - ( - vol.Required(CONF_EMAIL, default=self.config.get(CONF_EMAIL, "")), - str, - ), ( vol.Required( - CONF_PASSWORD, default=self.config.get(CONF_PASSWORD, "") + CONF_URL, default=self.config.get(CONF_URL, "amazon.com") ), str, ), ( - vol.Required( - CONF_URL, default=self.config.get(CONF_URL, "amazon.com") - ), + vol.Required(CONF_EMAIL, default=self.config.get(CONF_EMAIL, "")), str, ), ( vol.Required( - CONF_HASS_URL, - default=self.config.get(CONF_HASS_URL, hass_url), + CONF_PASSWORD, default=self.config.get(CONF_PASSWORD, "") ), str, ), @@ -174,9 +177,10 @@ async def async_step_user(self, user_input=None): ), ( vol.Optional( - CONF_DEBUG, default=self.config.get(CONF_DEBUG, False) + CONF_HASS_URL, + default=self.config.get(CONF_HASS_URL, hass_url), ), - bool, + str, ), ( vol.Optional( @@ -195,10 +199,35 @@ async def async_step_user(self, user_input=None): ( vol.Optional( CONF_SCAN_INTERVAL, - default=self.config.get(CONF_SCAN_INTERVAL, 60), + default=self.config.get( + CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL + ), ), int, ), + ( + vol.Optional( + CONF_QUEUE_DELAY, + default=self.config.get(CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY), + ), + float, + ), + ( + vol.Optional( + CONF_EXTENDED_ENTITY_DISCOVERY, + default=self.config.get( + CONF_EXTENDED_ENTITY_DISCOVERY, + DEFAULT_EXTENDED_ENTITY_DISCOVERY, + ), + ), + bool, + ), + ( + vol.Optional( + CONF_DEBUG, default=self.config.get(CONF_DEBUG, DEFAULT_DEBUG) + ), + bool, + ), ] ) if not user_input: @@ -691,8 +720,8 @@ def _save_user_input_to_config(self, user_input=None) -> None: """ if user_input is None: return - if CONF_HASS_URL in user_input: - self.config[CONF_HASS_URL] = user_input[CONF_HASS_URL] + if CONF_URL in user_input: + self.config[CONF_URL] = user_input[CONF_URL] self.securitycode = user_input.get(CONF_SECURITYCODE) if self.securitycode is not None: self.config[CONF_SECURITYCODE] = self.securitycode @@ -709,16 +738,16 @@ def _save_user_input_to_config(self, user_input=None) -> None: self.config[CONF_EMAIL] = user_input[CONF_EMAIL] if CONF_PASSWORD in user_input: self.config[CONF_PASSWORD] = user_input[CONF_PASSWORD] - if CONF_URL in user_input: - self.config[CONF_URL] = user_input[CONF_URL] - if CONF_DEBUG in user_input: - self.config[CONF_DEBUG] = user_input[CONF_DEBUG] + if CONF_HASS_URL in user_input: + self.config[CONF_HASS_URL] = user_input[CONF_HASS_URL] if CONF_SCAN_INTERVAL in user_input: self.config[CONF_SCAN_INTERVAL] = ( user_input[CONF_SCAN_INTERVAL] if not isinstance(user_input[CONF_SCAN_INTERVAL], timedelta) else user_input[CONF_SCAN_INTERVAL].total_seconds() ) + if CONF_QUEUE_DELAY in user_input: + self.config[CONF_QUEUE_DELAY] = user_input[CONF_QUEUE_DELAY] if CONF_INCLUDE_DEVICES in user_input: if isinstance(user_input[CONF_INCLUDE_DEVICES], list): self.config[CONF_INCLUDE_DEVICES] = ( @@ -737,29 +766,32 @@ def _save_user_input_to_config(self, user_input=None) -> None: ) else: self.config[CONF_EXCLUDE_DEVICES] = user_input[CONF_EXCLUDE_DEVICES] + if CONF_EXTENDED_ENTITY_DISCOVERY in user_input: + self.config[CONF_EXTENDED_ENTITY_DISCOVERY] = user_input[ + CONF_EXTENDED_ENTITY_DISCOVERY + ] + if CONF_DEBUG in user_input: + self.config[CONF_DEBUG] = user_input[CONF_DEBUG] def _update_schema_defaults(self) -> Any: new_schema = self._update_ord_dict( self.data_schema, { + vol.Required( + CONF_URL, default=self.config.get(CONF_URL, "amazon.com") + ): str, vol.Required(CONF_EMAIL, default=self.config.get(CONF_EMAIL, "")): str, vol.Required( CONF_PASSWORD, default=self.config.get(CONF_PASSWORD, "") ): str, - vol.Optional( + vol.Required( CONF_SECURITYCODE, default=self.securitycode if self.securitycode else "", ): str, - vol.Optional( + vol.Required( CONF_OTPSECRET, default=self.config.get(CONF_OTPSECRET, ""), ): str, - vol.Required( - CONF_URL, default=self.config.get(CONF_URL, "amazon.com") - ): str, - vol.Optional( - CONF_DEBUG, default=bool(self.config.get(CONF_DEBUG, False)) - ): bool, vol.Optional( CONF_INCLUDE_DEVICES, default=self.config.get(CONF_INCLUDE_DEVICES, ""), @@ -771,13 +803,29 @@ def _update_schema_defaults(self) -> Any: vol.Optional( CONF_SCAN_INTERVAL, default=self.config.get(CONF_SCAN_INTERVAL, 60) ): int, + vol.Optional( + CONF_QUEUE_DELAY, + default=self.config.get(CONF_QUEUE_DELAY, 1.5), + ): float, + vol.Optional( + CONF_EXTENDED_ENTITY_DISCOVERY, + default=self.config.get( + CONF_EXTENDED_ENTITY_DISCOVERY, + DEFAULT_EXTENDED_ENTITY_DISCOVERY, + ), + ): bool, + vol.Optional( + CONF_DEBUG, default=bool(self.config.get(CONF_DEBUG, False)) + ): bool, }, ) return new_schema @staticmethod @callback - def async_get_options_flow(config_entry): + def async_get_options_flow( + config_entry: config_entries.ConfigEntry, + ) -> config_entries.OptionsFlow: """Get the options flow for this handler.""" return OptionsFlowHandler(config_entry) @@ -785,39 +833,95 @@ def async_get_options_flow(config_entry): class OptionsFlowHandler(config_entries.OptionsFlow): """Handle a option flow for Alexa Media.""" - def __init__(self, config_entry: config_entries.ConfigEntry): + def __init__(self, config_entry: config_entries.ConfigEntry) -> None: """Initialize options flow.""" + self.config = OrderedDict() self.config_entry = config_entry - async def async_step_init(self, user_input=None): - """Handle options flow.""" - if user_input is not None: - return self.async_create_entry(title="", data=user_input) + async def async_step_init( + self, user_input: dict[str, Any] | None = None + ) -> FlowResult: + """Manage the options""" - data_schema = vol.Schema( - { - vol.Optional( - CONF_QUEUE_DELAY, - default=self.config_entry.options.get( - CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY + self.options_schema = OrderedDict( + [ + ( + vol.Optional( + CONF_INCLUDE_DEVICES, + default=self.config_entry.data.get(CONF_INCLUDE_DEVICES, ""), ), - ): vol.All(vol.Coerce(float), vol.Clamp(min=0)), - vol.Optional( - CONF_PUBLIC_URL, - default=self.config_entry.options.get( - CONF_PUBLIC_URL, DEFAULT_PUBLIC_URL + str, + ), + ( + vol.Optional( + CONF_EXCLUDE_DEVICES, + default=self.config_entry.data.get(CONF_EXCLUDE_DEVICES, ""), ), - ): str, - vol.Required( - CONF_EXTENDED_ENTITY_DISCOVERY, - default=self.config_entry.options.get( + str, + ), + ( + vol.Optional( + CONF_SCAN_INTERVAL, + default=self.config_entry.data.get(CONF_SCAN_INTERVAL, 120), + ), + int, + ), + ( + vol.Optional( + CONF_QUEUE_DELAY, + default=self.config_entry.data.get( + CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY + ), + ), + float, + ), + ( + vol.Optional( CONF_EXTENDED_ENTITY_DISCOVERY, - DEFAULT_EXTENDED_ENTITY_DISCOVERY, + default=self.config_entry.data.get( + CONF_EXTENDED_ENTITY_DISCOVERY, + DEFAULT_EXTENDED_ENTITY_DISCOVERY, + ), ), - ): bool, - } + bool, + ), + ( + vol.Optional( + CONF_DEBUG, + default=self.config_entry.data.get(CONF_DEBUG, DEFAULT_DEBUG), + ), + bool, + ), + ] + ) + + if user_input is not None: + """Preserve these parameters""" + if CONF_URL in self.config_entry.data: + user_input[CONF_URL] = self.config_entry.data[CONF_URL] + if CONF_EMAIL in self.config_entry.data: + user_input[CONF_EMAIL] = self.config_entry.data[CONF_EMAIL] + if CONF_PASSWORD in self.config_entry.data: + user_input[CONF_PASSWORD] = self.config_entry.data[CONF_PASSWORD] + if CONF_SECURITYCODE in self.config_entry.data: + user_input[CONF_SECURITYCODE] = self.config_entry.data[ + CONF_SECURITYCODE + ] + if CONF_OTPSECRET in self.config_entry.data: + user_input[CONF_OTPSECRET] = self.config_entry.data[CONF_OTPSECRET] + if CONF_OAUTH in self.config_entry.data: + user_input[CONF_OAUTH] = self.config_entry.data[CONF_OAUTH] + + self.hass.config_entries.async_update_entry( + self.config_entry, data=user_input, options=self.config_entry.options + ) + return self.async_create_entry(title="", data={}) + + return self.async_show_form( + step_id="init", + data_schema=vol.Schema(self.options_schema), + description_placeholders={"message": ""}, ) - return self.async_show_form(step_id="init", data_schema=data_schema) class AlexaMediaAuthorizationCallbackView(HomeAssistantView): diff --git a/custom_components/alexa_media/const.py b/custom_components/alexa_media/const.py index 4a61d9d5..8dffa88b 100644 --- a/custom_components/alexa_media/const.py +++ b/custom_components/alexa_media/const.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + from datetime import timedelta from homeassistant.const import ( @@ -14,7 +15,7 @@ PERCENTAGE, ) -__version__ = "4.10.3" +__version__ = "4.12.1" PROJECT_URL = "https://github.com/alandtse/alexa_media_player/" ISSUE_URL = f"{PROJECT_URL}issues" NOTIFY_URL = f"{PROJECT_URL}wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service" @@ -58,9 +59,11 @@ EXCEPTION_TEMPLATE = "An exception of type {0} occurred. Arguments:\n{1!r}" -DEFAULT_EXTENDED_ENTITY_DISCOVERY = False +DEFAULT_SCAN_INTERVAL = 60 DEFAULT_QUEUE_DELAY = 1.5 DEFAULT_PUBLIC_URL = "" +DEFAULT_EXTENDED_ENTITY_DISCOVERY = False +DEFAULT_DEBUG = False SERVICE_CLEAR_HISTORY = "clear_history" SERVICE_UPDATE_LAST_CALLED = "update_last_called" SERVICE_FORCE_LOGOUT = "force_logout" diff --git a/custom_components/alexa_media/helpers.py b/custom_components/alexa_media/helpers.py index 9dd21149..e6da7fee 100644 --- a/custom_components/alexa_media/helpers.py +++ b/custom_components/alexa_media/helpers.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import asyncio import functools import hashlib diff --git a/custom_components/alexa_media/light.py b/custom_components/alexa_media/light.py index 39e889be..d258180e 100644 --- a/custom_components/alexa_media/light.py +++ b/custom_components/alexa_media/light.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import datetime import logging from math import sqrt @@ -278,9 +279,15 @@ async def async_turn_on(self, **kwargs): brightness = None kelvin = None hs_color = None - if ColorMode.ONOFF not in self._attr_supported_color_modes and ATTR_BRIGHTNESS in kwargs: + if ( + ColorMode.ONOFF not in self._attr_supported_color_modes + and ATTR_BRIGHTNESS in kwargs + ): brightness = kwargs[ATTR_BRIGHTNESS] - if ColorMode.COLOR_TEMP in self._attr_supported_color_modes and ATTR_COLOR_TEMP_KELVIN in kwargs: + if ( + ColorMode.COLOR_TEMP in self._attr_supported_color_modes + and ATTR_COLOR_TEMP_KELVIN in kwargs + ): kelvin = kwargs[ATTR_COLOR_TEMP_KELVIN] if ColorMode.HS in self._attr_supported_color_modes and ATTR_HS_COLOR in kwargs: hs_color = kwargs[ATTR_HS_COLOR] diff --git a/custom_components/alexa_media/manifest.json b/custom_components/alexa_media/manifest.json index 6a64820a..161aac92 100644 --- a/custom_components/alexa_media/manifest.json +++ b/custom_components/alexa_media/manifest.json @@ -9,5 +9,5 @@ "issue_tracker": "https://github.com/alandtse/alexa_media_player/issues", "loggers": ["alexapy", "authcaptureproxy"], "requirements": ["alexapy==1.27.10", "packaging>=20.3", "wrapt>=1.14.0"], - "version": "4.10.3" + "version": "4.12.1" } diff --git a/custom_components/alexa_media/media_player.py b/custom_components/alexa_media/media_player.py index daa6121b..ae2c79de 100644 --- a/custom_components/alexa_media/media_player.py +++ b/custom_components/alexa_media/media_player.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import asyncio import logging import os @@ -20,13 +21,7 @@ ATTR_MEDIA_ANNOUNCE, async_process_play_media_url, ) - -from homeassistant.const import ( - CONF_EMAIL, - CONF_NAME, - CONF_PASSWORD, - STATE_UNAVAILABLE, -) +from homeassistant.const import CONF_EMAIL, CONF_NAME, CONF_PASSWORD, STATE_UNAVAILABLE from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.discovery import async_load_platform @@ -76,7 +71,7 @@ | MediaPlayerEntityFeature.TURN_ON | MediaPlayerEntityFeature.VOLUME_MUTE | MediaPlayerEntityFeature.SELECT_SOURCE - | MediaPlayerEntityFeature.SHUFFLE_SET + | MediaPlayerEntityFeature.SHUFFLE_SET ) _LOGGER = logging.getLogger(__name__) @@ -185,11 +180,8 @@ async def async_setup_entry(hass, config_entry, async_add_devices): _LOGGER.debug( "%s: Loading config entry for %s", hide_email(account), component ) - config_entry.async_create_task( - hass, - hass.config_entries.async_forward_entry_setups( - config_entry, [component] - ) + await hass.config_entries.async_forward_entry_setups( + config_entry, [component] ) return True raise ConfigEntryNotReady @@ -431,7 +423,7 @@ async def _refresh_if_no_audiopush(already_refreshed=False): self._bluetooth_state = event["bluetooth_change"] # the setting of bluetooth_state is not consistent as this # takes from the event instead of the hass storage. We're - # setting the value twice. Architectually we should have a + # setting the value twice. Architecturally we should have a # single authoritative source of truth. self._source = self._get_source() self._source_list = self._get_source_list() @@ -478,7 +470,11 @@ async def _refresh_if_no_audiopush(already_refreshed=False): self.schedule_update_ha_state() await _refresh_if_no_audiopush(already_refreshed) elif "push_activity" in event: - if self.state in {MediaPlayerState.IDLE, MediaPlayerState.PAUSED, MediaPlayerState.PLAYING}: + if self.state in { + MediaPlayerState.IDLE, + MediaPlayerState.PAUSED, + MediaPlayerState.PLAYING, + }: _LOGGER.debug( "%s: %s checking for potential state update due to push activity on %s", hide_email(self._login.email), @@ -1158,7 +1154,10 @@ async def async_mute_volume(self, mute): @_catch_login_errors async def async_media_play(self): """Send play command.""" - if not (self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] and self.available): + if not ( + self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] + and self.available + ): return if self._playing_parent: await self._playing_parent.async_media_play() @@ -1175,7 +1174,10 @@ async def async_media_play(self): @_catch_login_errors async def async_media_pause(self): """Send pause command.""" - if not (self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] and self.available): + if not ( + self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] + and self.available + ): return if self._playing_parent: await self._playing_parent.async_media_pause() @@ -1242,7 +1244,10 @@ async def async_turn_on(self): @_catch_login_errors async def async_media_next_track(self): """Send next track command.""" - if not (self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] and self.available): + if not ( + self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] + and self.available + ): return if self._playing_parent: await self._playing_parent.async_media_next_track() @@ -1259,7 +1264,10 @@ async def async_media_next_track(self): @_catch_login_errors async def async_media_previous_track(self): """Send previous track command.""" - if not (self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] and self.available): + if not ( + self.state in [MediaPlayerState.PLAYING, MediaPlayerState.PAUSED] + and self.available + ): return if self._playing_parent: await self._playing_parent.async_media_previous_track() diff --git a/custom_components/alexa_media/notify.py b/custom_components/alexa_media/notify.py index 17a68a8a..c6cf4cfc 100644 --- a/custom_components/alexa_media/notify.py +++ b/custom_components/alexa_media/notify.py @@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import asyncio import json import logging diff --git a/custom_components/alexa_media/sensor.py b/custom_components/alexa_media/sensor.py index ee585f4a..c788ba4d 100644 --- a/custom_components/alexa_media/sensor.py +++ b/custom_components/alexa_media/sensor.py @@ -257,9 +257,9 @@ def __init__(self, coordinator, entity_id, name, media_player_device_id): self._attr_name = name + " Temperature" self._attr_device_class = SensorDeviceClass.TEMPERATURE self._attr_state_class = SensorStateClass.MEASUREMENT - self._attr_native_value: Optional[datetime.datetime] = ( - parse_temperature_from_coordinator(coordinator, entity_id) - ) + self._attr_native_value: Optional[ + datetime.datetime + ] = parse_temperature_from_coordinator(coordinator, entity_id) self._attr_native_unit_of_measurement: Optional[str] = UnitOfTemperature.CELSIUS # This includes "_temperature" because the Alexa entityId is for a physical device # A single physical device could have multiple HA entities @@ -306,12 +306,12 @@ def __init__( self._attr_name = name + " " + self._sensor_name self._attr_device_class = self._sensor_name self._attr_state_class = SensorStateClass.MEASUREMENT - self._attr_native_value: Optional[datetime.datetime] = ( - parse_air_quality_from_coordinator(coordinator, entity_id, instance) - ) - self._attr_native_unit_of_measurement: Optional[str] = ( - ALEXA_UNIT_CONVERSION.get(unit) - ) + self._attr_native_value: Optional[ + datetime.datetime + ] = parse_air_quality_from_coordinator(coordinator, entity_id, instance) + self._attr_native_unit_of_measurement: Optional[ + str + ] = ALEXA_UNIT_CONVERSION.get(unit) self._attr_unique_id = entity_id + " " + self._sensor_name self._attr_icon = ALEXA_ICON_CONVERSION.get(sensor_name, ALEXA_ICON_DEFAULT) self._attr_device_info = ( @@ -430,7 +430,7 @@ def _trigger_event(self, time_date) -> None: "alexa_media_notification_event", dt.as_local(time_date), ) - self.hass.bus.async_fire( + self.hass.bus.fire( "alexa_media_notification_event", event_data={ "email": hide_email(self._account), @@ -704,6 +704,18 @@ def icon(self): ) return self._attr_icon if not self.paused else off_icon + @property + def timer(self): + """Return the timer of the sensor.""" + return self._next.get("timerLabel") if self._next else None + + @property + def extra_state_attributes(self): + """Return the scene state attributes.""" + attr = super().extra_state_attributes + attr.update({"timer": self.timer}) + return attr + class ReminderSensor(AlexaMediaNotificationSensor): """Representation of a Alexa Reminder sensor.""" diff --git a/custom_components/alexa_media/services.yaml b/custom_components/alexa_media/services.yaml index 965957ef..77bf3612 100644 --- a/custom_components/alexa_media/services.yaml +++ b/custom_components/alexa_media/services.yaml @@ -11,23 +11,6 @@ update_last_called: # Example value that can be passed for this field example: "my_email@alexa.com" -clear_history: - # Description of the service - description: Clear last entries from Alexa Voice history for each Alexa account. - # Different fields that your service accepts - fields: - # Key of the field - email: - # Description of the field - description: List of Alexa accounts to update. If empty, will delete from all known accounts. - # Example value that can be passed for this field - example: "my_email@alexa.com" - entries: - # Description of the field - description: Number of entries to clear from 1 to 50. If empty, clear 50. - # Example value that can be passed for this field - example: 50 - force_logout: # Description of the service description: Force logout of Alexa Login account and deletion of .pickle. Intended for debugging use. diff --git a/custom_components/alexa_media/strings.json b/custom_components/alexa_media/strings.json index 07c41816..8eeae9af 100644 --- a/custom_components/alexa_media/strings.json +++ b/custom_components/alexa_media/strings.json @@ -1,37 +1,43 @@ { "config": { + "abort": { + "forgot_password": "The Forgot Password page was detected. This normally is the result of too may failed logins. Amazon may require action before a relogin can be attempted.", + "login_failed": "Alexa Media Player failed to login.", + "reauth_successful": "Alexa Media Player successfully reauthenticated. Please ignore the \"Aborted\" message from HA." + }, "error": { "connection_error": "Error connecting; check network and retry", "identifier_exists": "Email for Alexa URL already registered", "invalid_credentials": "Invalid credentials", "invalid_url": "URL is invalid: {message}", "2fa_key_invalid": "Invalid Built-In 2FA key", - "unable_to_connect_hass_url": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General", + "unable_to_connect_hass_url": "Unable to connect to Home Assistant URL. Please check the Internal URL under Configuration -> General", "unknown_error": "Unknown error: {message}" }, "step": { "user": { "data": { - "password": "Password", - "email": "Email Address", "url": "Amazon region domain (e.g., amazon.co.uk)", + "email": "Email Address", + "password": "Password", + "securitycode": "[%key_id:55616596%]", + "otp_secret": "Built-in 2FA App Key - This is 52 characters, not six!", "hass_url": "Url to access Home Assistant", - "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes). This is not six digits long.", "include_devices": "Included device (comma separated)", "exclude_devices": "Excluded device (comma separated)", - "debug": "Advanced debugging", "scan_interval": "Seconds between scans", - "proxy": "Use Login Proxy method (2FA not required)", - "oauth_login": "Enable oauth-token app method" + "queue_delay": "Seconds to wait to queue commands together", + "extended_entity_discovery": "Include devices connected via Echo", + "debug": "Advanced debugging" }, - "description": "Please confirm the information below. For legacy configuration, disable `Use Login Proxy method` option.", + "description": "Required *", "title": "Alexa Media Player - Configuration" }, "proxy_warning": { "data": { "proxy_warning": "Ignore and Continue - I understand that no support for login issues are provided for bypassing this warning." }, - "description": "The HA server cannot connect to the URL provided: {hass_url}.\n> {error}\n\nTo fix this, please confirm your **HA server** can reach {hass_url}. This field is from the External Url under Configuration -> General but you can try your internal url.\n\nIf you are **certain** your client can reach this url, you can bypass this warning.", + "description": "The HA server cannot connect to the URL provided: {hass_url}.\n> {error}\n\nTo fix this, please confirm your **HA server** can reach {hass_url}. This field is from the External URL under Configuration -> General but you can try your internal URL.\n\nIf you are **certain** your client can reach this URL, you can bypass this warning.", "title": "Alexa Media Player - Unable to Connect to HA URL" }, "totp_register": { @@ -41,21 +47,22 @@ "description": "**{email} - alexa.{url}** \nHave you successfully confirmed an OTP from the Built-in 2FA App Key with Amazon? \n >OTP Code {message}", "title": "Alexa Media Player - OTP Confirmation" } - }, - "abort": { - "forgot_password": "The Forgot Password page was detected. This normally is the result of too may failed logins. Amazon may require action before a relogin can be attempted.", - "login_failed": "Alexa Media Player failed to login.", - "reauth_successful": "Alexa Media Player successfully reauthenticated. Please ignore the \"Aborted\" message from HA." } }, "options": { "step": { "init": { "data": { + "hass_url": "Public URL to access Home Assistant (including trailing '/')", + "include_devices": "Included device (comma separated)", + "exclude_devices": "Excluded device (comma separated)", + "scan_interval": "Seconds between scans", "queue_delay": "Seconds to wait to queue commands together", "extended_entity_discovery": "Include devices connected via Echo", - "public_url": "Public URL to access Home Assistant (including trailing '/')" - } + "debug": "Advanced debugging" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/switch.py b/custom_components/alexa_media/switch.py index 6c35f1cd..a011f431 100644 --- a/custom_components/alexa_media/switch.py +++ b/custom_components/alexa_media/switch.py @@ -6,10 +6,12 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ + import datetime import logging from typing import List +from alexapy import AlexaAPI from homeassistant.exceptions import ConfigEntryNotReady, NoEntitySpecifiedError from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import EntityCategory @@ -24,7 +26,6 @@ hide_email, hide_serial, ) -from alexapy import AlexaAPI from .alexa_entity import parse_power_from_coordinator from .alexa_media import AlexaMedia from .const import CONF_EXTENDED_ENTITY_DISCOVERY @@ -127,7 +128,9 @@ async def async_setup_platform(hass, config, add_devices_callback, discovery_inf switch_entity["name"], ) coordinator = account_dict["coordinator"] - switch = SmartSwitch(coordinator, account_dict["login_obj"], switch_entity) + switch = SmartSwitch( + coordinator, account_dict["login_obj"], switch_entity + ) account_dict["entities"]["smart_switch"].append(switch) devices.append(switch) else: @@ -408,6 +411,7 @@ def entity_category(self): """Return the entity category of the switch.""" return EntityCategory.CONFIG + class SmartSwitch(CoordinatorEntity, SwitchDevice): def __init__(self, coordinator, login, details): """Initialize alexa light entity.""" diff --git a/custom_components/alexa_media/translations/ar.json b/custom_components/alexa_media/translations/ar.json index 16a71856..0bb11467 100644 --- a/custom_components/alexa_media/translations/ar.json +++ b/custom_components/alexa_media/translations/ar.json @@ -34,10 +34,12 @@ "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes). This is not six digits long.", "password": "Password", + "queue_delay": "Seconds to wait to queue commands together", "scan_interval": "Seconds between scans", "securitycode": "[%key_id:55616596%]", "url": "Amazon region domain (e.g., amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Advanced debugging", + "exclude_devices": "Excluded device (comma separated)", "extended_entity_discovery": "Include devices connected via Echo", + "hass_url": "عنوان URL العام للوصول إلى Home Assistant (بما في ذلك '/' المتبوعة)", + "include_devices": "Included device (comma separated)", "public_url": "عنوان URL العام للوصول إلى Home Assistant (بما في ذلك '/' المتبوعة)", - "queue_delay": "Seconds to wait to queue commands together" - } + "queue_delay": "Seconds to wait to queue commands together", + "scan_interval": "Seconds between scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/de.json b/custom_components/alexa_media/translations/de.json index 1c50b00b..9e830f1e 100644 --- a/custom_components/alexa_media/translations/de.json +++ b/custom_components/alexa_media/translations/de.json @@ -34,10 +34,12 @@ "debug": "Erweitertes Debugging", "email": "E-Mail-Adresse", "exclude_devices": "Ausgeschlossene Geräte (Komma getrennt)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Home Assistant-URL", "include_devices": "Eingebundene Geräte (Komma getrennt)", "otp_secret": "Integrierter 2FA-App-Schlüssel (automatisch generierte 2FA-Code)", "password": "Passwort", + "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen", "scan_interval": "Sekunden zwischen den Scans", "securitycode": "2FA-Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B. amazon.de)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Erweitertes Debugging", + "exclude_devices": "Ausgeschlossene Geräte (Komma getrennt)", "extended_entity_discovery": "Schließen Sie Geräte ein, die über Echo verbunden sind", + "hass_url": "Öffentliche URL zum Zugriff auf Home Assistant (einschließlich '/' am Ende)", + "include_devices": "Eingebundene Geräte (Komma getrennt)", "public_url": "Öffentliche URL zum Zugriff auf Home Assistant (einschließlich '/' am Ende)", - "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen" - } + "queue_delay": "Sekunden zu warten, um Befehle in die Warteschlange zu stellen", + "scan_interval": "Sekunden zwischen den Scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/en.json b/custom_components/alexa_media/translations/en.json index 963267f4..610cb82c 100644 --- a/custom_components/alexa_media/translations/en.json +++ b/custom_components/alexa_media/translations/en.json @@ -34,10 +34,12 @@ "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes). This is not six digits long.", "password": "Password", + "queue_delay": "Seconds to wait to queue commands together", "scan_interval": "Seconds between scans", "securitycode": "[%key_id:55616596%]", "url": "Amazon region domain (e.g., amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Advanced debugging", + "exclude_devices": "Excluded device (comma separated)", "extended_entity_discovery": "Include devices connected via Echo", + "hass_url": "Public URL to access Home Assistant (including trailing '/')", + "include_devices": "Included device (comma separated)", "public_url": "Public URL to access Home Assistant (including trailing '/')", - "queue_delay": "Seconds to wait to queue commands together" - } + "queue_delay": "Seconds to wait to queue commands together", + "scan_interval": "Seconds between scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/es.json b/custom_components/alexa_media/translations/es.json index 35a5bf28..ce234579 100644 --- a/custom_components/alexa_media/translations/es.json +++ b/custom_components/alexa_media/translations/es.json @@ -34,10 +34,12 @@ "debug": "Depuración avanzada", "email": "Dirección de correo electrónico", "exclude_devices": "Dispositivo excluido (separado por comas)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url para acceder a Home Assistant", "include_devices": "Dispositivo incluido (separado por comas)", "otp_secret": "Clave de aplicación 2FA incorporada (genera automáticamente códigos 2FA). Esto no tiene seis dígitos.", "password": "Contraseña", + "queue_delay": "Segundos a esperar para agrupar comandos", "scan_interval": "Segundos entre escaneos", "securitycode": "Código 2FA (recomendado para evitar problemas de inicio de sesión)", "url": "Región del dominio de Amazon (por ejemplo, amazon.es)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Depuración avanzada", + "exclude_devices": "Dispositivo excluido (separado por comas)", "extended_entity_discovery": "Incluir dispositivos conectados a través de Echo", + "hass_url": "URL pública para acceder a Home Assistant (incluyendo la '/' final)", + "include_devices": "Dispositivo incluido (separado por comas)", "public_url": "URL pública para acceder a Home Assistant (incluyendo la '/' final)", - "queue_delay": "Segundos a esperar para agrupar comandos" - } + "queue_delay": "Segundos a esperar para agrupar comandos", + "scan_interval": "Segundos entre escaneos" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/fr.json b/custom_components/alexa_media/translations/fr.json index b3b419f5..738df4fa 100644 --- a/custom_components/alexa_media/translations/fr.json +++ b/custom_components/alexa_media/translations/fr.json @@ -34,10 +34,12 @@ "debug": "Débogage avancé", "email": "Adresse Email", "exclude_devices": "Appareil exclu (séparé par des virgules)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "URL pour accéder à Home Assistant", "include_devices": "Appareil inclus (séparé par des virgules)", "otp_secret": "Clé d'application 2FA (2 facteurs) intégrée (génère automatiquement des codes 2FA). Il ne s'agit pas d'un code à six chiffres.", "password": "Mot de passe", + "queue_delay": "Secondes à attendre pour mettre les commandes en file d'attente ensemble", "scan_interval": "Secondes entre les analyses", "securitycode": "Code 2FA (recommandé pour éviter les problèmes de connexion)", "url": "Domaine de la région Amazon (exemple, amazon.fr)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Débogage avancé", + "exclude_devices": "Appareil exclu (séparé par des virgules)", "extended_entity_discovery": "Inclure les appareils connectés via Echo", + "hass_url": "URL publique pour accéder à Home Assistant (y compris le '/' final)", + "include_devices": "Appareil inclus (séparé par des virgules)", "public_url": "URL publique pour accéder à Home Assistant (y compris le '/' final)", - "queue_delay": "Secondes à attendre pour mettre les commandes en file d'attente ensemble" - } + "queue_delay": "Secondes à attendre pour mettre les commandes en file d'attente ensemble", + "scan_interval": "Secondes entre les analyses" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/it.json b/custom_components/alexa_media/translations/it.json index 921ca71f..ab3df8e7 100644 --- a/custom_components/alexa_media/translations/it.json +++ b/custom_components/alexa_media/translations/it.json @@ -34,10 +34,12 @@ "debug": "Debug avanzato", "email": "Indirizzo email", "exclude_devices": "Dispositivi da escludere (separati da virgola)", + "extended_entity_discovery": "Includi dispositivi collegati tramite Echo", "hass_url": "URL per accedere a Home Assistant", "include_devices": "Dispositivi da includere (separati da virgola)", "otp_secret": "Chiave app 2FA integrata (genera automaticamente codici 2FA). Questo non è lungo sei cifre.", "password": "Password", + "queue_delay": "Secondi di attesa per accodare i comandi insieme", "scan_interval": "Tempo in secondi fra le scansioni", "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", "url": "Regione del dominio Amazon (ad es., amazon.it)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Debug avanzato", + "exclude_devices": "Dispositivi da escludere (separati da virgola)", "extended_entity_discovery": "Includi i dispositivi collegati tramite Echo", + "hass_url": "URL pubblico per accedere a Home Assistant (incluso il '/' finale)", + "include_devices": "Dispositivi da includere (separati da virgola)", "public_url": "URL pubblico per accedere a Home Assistant (incluso il '/' finale)", - "queue_delay": "Secondi di attesa per accodare i comandi insieme" - } + "queue_delay": "Secondi di attesa per accodare i comandi insieme", + "scan_interval": "Tempo in secondi fra le scansioni" + }, + "description": "Necessario *", + "title": "Alexa Media Player - Riconfigurazione" } } }, diff --git a/custom_components/alexa_media/translations/nb.json b/custom_components/alexa_media/translations/nb.json index ade5d166..e3882060 100644 --- a/custom_components/alexa_media/translations/nb.json +++ b/custom_components/alexa_media/translations/nb.json @@ -34,10 +34,12 @@ "debug": "Avansert feilsøking", "email": "Epostadresse", "exclude_devices": "Ekskludert enhet (kommaseparert)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Inkluder enhet (kommaseparert)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", "password": "Passord", + "queue_delay": "Sekunder for å vente på køkommandoer sammen", "scan_interval": "Sekunder mellom skanninger", "securitycode": "2FA-kode (anbefales for å unngå påloggingsproblemer)", "url": "Amazon-regiondomenet (f.eks. Amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Avansert feilsøking", + "exclude_devices": "Ekskludert enhet (kommaseparert)", "extended_entity_discovery": "Inkluder enheter som er koblet til via Echo", + "hass_url": "Offentlig URL for å få tilgang til Home Assistant (inkludert etterfølgende ''/'')", + "include_devices": "Inkluder enhet (kommaseparert)", "public_url": "Offentlig URL for å få tilgang til Home Assistant (inkludert etterfølgende ''/'')", - "queue_delay": "Sekunder for å vente på køkommandoer sammen" - } + "queue_delay": "Sekunder for å vente på køkommandoer sammen", + "scan_interval": "Sekunder mellom skanninger" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/nl.json b/custom_components/alexa_media/translations/nl.json index efd7ce85..9809c51c 100644 --- a/custom_components/alexa_media/translations/nl.json +++ b/custom_components/alexa_media/translations/nl.json @@ -34,10 +34,12 @@ "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", "password": "Paswoord", + "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen", "scan_interval": "Aantal seconden tussen scans", "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Geavanceerd debuggen", + "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", "extended_entity_discovery": "Inclusief apparaten die zijn verbonden via Echo", + "hass_url": "Openbare URL om toegang te krijgen tot Home Assistant (inclusief afsluitende '/')", + "include_devices": "Apparaten toevoegen (Scheiding: komma)", "public_url": "Openbare URL om toegang te krijgen tot Home Assistant (inclusief afsluitende '/')", - "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen" - } + "queue_delay": "Seconden om te wachten om opdrachten in de wachtrij te plaatsen", + "scan_interval": "Aantal seconden tussen scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/pl.json b/custom_components/alexa_media/translations/pl.json index 8d653ffd..bd51a9da 100644 --- a/custom_components/alexa_media/translations/pl.json +++ b/custom_components/alexa_media/translations/pl.json @@ -34,10 +34,12 @@ "debug": "Zaawansowane debugowanie", "email": "Adres e-mail", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", + "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń", "scan_interval": "Interwał skanowania (sekundy)", "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", "url": "Region/domena Amazon (np. amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Zaawansowane debugowanie", + "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", "extended_entity_discovery": "Uwzględnij urządzenia podłączone przez Echo", + "hass_url": "Publiczny URL do dostępu do Home Assistant (z końcowym '/')", + "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "public_url": "Publiczny URL do dostępu do Home Assistant (z końcowym '/')", - "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń" - } + "queue_delay": "Sekundy oczekiwania na kolejkowanie poleceń", + "scan_interval": "Interwał skanowania (sekundy)" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/pt-BR.json b/custom_components/alexa_media/translations/pt-BR.json index 060dc333..537744a3 100644 --- a/custom_components/alexa_media/translations/pt-BR.json +++ b/custom_components/alexa_media/translations/pt-BR.json @@ -34,10 +34,12 @@ "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivos excluídos (separado por vírgula)", + "extended_entity_discovery": "Incluir dispositivos conectados via Echo", "hass_url": "Url para acesso ao Home Assistant", "include_devices": "Dispositivos incluídos (separado por vírgula)", "otp_secret": "Chave de aplicativo 2FA integrada (gera códigos 2FA automaticamente). Isso não tem seis dígitos.", "password": "Senha", + "queue_delay": "Segundos para aguardar os comandos de fila juntos", "scan_interval": "Segundos entre varreduras", "securitycode": "[%key_id:55616596%]", "url": "Domínio regional da Amazon (ex: amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Depuração avançada", + "exclude_devices": "Dispositivos excluídos (separado por vírgula)", "extended_entity_discovery": "Incluir dispositivos conectados via Echo", + "hass_url": "URL pública para acessar o Home Assistant (incluindo a barra final ''/')", + "include_devices": "Dispositivos incluídos (separado por vírgula)", "public_url": "URL pública para acessar o Home Assistant (incluindo a barra final ''/')", - "queue_delay": "Segundos para aguardar os comandos de fila juntos" - } + "queue_delay": "Segundos para aguardar os comandos de fila juntos", + "scan_interval": "Segundos entre escaneamentos" + }, + "description": "Obrigatório *", + "title": "Alexa Media Player - Reconfiguração" } } }, diff --git a/custom_components/alexa_media/translations/pt.json b/custom_components/alexa_media/translations/pt.json index c7f439ce..8f4e2b9d 100644 --- a/custom_components/alexa_media/translations/pt.json +++ b/custom_components/alexa_media/translations/pt.json @@ -34,10 +34,12 @@ "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivo excluído (separado por vírgula)", + "extended_entity_discovery": "Incluir dispositivos conectados via Echo", "hass_url": "URL para aceder o Home Assistant", "include_devices": "Dispositivo incluído (separado por vírgula)", "otp_secret": "Chave de aplicativo 2FA integrada (gera códigos 2FA automaticamente). Isso não tem seis dígitos.", "password": "Senha", + "queue_delay": "Segundos de espera para agrupar comandos", "scan_interval": "Segundos entre análises", "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Região do domínio Amazon (ex. amazon.com.br)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Depuração avançada", + "exclude_devices": "Dispositivo excluído (separado por vírgula)", "extended_entity_discovery": "Inclui dispositivos conectados via Echo", + "hass_url": "URL público para aceder ao Home Assistant (incluindo o '/' no final)", + "include_devices": "Dispositivo incluído (separado por vírgula)", "public_url": "URL público para aceder ao Home Assistant (incluindo o '/' no final)", - "queue_delay": "Segundos de espera para agrupar comandos" - } + "queue_delay": "Segundos de espera para agrupar comandos", + "scan_interval": "Segundos entre análises" + }, + "description": "Obrigatório *", + "title": "Alexa Media Player - Reconfiguração" } } }, diff --git a/custom_components/alexa_media/translations/ru.json b/custom_components/alexa_media/translations/ru.json index 6f7f06e0..68678eb2 100644 --- a/custom_components/alexa_media/translations/ru.json +++ b/custom_components/alexa_media/translations/ru.json @@ -34,10 +34,12 @@ "debug": "Расширенные возможности отладки", "email": "Адрес электронной почты", "exclude_devices": "Исключенные устройства (через запятую)", + "extended_entity_discovery": "Include devices connected via Echo", "hass_url": "URL-адрес для доступа к Home Assistant", "include_devices": "Включенные устройства (разделенное запятыми)", "otp_secret": "Встроенный ключ приложения 2FA (автоматически генерирует коды 2FA). Это не шесть цифр.", "password": "Пароль", + "queue_delay": "Секунды ожидания, чтобы выполнить команды вместе", "scan_interval": "Секунды между сканированиями", "securitycode": "[%key_id:55616596%]", "url": "Домен региона Amazon (например, amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "Расширенные возможности отладки", + "exclude_devices": "Исключенные устройства (через запятую)", "extended_entity_discovery": "Включить устройства, подключенные через Echo", + "hass_url": "Публичный URL-адрес для доступа к Home Assistant (включая завершающий '/')", + "include_devices": "Включенные устройства (разделенное запятыми)", "public_url": "Публичный URL-адрес для доступа к Home Assistant (включая завершающий '/')", - "queue_delay": "Секунды ожидания, чтобы выполнить команды вместе" - } + "queue_delay": "Секунды ожидания, чтобы выполнить команды вместе", + "scan_interval": "Секунды между сканированиями" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/alexa_media/translations/zh-Hans.json b/custom_components/alexa_media/translations/zh-Hans.json index 20f12c90..f316e723 100644 --- a/custom_components/alexa_media/translations/zh-Hans.json +++ b/custom_components/alexa_media/translations/zh-Hans.json @@ -34,10 +34,12 @@ "debug": "高级调试", "email": "电子邮件地址", "exclude_devices": "Excluded device (comma separated)", + "extended_entity_discovery": "包括通过 Echo 连接的设备", "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "otp_secret": "内置 2FA App Key(自动生成 2FA 代码)。这不是六位数长。", "password": "密码", + "queue_delay": "Seconds to wait to queue commands together", "scan_interval": "Seconds between scans", "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" @@ -51,10 +53,17 @@ "step": { "init": { "data": { + "debug": "高级调试", + "exclude_devices": "Excluded device (comma separated)", "extended_entity_discovery": "包括通过 Echo 连接的设备", + "hass_url": "访问Home Assistant的公共URL(包括尾随的'/')", + "include_devices": "Included device (comma separated)", "public_url": "访问Home Assistant的公共URL(包括尾随的'/')", - "queue_delay": "Seconds to wait to queue commands together" - } + "queue_delay": "Seconds to wait to queue commands together", + "scan_interval": "Seconds between scans" + }, + "description": "Required *", + "title": "Alexa Media Player - Reconfiguration" } } }, diff --git a/custom_components/dahua/__init__.py b/custom_components/dahua/__init__.py index 0b6c6182..56a92c70 100644 --- a/custom_components/dahua/__init__.py +++ b/custom_components/dahua/__init__.py @@ -121,6 +121,7 @@ def __init__(self, hass: HomeAssistant, events: list, address: str, port: int, r self._supports_disarming_linkage = False self._supports_smart_motion_detection = False self._supports_lighting = False + self._supports_floodlightmode = False self._serial_number: str self._profile_mode = "0" self._supports_profile_mode = False @@ -259,6 +260,8 @@ async def _async_update_data(self): is_flood_light = self.is_flood_light() _LOGGER.info("Device is a floodlight=%s", is_flood_light) + + self._supports_floodlightmode = self.supports_floodlightmode() try: await self.client.async_get_config_lighting(self._channel, self._profile_mode) @@ -568,6 +571,10 @@ def supports_infrared_light(self) -> bool: return False return "-AS-PV" not in self.model and "-AS-NI" not in self.model + def supports_floodlightmode(self) -> bool: + """ Returns true if this camera supports floodlight mode """ + return "W452ASD" in self.model.upper() or "L46N" in self.model.upper() + def supports_illuminator(self) -> bool: """ Returns true if this camera has an illuminator (white light for color cameras). For example, the @@ -645,14 +652,13 @@ def is_illuminator_on(self) -> bool: def is_flood_light_on(self) -> bool: - if self._supports_coaxial_control: - # 'coaxialControlIO.cgi?action=getStatus&channel=1' + if self._supports_floodlightmode: + #'coaxialControlIO.cgi?action=getStatus&channel=1' return self.data.get("status.status.WhiteLight", "") == "On" else: """Return true if the amcrest flood light light is on""" # profile_mode 0=day, 1=night, 2=scene profile_mode = self.get_profile_mode() - return self.data.get(f'table.Lighting_V2[{self._channel}][{profile_mode}][1].Mode') == "Manual" def is_ring_light_on(self) -> bool: diff --git a/custom_components/dahua/light.py b/custom_components/dahua/light.py index ba78b74f..a36abdc6 100644 --- a/custom_components/dahua/light.py +++ b/custom_components/dahua/light.py @@ -269,13 +269,12 @@ def should_poll(self): async def async_turn_on(self, **kwargs): """Turn the light on""" - if self._coordinator._supports_coaxial_control: + if self._coordinator._supports_floodlightmode: channel = self._coordinator.get_channel() self._coordinator._floodlight_mode = await self._coordinator.client.async_get_floodlightmode() await self._coordinator.client.async_set_floodlightmode(2) await self._coordinator.client.async_set_coaxial_control_state(channel, SECURITY_LIGHT_TYPE, True) await self._coordinator.async_refresh() - else: channel = self._coordinator.get_channel() profile_mode = self._coordinator.get_profile_mode() @@ -284,7 +283,7 @@ async def async_turn_on(self, **kwargs): async def async_turn_off(self, **kwargs): """Turn the light off""" - if self._coordinator._supports_coaxial_control: + if self._coordinator._supports_floodlightmode: channel = self._coordinator.get_channel() await self._coordinator.client.async_set_coaxial_control_state(channel, SECURITY_LIGHT_TYPE, False) await self._coordinator.client.async_set_floodlightmode(self._coordinator._floodlight_mode) diff --git a/custom_components/dahua/manifest.json b/custom_components/dahua/manifest.json index de455662..ecc54b65 100644 --- a/custom_components/dahua/manifest.json +++ b/custom_components/dahua/manifest.json @@ -5,7 +5,7 @@ "documentation": "https://github.com/rroller/dahua", "issue_tracker": "https://github.com/rroller/dahua/issues", "dependencies": [], - "version": "0.5.0", + "version": "0.9.60", "config_flow": true, "codeowners": [ "@rroller" diff --git a/custom_components/frigate/manifest.json b/custom_components/frigate/manifest.json index 60119bbb..11a7babc 100644 --- a/custom_components/frigate/manifest.json +++ b/custom_components/frigate/manifest.json @@ -14,5 +14,5 @@ "iot_class": "local_push", "issue_tracker": "https://github.com/blakeblackshear/frigate-hass-integration/issues", "requirements": ["pytz"], - "version": "5.2.0" + "version": "5.3.0" } diff --git a/custom_components/frigate/views.py b/custom_components/frigate/views.py index 777f9f5e..0ad7e1dd 100644 --- a/custom_components/frigate/views.py +++ b/custom_components/frigate/views.py @@ -276,6 +276,13 @@ def _create_path(self, **kwargs: Any) -> str | None: if path.endswith("clip.mp4"): return f"api/events/{event_id}/clip.mp4" + + if path.endswith("event_preview.gif"): + return f"api/events/{event_id}/preview.gif" + + if path.endswith("review_preview.gif"): + return f"api/review/{event_id}/preview" + return None def _permit_request( diff --git a/extras/Node-RED/flows.json b/extras/Node-RED/flows.json index f669138c..e1ee20c7 100644 --- a/extras/Node-RED/flows.json +++ b/extras/Node-RED/flows.json @@ -1 +1 @@ -[{"id":"9584418c.dafc2","type":"tab","label":"Automations","disabled":false,"info":""},{"id":"f602e6ba.609d28","type":"tab","label":"Irrigation","disabled":false,"info":""},{"id":"9cfe6331fbc680d5","type":"group","z":"9584418c.dafc2","name":"Delivery Logo Object Detection","style":{"label":true},"nodes":["ed80a3f.522526","f3a3e80f.3e8e38","6f08d11c854dfb00","9b7c5535c74a94a3","d8a16fd91366d112","bcaf3569e7816922","d58f6ef71c326040","42be35f83b764861","b2a5543693ac851e","c13f0f20a56d6af5","7151828122e3b80c","bace446bfa7b343d","5acbb2cbdbdea368","c061be05c01527e0","e263410e9a3af7d8","d9e9a93275328762","a12e93d199527cae","b4b8f84a.7e57a8","63fd5090444c9cad","2dfdead1d2e3b78b","c1fe21bcb3184137","f93c269fdb777a65"],"x":54,"y":2099,"w":1372,"h":322},{"id":"3c4349a7eea9bd3b","type":"group","z":"9584418c.dafc2","name":"Set Cameras Online","style":{"label":true},"nodes":["bd19a17005513c2f","24d1a94e275e5e44","58d0c98797e19829","7a8e43b6f7c84bac","ab66afa5b576de3f","ccf5998fdf8ee50d"],"x":54,"y":1839,"w":492,"h":242},{"id":"35da177d9e2fd258","type":"group","z":"9584418c.dafc2","name":"Virtual Radar Server","style":{"label":true},"nodes":["a9a323de66b6f772","ee139512bcad0966","7da69a7e8ecadc7c","26e32b1d7824356a","3a82b835.c57d48","91afebbf8b9edf05","5684b08aacd6d225","4ca1a5ad47ce7a18","ba68e03143ba4af8","5f1d1b471a1c7cbb","2cd08c8da06afaf6","ea911291f04c7d18","43e5fa289c7550ff","97761f13f8e5c31b","ea239028eda07991"],"x":54,"y":1499,"w":1272,"h":322},{"id":"bd2acc7efb5be5fd","type":"group","z":"9584418c.dafc2","name":"Front Porch Light Occupancy Brightness","style":{"label":true},"nodes":["3f2a2e4d99057b69","3e399d83e4e7f4c3","59f5bc2571b0f12f","c68c969a6b8c2833","b1a99d9698d831b2","17b35d69307a8455","d11c183fff8d848d","fae7fa701710e258","1ef176bec8ed5da0","254a48eabb9cf476"],"x":54,"y":1279,"w":1092,"h":202},{"id":"11e25fc28c23144c","type":"group","z":"9584418c.dafc2","name":"Front House Lights","style":{"label":true},"nodes":["86bc310cbc0562af","2fb6a7afb6502a32","8c55985bffebd56a"],"x":54,"y":1119,"w":472,"h":142},{"id":"b808f2d7ae539c87","type":"group","z":"9584418c.dafc2","name":"Indoor Lights Dim Evening","style":{"label":true},"nodes":["e93027cb.6a6308","fc81cfda.29ff5","8ee35d65.a7569","41b918d5.7ce018","5420f9c0.5356c8","77184c93.8790d4","39a5ce57.78e3d2","ea19fe14.80749","ea2604f9.4cdf98","8a82f465.846018","d8ad0651.bf7a18","d9cc182cc3eb2a93","cde7b3c9ca39891b","1457bf6605a50448","fa90c550.d6c948"],"x":54,"y":659,"w":1073,"h":444},{"id":"9df353d4c0fc9a54","type":"group","z":"9584418c.dafc2","name":"Server Rack Temperature","style":{"label":true},"nodes":["73550501.be7fbc","7dff3ae1.e36a04","88822bfe.2cc598","96b5207d.407dd","b259f0eb.3e83","c7ff978f.ff0728","29b17ed7.fab972"],"x":54,"y":459,"w":932,"h":182},{"id":"18fe74aea06a1180","type":"group","z":"9584418c.dafc2","name":"AC Stale Air","style":{"label":true},"nodes":["ebe84a6f70b4bc2f","cf1c689e51b98aec","6af7abba85612dd9","8b6280c5c448720c","9ce46ce21d8cc964","2b6721107586ceae","830c3ddd08ef396c"],"x":54,"y":299,"w":1132,"h":142},{"id":"cf3a0410bcf837ae","type":"group","z":"9584418c.dafc2","name":"Door Alerts","style":{"label":true},"nodes":["2022689a.938918","8ec438b6.4eb2e8","9c1d9c7c.ed9c7","896f5b34.7b4328","c5124616.c9bd48","f9d93af6.184028","3314ec9f.ca8994","5c24f744.30fcb8","6aa388d0.707768","cf758271.d4fd6","5a740c2d.009864","c5c85c0aa2d8c8ca","28fa66cd.af058a","aee87977a0670889"],"x":54,"y":19,"w":1012,"h":262},{"id":"3cf0491ac33aecfa","type":"group","z":"f602e6ba.609d28","name":"Max Time and Master Valve Control","style":{"label":true},"nodes":["54bad548.7e9fcc","5a10cd93.8e94b4","a77808ff.3f1288","54ae6ec3.1bc63","bcbf413e.7b188","3b848bce.76aea4","43dedcca.ac7734","c42e6d62.7a24c","cdd3b7ef.04a618","63f07877e73b952a","5e9007a27732bba9","061b74f643477dd9","749afd72791a5127","656ad2cd6fb99f57","5093cf5ba33eb30a","1b05625730953169","21aa3b57a72b3336"],"x":54,"y":19,"w":1572,"h":222},{"id":"43a30fe5a5052c22","type":"group","z":"f602e6ba.609d28","name":"Custom Water","style":{"label":true},"nodes":["d269f175.c9dc6","3367e45f.cc981c","116d5bb3.ee92a4","80df47d5.602888","fb46876c.845298","98eeafa7.bd2b9","565ee5c1.561bfc","22a20603.86a06a","a8d96e.1f00969","808e6a81.92e2e8","883f2c00.1d94e8","e42ff3d9.593dc","76160bc4.8cd644","e2c37b65c5582c2b","860a4c61d7557dc9"],"x":54,"y":259,"w":1452,"h":262},{"id":"a9182c2cc04d2d9a","type":"group","z":"f602e6ba.609d28","name":"Irrigation Delays","style":{"label":true},"nodes":["dd9855ca4017c8c0","c3a696a117416327","27f2580e35031830","9cb8187c669c6485","47f1a8018e58e032","427f7fa58d86cc59","1d9a4d0bb4645f32","d9ebbaa37f5911a9","eeecfc1e8864e39f","89487a4efedec1db","1e4b3bc7c25b294f","2c45af5b3ee5cf0a","d7e50e7a2810667d","28936ec687ee4eb0","974833b6a2eca853","478a5a84d38ba181","c01fd0612615e927","93965a61d2c4f5de","c3cb1c7d15767014"],"x":54,"y":539,"w":752,"h":502},{"id":"0f07749a4e1672ad","type":"group","z":"f602e6ba.609d28","name":"Supply Voltage Control","style":{"label":true},"nodes":["1ae21386.a831bc","117145a7.67e99a","882aff35f788008b"],"x":54,"y":1059,"w":472,"h":142},{"id":"a08dae6118c91c19","type":"group","z":"f602e6ba.609d28","name":"Run Lawn","style":{"label":true},"nodes":["f2c9c3a5b8b11a64","9896327569c234da","e95ac52f03478921","174186fb5d054240","287dd3b1af5dc2d0","74cd40702021e86d","bf015af2161c5ec2","151eb6ba5b2d39cd","45ee74d06e9cac2c","95a54981805b22f2","a4b3eba196a504dc","02d1e639f7ac6596","8d3c8370996be2da","863b8fa63f210ebe","7d8374976c01e3dc","b0debe46542c4c67","de509d99b9d965b3","b1c9631973c2f4b1","6ea0448df1383ec2","224d30a98f52c287","5a27d31bfb4a6990","197853479ad9eeda","7b985932412db47d","acdcc72fea065aac","38affe5cc680d076","8f83c8d1d4492be0"],"x":54,"y":2019,"w":1272,"h":522},{"id":"79694877249c9902","type":"group","z":"f602e6ba.609d28","name":"Attempt Lawn","style":{"label":true},"nodes":["3b656b89.1ac154","493b435f.c9851c","7b12e66f.57d068","8c060f00.cf577","4422f61c.847d88","dcdeabc7.780578","722d03d6.2ff77c","af4788fe.215ba8","c90fd5e6.c5c678","862ad27a.d347d","83edf648.3f9ed8","8d4bfe8e.ee805","815fddc0.6604c","06d6255efdc31c47","5420d0eed32223fb","3ff9ce03ef7b554b","576b66fa1bd202a3","a3d75225807b70eb","219b37105a8304f1","e7430e17f0b24ed8","b6e7d5b8891bba6d","339ee0ada21856e0","d01fbafafbb34692","f5684be88477322f","336585d4eee0ca73","b3c4a3638c17629e","2fc67b25514de5a5","08e3098cf183e086"],"x":54,"y":1219,"w":672,"h":782},{"id":"68ec980b932fdba7","type":"group","z":"f602e6ba.609d28","name":"Attempt Front Beds","style":{"label":true},"nodes":["583f46a3.fc4c38","d9147878.b61cf8","c7e5552e.7f8a08","6bcf06fb.9ca748","f587589f.d739e8","d9d17e8f.590e6","d9f893eb.834f3","9d851699.6a8458","4fae5b92.a9cd44","418058c4.af3158","7350c911a0b1a86d","fdcfa1521191fa40","4f2902edc77f2d3b","f6881b4bf93c27c5","ed6e3d4225582e20","593bee0e8c958df8","67916c3a5554a794","f7ac7a90f3da2298","45c5dbbbd8ce50a1","abb8777dd08aa743","d8637d8d96b68fca","b403eec7866aea22"],"x":54,"y":2559,"w":672,"h":582},{"id":"55a2162532da4e14","type":"group","z":"f602e6ba.609d28","name":"Run Front Beds","style":{"label":true},"nodes":["a2ab7368.923fb","a31e3daf.17207","21ced698.708b5a","c661d489.9c9bc8","accc6697.196268","487ff788.8c5c98","2238b09b.1b5b5","84258ddd.41da4","9129b06e.d8925","5ce1803b.06628","aa53225140781dd7","8113d83074ff7701","d83b5ff7a2212931","f78cdb84200eb171","62b5545bc6d6e627","0fe0d325194604dd"],"x":54,"y":3159,"w":1332,"h":262},{"id":"59ea88a27ef998e7","type":"group","z":"9584418c.dafc2","name":"Drone Delivery Logo Object Detection","style":{"label":true},"nodes":["4e2d750742dc8890","cdc9c2c982e3fe5f","300267d7c89b0955","1ae58f8afe36e04c","5c59c5c412e759ce","aa523c5cbfe26949","b4392caec775b305","81d6e9a99eb61c67","8bec0433aa6e51fa","1aa9e39b6be88864","ec51454057c055e2","765c7c5a61100728","1bda1e8b7f76e5f3","14855ff357d5fbad","a95b4fa60f1238d7","081d788e92e34986","9799e777bb06f63f","6d56b297fcfe0016","2f18405339079200","b4d7bb6e129bacea","b442c20392c7ce60","ec6b4698123ebc34"],"x":54,"y":2439,"w":1412,"h":282},{"id":"cb7e3560a0078392","type":"group","z":"9584418c.dafc2","name":"Global Entry Schedule","style":{"label":true},"nodes":["5123f652827fa902","970920516fa379e8","51f2291060d07336","91d3d26774f9468e","7415468104c18108","b8a4a1ee4e15f778","79c00f8c61888f52","a61d605915dc23ff","c44a5c4d6d17ee9f","fa9f2ef8fecf1de2","7d01abce7bc68291","b7c50947c4507d03","1480d9470754a6a3","ca8d58af48d7b7c5","414a38bf0735b27c","c0546e86d17e99e9","d5ab0aa6d198ba81","88d3b091fc333998","1b266e9b338a4dfe","85644b2ab18e7141","041a81d375ec985d","bfbece91f0b61e8b","f3b23466b80725e0"],"x":54,"y":2739,"w":1102,"h":342},{"id":"26b2ac79d4c32bda","type":"group","z":"9584418c.dafc2","name":"Timelapse","style":{"label":true},"nodes":["83e2179938d08d58","59e4459459f077c9","089b07fa48286f29","7ff9bf1a917cbf50","a826a8c498d6d1e3"],"x":54,"y":3099,"w":612,"h":262},{"id":"6f393a92ae952332","type":"group","z":"9584418c.dafc2","name":"Faucet Auto Drip","style":{"label":true},"nodes":["08b26d8311cd9187","716e8fabff85ffb9","7b988b93a658f526","7fe1e564efbd46af","16e1a3e2f53e6bdf","d85faf19968afde1"],"x":54,"y":3379,"w":1032,"h":202},{"id":"e28fc796ce042622","type":"group","z":"9584418c.dafc2","name":"Generic Listener to Push Notifications from SMTP Inbox","style":{"label":true},"nodes":["7eb1a3d60fccbc76","cb1f141562c8fd2b","1cd709e001bf5e89","7f48460e08988c9e","24fc1882c8436738"],"x":54,"y":3599,"w":892,"h":142},{"id":"445e81780ba935ac","type":"group","z":"9584418c.dafc2","name":"License Plate Garage Door","style":{"label":true},"nodes":["5caa1a9942bc27ee","9b25e9a8817a7d8e","7c060a1e3c0ff12e","4fc565f7b86648dc","220bca8570d66770","184d6d5272648136","500ee424e3f6b6a1","6f27f3028b1805e2","004c0ae121925ea2","5218eca8a79a79a5","1fce953ec4b1ee3d","8c5272ae89e85e74","8067ec66aa846765","6648e0bdaa2d8170","18d9178fd318e333","b70d2ca780b98259","75bc8ac5d1afe28f"],"x":54,"y":3899,"w":1292,"h":242},{"id":"516939e66b0b3d5d","type":"group","z":"9584418c.dafc2","name":"QR Door Opener","style":{"label":true},"nodes":["4e761223bbb97b8d","4882c608e1fa69c7","72737cfc3371b80f","6cecf24fbf959b73","cde6c9446e054107","54c1081f98fd1945","519990f56ae7a4e9","8db5019cab97ba65","dd24955fcf11d0b8","6084ebe4fee0af4d","a8e5d53fc40fcf3c","28e26da9f431b399","a4574f947fc3c876","58c162476af5c2df","02dca310d30d41ec","e422bd64e999decb","fc7cc6d0b1911358"],"x":54,"y":4179,"w":1132,"h":302},{"id":"7a1cb951d36ebc37","type":"group","z":"9584418c.dafc2","name":"QR Send","style":{"label":true},"nodes":["e1a4ef361b9fc7ff","b6dbca53c840164c","38010b7e5f85b9f6","4c8457c87150cbf8","e073799764f16bc0","aa0e87207265845d","06871bb32f66c1ab","d0cd45ceef8e8641","e3b312790143d451","523a5be045f29150","10bf2ad7f818bba5","a6187e2d761f18bd","6d38c8b88ab6e9b1"],"x":54,"y":4519,"w":1032,"h":162},{"id":"e1dc0b88.463bb8","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"546e31ed.0db1c","type":"mqtt-broker","name":"Mosquitto","broker":"10.0.1.22","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"9f81fd881d01a666","type":"position-config","name":"","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""},{"id":"4f8f8feffed26998","type":"sqlitedb","db":"/data/amazon.db","mode":"RWC"},{"id":"96b8babe5c0a6107","type":"deepstack-server","proto":"http","host":"codeproject","port":"32168","version":"v1","rejectUnauthorized":true},{"id":"27555ce732fc54b0","type":"global-config","name":"global-config","env":[{"name":"bb_pass","value":"PASSWORD","type":"str"},{"name":"bb_number","value":"19402326788","type":"str"},{"name":"plate_andrew","value":"BNW7211","type":"str"},{"name":"qr_code","value":"zZxJ2GWG9W4MusFQ","type":"str"}]},{"id":"169e2bac20a4c980","type":"deepstack-server","proto":"http","host":"codeproject","port":"32168","version":"v1/vision/alpr","rejectUnauthorized":true},{"id":"2022689a.938918","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper: Opened 1 Minute","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"The \" & $lowercase(msg.data.new_state.attributes.friendly_name) & \" has been opened for 1 minute\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":120,"wires":[[]]},{"id":"8ec438b6.4eb2e8","type":"api-current-state","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Door Notify On","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"input_boolean.door_notify","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":60,"wires":[["c5124616.c9bd48"],[]]},{"id":"9c1d9c7c.ed9c7","type":"change","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Reset If Closed","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":220,"wires":[["5c24f744.30fcb8","cf758271.d4fd6","5a740c2d.009864","28fa66cd.af058a"]]},{"id":"896f5b34.7b4328","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload, \"data\": {\"priority\": 1} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":950,"y":60,"wires":[[]]},{"id":"c5124616.c9bd48","type":"template","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Opened","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{ data.new_state.attributes.friendly_name }} opened","output":"str","x":740,"y":60,"wires":[["896f5b34.7b4328"]]},{"id":"f9d93af6.184028","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Door Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.*_door$","entityIdType":"regex","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":100,"wires":[["8ec438b6.4eb2e8","5c24f744.30fcb8","cf758271.d4fd6","5a740c2d.009864","28fa66cd.af058a"],["9c1d9c7c.ed9c7"]]},{"id":"73550501.be7fbc","type":"trigger-state","z":"9584418c.dafc2","d":true,"g":"9df353d4c0fc9a54","name":"Rack Temperature","server":"e1dc0b88.463bb8","version":4,"inputs":1,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.rack_exhaust_temperature","entityIdType":"exact","debugEnabled":false,"constraints":[],"customOutputs":[],"outputInitially":false,"stateType":"num","enableInput":true,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":170,"y":560,"wires":[["7dff3ae1.e36a04"],[]]},{"id":"7dff3ae1.e36a04","type":"switch","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Above 90?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"95","vt":"num"},{"t":"lte","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":560,"wires":[["29b17ed7.fab972"],["96b5207d.407dd"]]},{"id":"88822bfe.2cc598","type":"api-call-service","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Turn on Fan","server":"e1dc0b88.463bb8","version":5,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["fan.rack_fan"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":710,"y":500,"wires":[[]]},{"id":"96b5207d.407dd","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack Fan","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"fan.rack_fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":580,"wires":[["c7ff978f.ff0728"],[]]},{"id":"b259f0eb.3e83","type":"api-call-service","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Turn off fan","server":"e1dc0b88.463bb8","version":5,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["fan.rack_fan"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":890,"y":540,"wires":[[]]},{"id":"e93027cb.6a6308","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Master Bedroom Lamps On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.master_bedroom_lamps","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":680,"y":702,"wires":[["fc81cfda.29ff5"],[]]},{"id":"fc81cfda.29ff5","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 128","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"128\",\"transition\":5, \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1001,"y":700,"wires":[[]]},{"id":"c7ff978f.ff0728","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack fan auto off?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.rack_fan_auto_off","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":730,"y":600,"wires":[["b259f0eb.3e83"],[]]},{"id":"29b17ed7.fab972","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack Fan","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"fan.rack_fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":520,"wires":[[],["88822bfe.2cc598"]]},{"id":"3314ec9f.ca8994","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Garage Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"cover.garage_door","entityIdType":"regex","outputInitially":false,"stateType":"str","ifState":"open","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":160,"wires":[["8ec438b6.4eb2e8"],[]]},{"id":"8ee35d65.a7569","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Cans On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_can_lights","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":942,"wires":[["5420f9c0.5356c8"],[]]},{"id":"41b918d5.7ce018","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Table On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_table_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":1062,"wires":[["d8ad0651.bf7a18"],[]]},{"id":"5420f9c0.5356c8","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 40","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"40\",\"transition\": \"5\", \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":842,"wires":[[]]},{"id":"77184c93.8790d4","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Sink On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_sink_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":882,"wires":[["5420f9c0.5356c8"],[]]},{"id":"39a5ce57.78e3d2","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Living Room Cans On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.living_room_can_lights","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":670,"y":822,"wires":[["5420f9c0.5356c8"],[]]},{"id":"5c24f744.30fcb8","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 5m","op1":"","op2":"5","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":160,"wires":[["6aa388d0.707768","aee87977a0670889"]]},{"id":"6aa388d0.707768","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Alexa Announce Opened","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"The\" & $lowercase(msg.data.new_state.attributes.friendly_name) & \"has been opened for\" & msg.payload & \" minutes.\",\"data\":{\"method\":\"all\",\"type\":\"announce\"},\"target\":[\"Office\",\"Kitchen\",\"Master\",\"Living Room\"]}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":220,"wires":[[]]},{"id":"cf758271.d4fd6","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 10m","op1":"","op2":"10","op1type":"nul","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":200,"wires":[["6aa388d0.707768"]]},{"id":"5a740c2d.009864","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 15m","op1":"","op2":"15","op1type":"nul","op2type":"str","duration":"15","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":240,"wires":[["6aa388d0.707768"]]},{"id":"ea19fe14.80749","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Entryway On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.entryway_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":640,"y":1002,"wires":[["5420f9c0.5356c8"],[]]},{"id":"ea2604f9.4cdf98","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Living Room Sconces On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.living_room_sconces","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":680,"y":762,"wires":[["fc81cfda.29ff5"],[]]},{"id":"8a82f465.846018","type":"comment","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"100% = 255","info":"","x":970,"y":773,"wires":[]},{"id":"d8ad0651.bf7a18","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 80","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"80\",\"transition\": \"5\", \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":922,"wires":[[]]},{"id":"86bc310cbc0562af","type":"inject","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"At 10:30PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1200,"wires":[["2fb6a7afb6502a32","8c55985bffebd56a"]]},{"id":"2fb6a7afb6502a32","type":"api-call-service","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"Front Porch Lights Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":400,"y":1220,"wires":[[]]},{"id":"3f2a2e4d99057b69","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Motion","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door_all_occupancy","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1380,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"3e399d83e4e7f4c3","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Porch Lights to 254","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{\"brightness\":\"254\",\"transition\":2}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":710,"y":1360,"wires":[["1ef176bec8ed5da0","59f5bc2571b0f12f"]]},{"id":"59f5bc2571b0f12f","type":"delay","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":560,"y":1440,"wires":[["c68c969a6b8c2833"]]},{"id":"c68c969a6b8c2833","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Porch Lights Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":780,"y":1440,"wires":[["254a48eabb9cf476"]]},{"id":"d9cc182cc3eb2a93","type":"inject","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"At 10 PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 22 * * 3","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":742,"wires":[["1457bf6605a50448"]]},{"id":"b1a99d9698d831b2","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Open","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":1440,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"17b35d69307a8455","type":"within-time-switch","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"22:30","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"sunriseStart","endTimeType":"pdsTime","endOffset":"-30","endOffsetType":"num","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"","withinTimeValueType":"msgInput","outOfTimeValue":"","outOfTimeValueType":"msgInput","tsCompare":"0","x":400,"y":1380,"wires":[["3e399d83e4e7f4c3"],[]]},{"id":"d11c183fff8d848d","type":"change","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1440,"wires":[["59f5bc2571b0f12f"]]},{"id":"a9a323de66b6f772","type":"http request","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Get Aircraft","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://vrs:8080/VirtualRadar/AircraftList.json","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/json"}],"x":610,"y":1660,"wires":[["7da69a7e8ecadc7c","91afebbf8b9edf05","4ca1a5ad47ce7a18","2cd08c8da06afaf6","43e5fa289c7550ff"]]},{"id":"ee139512bcad0966","type":"inject","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Every 20 Seconds","props":[],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":1660,"wires":[["ea239028eda07991"]]},{"id":"7da69a7e8ecadc7c","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Amazon","func":"var alert = {}\nvar message = \"Airborne:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Man !== \"undefined\") {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":1660,"wires":[["5684b08aacd6d225"]]},{"id":"26e32b1d7824356a","type":"api-call-service","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_adsb","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":1660,"wires":[[]]},{"id":"3a82b835.c57d48","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1600,"wires":[["26e32b1d7824356a"]]},{"id":"91afebbf8b9edf05","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Interesting Tail #","func":"var alert = {}\nvar message = \"Interesting:\\n\"\n// N518GS George Strait\n// N628TS Elon\n// N898TS Taylor Swift\n// N621MM Taylor Swift\n// 82-8000 AF1\n// 92-9000 AF1\n// N5DA Don Adams Prop\n// N4DA Don Adams Lear\n// N68885 Zuckerberg\n// N681JK JB\n// N635PA\n// N628PA\n// N636PA\nvar interesting = [\"N68885\", \"N518GS\", \"N628TS\", \"82-8000\", \"92-9000\", \"N621MM\", \"N898TS\", \"N681JK\", \"N635PA\", \"N628PA\", \"N636PA\"]\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\") {\n if (interesting.includes(msg.payload.acList[i].Reg)) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":1600,"wires":[["3a82b835.c57d48"]]},{"id":"5684b08aacd6d225","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1660,"wires":[["26e32b1d7824356a"]]},{"id":"4ca1a5ad47ce7a18","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Amazon Landing","func":"var alert = {}\nvar message = \"Landing:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Man !== \"undefined\") {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Alt < 50){\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":1720,"wires":[["ba68e03143ba4af8"]]},{"id":"ba68e03143ba4af8","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1720,"wires":[["26e32b1d7824356a"]]},{"id":"5f1d1b471a1c7cbb","type":"sqlite","z":"9584418c.dafc2","g":"35da177d9e2fd258","mydb":"4f8f8feffed26998","sqlquery":"msg.topic","sql":"","name":"Amazon","x":1000,"y":1780,"wires":[["ea911291f04c7d18"]]},{"id":"2cd08c8da06afaf6","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Write Amazon Landing","func":"var sql = \"\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n var latlong = \"0,0\"\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Lat !== \"undefined\" && typeof msg.payload.acList[i].Long !== \"undefined\") {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Alt < 50){\n latlong = msg.payload.acList[i].Lat + \",\" + msg.payload.acList[i].Long.toString()\n sql += `INSERT INTO deliveries (timestamp, registration, latlong, altitude) VALUES (\"${Date.now()}\", \"${msg.payload.acList[i].Reg}\", \"${latlong}\", \"${msg.payload.acList[i].Alt}\"); `\n }\n }\n }\n}\n\nif (sql.length > 0){\n msg.topic = sql\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":1780,"wires":[["5f1d1b471a1c7cbb"]]},{"id":"ea911291f04c7d18","type":"api-call-service","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Generate Heatmap","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"shell_command","service":"generate_heatmap","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":1780,"wires":[[]]},{"id":"cde7b3c9ca39891b","type":"link in","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"","links":["1457bf6605a50448"],"x":325,"y":722,"wires":[["e93027cb.6a6308","ea2604f9.4cdf98","39a5ce57.78e3d2","77184c93.8790d4","8ee35d65.a7569","ea19fe14.80749","41b918d5.7ce018"]]},{"id":"1457bf6605a50448","type":"link out","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"","links":["cde7b3c9ca39891b"],"x":295,"y":722,"wires":[]},{"id":"8c55985bffebd56a","type":"api-call-service","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"Front Sconces Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_sconces"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1160,"wires":[[]]},{"id":"fae7fa701710e258","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Unlock","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"lock.front_door","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"unlocked","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1320,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"ebe84a6f70b4bc2f","type":"inject","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Every 30 Minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":340,"wires":[["830c3ddd08ef396c"]]},{"id":"cf1c689e51b98aec","type":"api-current-state","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Thermostat Idle","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"Idle","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.thermostat_state","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":340,"wires":[["6af7abba85612dd9"],[]]},{"id":"6af7abba85612dd9","type":"function","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Idle > 2 hours","func":"// If last changed > 3 hours\nif (parseInt(msg.payload.timeSinceChangedMs) > 3600000*2) {\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":400,"wires":[["8b6280c5c448720c"]]},{"id":"8b6280c5c448720c","type":"api-call-service","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Turn AC Fan on Low","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":[],"entityId":["climate.thermostat"],"data":"{\"fan_mode\":\"low\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":340,"wires":[["9ce46ce21d8cc964"]]},{"id":"9ce46ce21d8cc964","type":"delay","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":900,"y":400,"wires":[["2b6721107586ceae"]]},{"id":"2b6721107586ceae","type":"api-call-service","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Turn AC Fan on Auto","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":[],"entityId":["climate.thermostat"],"data":"{\"fan_mode\":\"auto\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":340,"wires":[[]]},{"id":"830c3ddd08ef396c","type":"api-current-state","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Attic > 100","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"100","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.netatmo_home_attic_temperature","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"attic","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":290,"y":400,"wires":[["cf1c689e51b98aec"],[]]},{"id":"43e5fa289c7550ff","type":"function","z":"9584418c.dafc2","d":true,"g":"35da177d9e2fd258","name":"Speedy","func":"var alert = {}\nvar message = \"Speedy:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\") {\n if (typeof msg.payload.acList[i].Spd == \"number\") {\n if (msg.payload.acList[i].Spd > 600) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":1540,"wires":[["97761f13f8e5c31b"]]},{"id":"97761f13f8e5c31b","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1540,"wires":[["26e32b1d7824356a"]]},{"id":"ed80a3f.522526","type":"server-state-changed","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Vehicle Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.street_car_count","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"1","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":2200,"wires":[["f93c269fdb777a65"],[]]},{"id":"f3a3e80f.3e8e38","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n event_id: msg.event_id,\n loops: msg.loops\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":2200,"wires":[["e263410e9a3af7d8"]]},{"id":"6f08d11c854dfb00","type":"file","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Write File","filename":"/data/logo.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1000,"y":2260,"wires":[["b2a5543693ac851e"]]},{"id":"9b7c5535c74a94a3","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Output msg","func":"msg = {\n payload: msg.outlinedImage,\n detection_result: msg.payload[0].label,\n event_id: msg.event_id\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":2260,"wires":[["6f08d11c854dfb00"]]},{"id":"d8a16fd91366d112","type":"switch","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Match Found","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":2260,"wires":[["63fd5090444c9cad"]]},{"id":"bcaf3569e7816922","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Get Events","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events?cameras=driveway&labels=car&has_snapshot=1&zones=street&in_progress=1&limit=1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":350,"y":2200,"wires":[["d58f6ef71c326040"]]},{"id":"d58f6ef71c326040","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Extract Event ID","func":"if (JSON.parse(msg.payload).length > 0) {\n msg = {\n event_id: JSON.parse(msg.payload)[0].id,\n };\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":2200,"wires":[["c13f0f20a56d6af5"]]},{"id":"bd19a17005513c2f","type":"inject","z":"9584418c.dafc2","g":"3c4349a7eea9bd3b","name":"Every 15 Minutes","props":[],"repeat":"900","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":1940,"wires":[["24d1a94e275e5e44","ab66afa5b576de3f","7a8e43b6f7c84bac","58d0c98797e19829","ccf5998fdf8ee50d"]]},{"id":"24d1a94e275e5e44","type":"http request","z":"9584418c.dafc2","g":"3c4349a7eea9bd3b","name":"Set Doorbell Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.34/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":410,"y":2000,"wires":[[]]},{"id":"42be35f83b764861","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Add SubLabel","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/{{{event_id}}}/sub_label","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1320,"y":2340,"wires":[[]]},{"id":"b2a5543693ac851e","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Detection to payload","func":"var new_msg = {\n payload: { \"subLabel\": msg.detection_result },\n detection_result: msg.detection_result,\n event_id: msg.event_id\n};\nvar msg = new_msg\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1180,"y":2260,"wires":[["42be35f83b764861"]]},{"id":"c13f0f20a56d6af5","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=driveway&h=1000","tls":"","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":730,"y":2200,"wires":[["f3a3e80f.3e8e38"]]},{"id":"7151828122e3b80c","type":"deepstack-custom-model","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post to Deepstack","server":"96b8babe5c0a6107","confidence":"60","customModel":"delivery","drawPredictions":true,"outlineColor":"red","custom":"","outputs":1,"x":190,"y":2260,"wires":[["5acbb2cbdbdea368","bace446bfa7b343d"]]},{"id":"ea239028eda07991","type":"within-time-switch","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"08:00:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"21:00:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":410,"y":1660,"wires":[["a9a323de66b6f772"],[]]},{"id":"58d0c98797e19829","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 1 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1880,"wires":[[]]},{"id":"7a8e43b6f7c84bac","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 2 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.33/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1920,"wires":[[]]},{"id":"ab66afa5b576de3f","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 3 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.35/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1960,"wires":[[]]},{"id":"ccf5998fdf8ee50d","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set PTZ Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.36/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":400,"y":2040,"wires":[[]]},{"id":"1ef176bec8ed5da0","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Doorbell Ring Light On","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.front_door_ring_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1020,"y":1340,"wires":[[]]},{"id":"254a48eabb9cf476","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Doorbell Ring Light Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_door_ring_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1020,"y":1440,"wires":[[]]},{"id":"4e2d750742dc8890","type":"server-state-changed","z":"9584418c.dafc2","d":true,"g":"59ea88a27ef998e7","name":"Drone Motion Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.drone_detect_motion","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":2480,"wires":[["9799e777bb06f63f"],[]]},{"id":"cdc9c2c982e3fe5f","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n loops: msg.loops\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2480,"wires":[["b4392caec775b305"]]},{"id":"300267d7c89b0955","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Deepstack Output","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":2620,"wires":[]},{"id":"1ae58f8afe36e04c","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:5000/api/bullet/latest.jpg?quality=100","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":670,"y":2480,"wires":[["cdc9c2c982e3fe5f"]]},{"id":"5c59c5c412e759ce","type":"deepstack-custom-model","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Post to Deepstack","server":"96b8babe5c0a6107","confidence":"40","customModel":"delivery","drawPredictions":true,"outlineColor":"red","custom":"","outputs":1,"x":190,"y":2540,"wires":[["300267d7c89b0955","aa523c5cbfe26949","2f18405339079200"]]},{"id":"aa523c5cbfe26949","type":"image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","width":"800","data":"outlinedImage","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":200,"y":2680,"wires":[[]]},{"id":"b4392caec775b305","type":"jimp-image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","data":"payload","dataType":"msg","ret":"buf","parameter1":"380","parameter1Type":"num","parameter2":"0","parameter2Type":"num","parameter3":"170","parameter3Type":"num","parameter4":"170","parameter4Type":"num","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":4,"jimpFunction":"crop","selectedJimpFunction":{"name":"crop","fn":"crop","description":"crop to the given region","parameters":[{"name":"x","type":"num","required":true,"hint":"the x coordinate to crop form"},{"name":"y","type":"num","required":true,"hint":"the y coordinate to crop form"},{"name":"w","type":"num","required":true,"hint":"the width of the crop region"},{"name":"h","type":"num","required":true,"hint":"the height of the crop region"}]},"x":1050,"y":2480,"wires":[["5c59c5c412e759ce","081d788e92e34986"]]},{"id":"81d6e9a99eb61c67","type":"switch","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Match Found","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":2540,"wires":[["8bec0433aa6e51fa"]]},{"id":"8bec0433aa6e51fa","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Output msg","func":"var oldmsg = msg;\n\nmsg = {\n payload: msg.outlinedImage,\n detection_result: msg.payload[0].label,\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2540,"wires":[["1aa9e39b6be88864","b4d7bb6e129bacea"]]},{"id":"1aa9e39b6be88864","type":"file","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Write File","filename":"/data/logo.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1060,"y":2540,"wires":[["ec51454057c055e2"]]},{"id":"ec51454057c055e2","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Detection to payload","func":"var new_msg = {\n payload: { \"subLabel\": msg.detection_result },\n detection_result: msg.detection_result,\n event_id: msg.event_id\n};\nvar msg = new_msg\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":2540,"wires":[["6d56b297fcfe0016"]]},{"id":"765c7c5a61100728","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Create Event","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/drone_detect/PrimeAir/create","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1270,"y":2600,"wires":[[]]},{"id":"1bda1e8b7f76e5f3","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Create Event","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/back_porch/PrimeAir/create","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1270,"y":2640,"wires":[[]]},{"id":"14855ff357d5fbad","type":"mqtt out","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","topic":"frigate/events","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"546e31ed.0db1c","x":1360,"y":2680,"wires":[]},{"id":"a95b4fa60f1238d7","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Build MQTT","func":"msg.payload = {'type':'update', 'after':{'label':'PrimeAir'}}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":2680,"wires":[["14855ff357d5fbad"]]},{"id":"081d788e92e34986","type":"image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1000,"y":2680,"wires":[[]]},{"id":"9799e777bb06f63f","type":"within-time-switch","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"08:30:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"15:30:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":430,"y":2480,"wires":[["1ae58f8afe36e04c"],[]]},{"id":"6d56b297fcfe0016","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Rate Limiter","func":"var interval = (1000*30); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":2600,"wires":[["a95b4fa60f1238d7","1bda1e8b7f76e5f3","765c7c5a61100728","b442c20392c7ce60"]]},{"id":"2f18405339079200","type":"while-loop","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Loop \"payload.length == 0\"","condi":"msg.payload.length == 0","limit":true,"limitTime":"10","time":"loops","timeType":"msg","x":460,"y":2540,"wires":[["81d6e9a99eb61c67"],["1ae58f8afe36e04c"]]},{"id":"bace446bfa7b343d","type":"while-loop","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Loop \"msg.payload.length == 0\"","condi":"msg.payload.length == 0","limit":true,"limitTime":"4","time":"loops","timeType":"msg","x":240,"y":2340,"wires":[["d8a16fd91366d112"],["c13f0f20a56d6af5"]]},{"id":"b4d7bb6e129bacea","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Write Match Image","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":740,"y":2600,"wires":[]},{"id":"b442c20392c7ce60","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Call Frigate API","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":2680,"wires":[]},{"id":"5acbb2cbdbdea368","type":"image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","width":"800","data":"outlinedImage","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":200,"y":2380,"wires":[[]]},{"id":"c061be05c01527e0","type":"image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1060,"y":2380,"wires":[[]]},{"id":"ec6b4698123ebc34","type":"inject","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Manually Create Event","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1280,"y":2480,"wires":[["6d56b297fcfe0016"]]},{"id":"e263410e9a3af7d8","type":"jimp-image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","data":"payload","dataType":"msg","ret":"buf","parameter1":"650","parameter1Type":"num","parameter2":"0","parameter2Type":"num","parameter3":"625","parameter3Type":"num","parameter4":"130","parameter4Type":"num","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":4,"jimpFunction":"crop","selectedJimpFunction":{"name":"crop","fn":"crop","description":"crop to the given region","parameters":[{"name":"x","type":"num","required":true,"hint":"the x coordinate to crop form"},{"name":"y","type":"num","required":true,"hint":"the y coordinate to crop form"},{"name":"w","type":"num","required":true,"hint":"the width of the crop region"},{"name":"h","type":"num","required":true,"hint":"the height of the crop region"}]},"x":1110,"y":2200,"wires":[["7151828122e3b80c","a12e93d199527cae","c061be05c01527e0"]]},{"id":"5123f652827fa902","type":"inject","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2860,"wires":[["970920516fa379e8","88d3b091fc333998"]]},{"id":"970920516fa379e8","type":"http request","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"PHX","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://ttp.cbp.dhs.gov/schedulerapi/slot-availability?locationId=7160","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":2860,"wires":[["51f2291060d07336"]]},{"id":"51f2291060d07336","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"11/07","func":"var oldmsg = msg;\nvar match = false\nvar slots = ''\n\nfor (var i = 0; i < msg.payload.availableSlots.length; i++) {\n if (msg.payload.availableSlots[i].startTimestamp.includes('2023-11-07')){\n console.log(msg.payload.availableSlots[i].startTimestamp)\n slots += msg.payload.availableSlots[i].startTimestamp + ' '\n match = true\n }\n}\n\nmsg = {\n payload: \"PHX: \" + slots + \"https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n 'match': match\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2860,"wires":[["7415468104c18108","a61d605915dc23ff"]]},{"id":"91d3d26774f9468e","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"HOU","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2820,"wires":[]},{"id":"7415468104c18108","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"PHX","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2900,"wires":[]},{"id":"b8a4a1ee4e15f778","type":"api-call-service","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": msg.payload\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2860,"wires":[[]]},{"id":"79c00f8c61888f52","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"match","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2780,"wires":[["c44a5c4d6d17ee9f"]]},{"id":"a61d605915dc23ff","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"match","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2860,"wires":[["fa9f2ef8fecf1de2"]]},{"id":"c44a5c4d6d17ee9f","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*600); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2780,"wires":[["d5ab0aa6d198ba81"]]},{"id":"fa9f2ef8fecf1de2","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*600); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2860,"wires":[["b8a4a1ee4e15f778"]]},{"id":"7d01abce7bc68291","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"All","func":"var oldmsg = msg;\nvar slots = msg.payload.availableSlots\n\n// Pass message if slots not empty\nif(slots.length > 0){\n msg.message = slots[0].startTimestamp\n return msg;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2940,"wires":[["1480d9470754a6a3","b7c50947c4507d03"]]},{"id":"b7c50947c4507d03","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2940,"wires":[["ca8d58af48d7b7c5","414a38bf0735b27c"]]},{"id":"1480d9470754a6a3","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"DAL","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2980,"wires":[]},{"id":"ca8d58af48d7b7c5","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*120); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2940,"wires":[["414a38bf0735b27c","bfbece91f0b61e8b"]]},{"id":"414a38bf0735b27c","type":"api-call-service","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Dallas https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2940,"wires":[[]]},{"id":"c0546e86d17e99e9","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"11/03","func":"var oldmsg = msg;\nvar match = false\nvar slots = ''\n\nfor (var i = 0; i < msg.payload.availableSlots.length; i++) {\n if (msg.payload.availableSlots[i].startTimestamp.includes('2023-11-03')){\n console.log(msg.payload.availableSlots[i].startTimestamp)\n slots += msg.payload.availableSlots[i].startTimestamp + ' '\n match = true\n }\n}\n\nmsg = {\n payload: \"HOU: \" + slots + \"https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n 'match': match\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2780,"wires":[["91d3d26774f9468e","79c00f8c61888f52"]]},{"id":"d5ab0aa6d198ba81","type":"api-call-service","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": msg.payload\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2780,"wires":[[]]},{"id":"83e2179938d08d58","type":"api-call-service","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Timelapse Snapshots","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"camera","service":"snapshot","areaId":[],"deviceId":[],"entityId":["camera.back_porch","camera.bullet","camera.driveway","camera.front_door"],"data":"{\"filename\":\"/config/media/images/{{ entity_id.entity_id }}/{{ now().strftime('%Y%m%d-%H%M%S') }}.webp\"}","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":540,"y":3220,"wires":[[]]},{"id":"59e4459459f077c9","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dawn End","nameInt":"⏲ golden hour dawn end = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":200,"y":3140,"wires":[["83e2179938d08d58"]]},{"id":"089b07fa48286f29","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dusk Start","nameInt":"⏲ golden hour dusk start = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDuskStart","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":200,"y":3320,"wires":[["83e2179938d08d58"]]},{"id":"7ff9bf1a917cbf50","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dusk Start - 3h","nameInt":"⏲ golden hour dusk start↶ = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDuskStart","timeType":"pdsTime","offset":"-3","offsetType":"num","offsetMultiplier":3600000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":3260,"wires":[["83e2179938d08d58"]]},{"id":"a826a8c498d6d1e3","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dawn End + 3h","nameInt":"⏲ golden hour dawn end↷ = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDawnEnd","timeType":"pdsTime","offset":"3","offsetType":"num","offsetMultiplier":3600000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":3200,"wires":[["83e2179938d08d58"]]},{"id":"c5c85c0aa2d8c8ca","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Safe Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.large_safe","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":530,"y":80,"wires":[["c5124616.c9bd48"],[]]},{"id":"fa90c550.d6c948","type":"inject","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"At 8 PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 20 * * 1,2,4,5,6,0","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":700,"wires":[["1457bf6605a50448"]]},{"id":"08b26d8311cd9187","type":"inject","z":"9584418c.dafc2","d":true,"g":"6f393a92ae952332","name":"Every 5 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":3480,"wires":[["716e8fabff85ffb9","7b988b93a658f526","d85faf19968afde1"]]},{"id":"716e8fabff85ffb9","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Attic Temperature < 34","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"34","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.netatmo_home_attic_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":3420,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"7b988b93a658f526","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Thermostat Outdoor Temperature <= 35","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"35","halt_if_type":"num","halt_if_compare":"lte","entity_id":"sensor.thermostat_outdoor_ambient_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":480,"y":3480,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"7fe1e564efbd46af","type":"api-call-service","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Turn on Faucet Drip","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.bhyve_1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":3480,"wires":[[]]},{"id":"16e1a3e2f53e6bdf","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Faucet Drip Off?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bhyve_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":3480,"wires":[["7fe1e564efbd46af"],[]]},{"id":"d85faf19968afde1","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Compost External Temperature < 34","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"34","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.compost_external_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":3540,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"504a90c2bb116cda","type":"inject","z":"9584418c.dafc2","name":"On Demand","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":690,"y":1920,"wires":[["f7c82af0e299c914"]]},{"id":"f7c82af0e299c914","type":"http request","z":"9584418c.dafc2","name":"Enable Overlay","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].EncodeBlend=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":900,"y":1920,"wires":[[]]},{"id":"aa9d132ce4c33794","type":"http request","z":"9584418c.dafc2","name":"Set Overlay Text","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text={{{payload}}}°F","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":1140,"y":1980,"wires":[[]]},{"id":"8f9a073f4ebb3133","type":"inject","z":"9584418c.dafc2","name":"On Demand */5","props":[],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":700,"y":1980,"wires":[["446f812e8b1f4307"]]},{"id":"acd933c5c0eddc8b","type":"http request","z":"9584418c.dafc2","name":"Disable Overlay","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].EncodeBlend=false","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":900,"y":2040,"wires":[[]]},{"id":"6d26bb1db9ea5e67","type":"inject","z":"9584418c.dafc2","name":"On Demand","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":690,"y":2040,"wires":[["acd933c5c0eddc8b"]]},{"id":"446f812e8b1f4307","type":"api-current-state","z":"9584418c.dafc2","name":"Outdoor Temperature","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.433_weather_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":920,"y":1980,"wires":[["aa9d132ce4c33794"]]},{"id":"7eb1a3d60fccbc76","type":"Mailin SMTP","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Recieve Mail","port":25,"x":150,"y":3660,"wires":[["1cd709e001bf5e89"]]},{"id":"cb1f141562c8fd2b","type":"api-call-service","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Notify Cellular Priority 1","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"cellular_message","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload.html, \"data\": {\"priority\": 1} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":3640,"wires":[[]]},{"id":"88d3b091fc333998","type":"http request","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"DAL","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://ttp.cbp.dhs.gov/schedulerapi/slot-availability?locationId=5300","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":2940,"wires":[["7d01abce7bc68291"]]},{"id":"1cd709e001bf5e89","type":"within-time-switch","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"09:00:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"22:00:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":370,"y":3660,"wires":[["24fc1882c8436738"],["7f48460e08988c9e"]]},{"id":"7f48460e08988c9e","type":"api-call-service","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Notify Cellular Priority 0","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"cellular_message","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload.html, \"data\": {\"priority\": 0} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":3700,"wires":[[]]},{"id":"24fc1882c8436738","type":"api-current-state","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Andrew Home?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.andrew","state_type":"habool","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":580,"y":3640,"wires":[["cb1f141562c8fd2b"],["7f48460e08988c9e"]]},{"id":"d9e9a93275328762","type":"inject","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":780,"y":2140,"wires":[["c13f0f20a56d6af5"]]},{"id":"a12e93d199527cae","type":"file","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Write File","filename":"/data/input.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1200,"y":2140,"wires":[[]]},{"id":"f8a0990e2842810d","type":"server-state-changed","z":"9584418c.dafc2","name":"Dead Zwave Node","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"_node_status","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"dead","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":3780,"wires":[["1ba5d7539019ce84"],[]]},{"id":"1ba5d7539019ce84","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has died\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":420,"y":3780,"wires":[[]]},{"id":"1b266e9b338a4dfe","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"BB Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":3040,"wires":[]},{"id":"85644b2ab18e7141","type":"http request","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"BlueBubbles","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"andrew-bb","valueType":"other","valueValue":"true"}],"x":870,"y":3040,"wires":[["1b266e9b338a4dfe"]]},{"id":"041a81d375ec985d","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Build BB Message","func":"msg.url = msg.payload + \"/api/v1/message/text?password=\" + env.get(\"bb_pass\")\nmsg.payload = {\n \"chatGuid\": \"iMessage;-;+\" + env.get(\"bb_number\"),\n \"message\": msg.message + \" https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n \"method\": \"private-api\"\n}\n\nreturn msg;\n\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":3040,"wires":[["85644b2ab18e7141"]]},{"id":"bfbece91f0b61e8b","type":"api-current-state","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Get BlueBubbles URL","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.bluebubbles_url","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":3040,"wires":[["f3b23466b80725e0"]]},{"id":"f3b23466b80725e0","type":"json","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Object to JSON","property":"message","action":"str","pretty":false,"x":460,"y":3040,"wires":[["041a81d375ec985d"]]},{"id":"b4b8f84a.7e57a8","type":"jimp-image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Annotate","data":"outlinedImage","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_16_WHITE","parameter1Type":"jimpFont","parameter2":"10","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"timestamp","parameter4Type":"msg","parameter5":"HORIZONTAL_ALIGN_LEFT","parameter5Type":"AlignX","parameter6":"VERTICAL_ALIGN_TOP","parameter6Type":"AlignY","parameter7":"","parameter7Type":"auto","parameter8":"","parameter8Type":"auto","sendProperty":"outlinedImage","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":700,"y":2260,"wires":[["9b7c5535c74a94a3","2dfdead1d2e3b78b"]],"icon":"font-awesome/fa-image"},{"id":"63fd5090444c9cad","type":"api-render-template","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Time","server":"e1dc0b88.463bb8","version":0,"template":"{{ now().strftime(\"%m-%d-%YT%H:%M:%S\") }}","resultsLocation":"timestamp","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":570,"y":2260,"wires":[["b4b8f84a.7e57a8"]]},{"id":"2dfdead1d2e3b78b","type":"debug","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post Annotate","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":2360,"wires":[]},{"id":"c1fe21bcb3184137","type":"debug","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post Output msg","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":2360,"wires":[]},{"id":"28fa66cd.af058a","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 1m","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":120,"wires":[["2022689a.938918"]]},{"id":"aee87977a0670889","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper: Opened 5 Minutes","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"The \" & $lowercase(msg.data.new_state.attributes.friendly_name) & \" has been opened for 5 minutes\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":160,"wires":[[]]},{"id":"5caa1a9942bc27ee","type":"function","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n event_id: msg.event_id,\n loops: msg.loops,\n looking_for: msg.looking_for\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":950,"y":3960,"wires":[["4fc565f7b86648dc","75bc8ac5d1afe28f"]]},{"id":"9b25e9a8817a7d8e","type":"http request","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=driveway","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":710,"y":3960,"wires":[["5caa1a9942bc27ee"]]},{"id":"7c060a1e3c0ff12e","type":"inject","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":3940,"wires":[["1fce953ec4b1ee3d"]]},{"id":"4fc565f7b86648dc","type":"deepstack-object-detection","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","server":"169e2bac20a4c980","confidence":"70","drawPredictions":false,"printLabel":false,"outlineColor":"pink","custom":"","filters":[],"outputs":1,"x":1190,"y":3960,"wires":[["6f27f3028b1805e2"]]},{"id":"220bca8570d66770","type":"debug","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Log Plate","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":4100,"wires":[]},{"id":"184d6d5272648136","type":"server-state-changed","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Vehicle Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.driveway_far_car_count","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"0","ifStateType":"num","ifStateOperator":"gt","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":3980,"wires":[["1fce953ec4b1ee3d"],[]]},{"id":"500ee424e3f6b6a1","type":"while-loop","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"No Match","condi":"msg.payload != msg.looking_for","limit":true,"limitTime":"10","time":"loops","timeType":"msg","x":340,"y":4040,"wires":[["5218eca8a79a79a5"],["9b25e9a8817a7d8e"]]},{"id":"6f27f3028b1805e2","type":"change","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Plate to Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].plate","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":4040,"wires":[["500ee424e3f6b6a1","220bca8570d66770"]]},{"id":"004c0ae121925ea2","type":"debug","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Found","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":4100,"wires":[]},{"id":"5218eca8a79a79a5","type":"switch","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"If Match","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"plate_andrew","vt":"env"}],"checkall":"true","repair":false,"outputs":1,"x":540,"y":4040,"wires":[["004c0ae121925ea2","b70d2ca780b98259"]]},{"id":"1fce953ec4b1ee3d","type":"change","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","rules":[{"t":"set","p":"looking_for","pt":"msg","to":"plate_andrew","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":3960,"wires":[["9b25e9a8817a7d8e"]]},{"id":"8c5272ae89e85e74","type":"api-current-state","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Garage Closed","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"closed","halt_if_type":"str","halt_if_compare":"is","entity_id":"cover.garage_door","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":4040,"wires":[["18d9178fd318e333"],[]]},{"id":"8067ec66aa846765","type":"api-call-service","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Open Garage","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"cover","service":"open_cover","areaId":[],"deviceId":[],"entityId":["cover.garage_door"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":4040,"wires":[["6648e0bdaa2d8170"]]},{"id":"6648e0bdaa2d8170","type":"api-call-service","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Garage opened by ALPR\" \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":4100,"wires":[[]]},{"id":"18d9178fd318e333","type":"function","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Rate Limiter","func":"var interval = (1000*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":4040,"wires":[["8067ec66aa846765"]]},{"id":"b70d2ca780b98259","type":"api-current-state","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Andrew in Car","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.andrew_phone_car_connected","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":720,"y":4040,"wires":[["8c5272ae89e85e74"],[]]},{"id":"75bc8ac5d1afe28f","type":"image","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1040,"y":4100,"wires":[[]]},{"id":"4e761223bbb97b8d","type":"function","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n loops: msg.loops,\n looking_for: msg.looking_for\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":4240,"wires":[["6cecf24fbf959b73","cde6c9446e054107"]]},{"id":"4882c608e1fa69c7","type":"server-state-changed","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Doorbell Button","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door_button_pressed","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":160,"y":4280,"wires":[["dd24955fcf11d0b8"],[]]},{"id":"72737cfc3371b80f","type":"switch","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"If Match","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"looking_for","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":740,"y":4380,"wires":[["519990f56ae7a4e9","a4574f947fc3c876","fc7cc6d0b1911358"]]},{"id":"6cecf24fbf959b73","type":"image","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":240,"y":4440,"wires":[[]]},{"id":"cde6c9446e054107","type":"qrdecode","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","x":1020,"y":4240,"wires":[["a8e5d53fc40fcf3c"]]},{"id":"54c1081f98fd1945","type":"http request","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=front_door","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":590,"y":4240,"wires":[["4e761223bbb97b8d"]]},{"id":"519990f56ae7a4e9","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Front door QR match\" \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":4320,"wires":[[]]},{"id":"8db5019cab97ba65","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Speak \"QR Accepted\"","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":[],"entityId":["media_player.doorbell"],"data":"{\"media_content_id\":\"media-source://tts/microsoft?message=QR+code+validated,+unlocking+door\",\"media_content_type\":\"provider\",\"announce\":true}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":4380,"wires":[[]]},{"id":"dd24955fcf11d0b8","type":"api-current-state","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Get Code","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.qr_code_content","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"looking_for","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":380,"y":4240,"wires":[["54c1081f98fd1945"]]},{"id":"6084ebe4fee0af4d","type":"inject","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":4220,"wires":[["dd24955fcf11d0b8"]]},{"id":"e1a4ef361b9fc7ff","type":"inject","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":4560,"wires":[["38010b7e5f85b9f6"]]},{"id":"b6dbca53c840164c","type":"qrcode-generator","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Generate QR","qrtype":"text2qr","text2qrText":"","ssid":"","hiddenssid":false,"wifitype":"","phonenum":"","smsphonenum":"","smstext":"","mailto":"","mailsubject":"","mailbody":"","latitude":"","longitude":"","colorlight":"#ffffff","colordark":"#000000","printstatus":false,"x":710,"y":4560,"wires":[["e3b312790143d451"]]},{"id":"38010b7e5f85b9f6","type":"random-string","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","size":"15","characters":"","property":"qrcodeinput","x":340,"y":4560,"wires":[["4c8457c87150cbf8"]]},{"id":"4c8457c87150cbf8","type":"api-call-service","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Set QR Value","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.qr_code_content"],"data":"{\"value\": msg.qrcodeinput}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":530,"y":4560,"wires":[["b6dbca53c840164c"]]},{"id":"e073799764f16bc0","type":"api-call-service","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Send Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"QR Code\",\t \"data\": {\t \"attachments\": [\t '/config/media/images/qr.png' \t ]\t }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":4640,"wires":[[]]},{"id":"aa0e87207265845d","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_10_BLACK","parameter1Type":"jimpFont","parameter2":"5","parameter2Type":"num","parameter3":"335","parameter3Type":"num","parameter4":"timestamp","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":620,"y":4640,"wires":[["06871bb32f66c1ab"]]},{"id":"06871bb32f66c1ab","type":"file","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Write File","filename":"/data/qr.png","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":780,"y":4640,"wires":[["e073799764f16bc0"]]},{"id":"a8e5d53fc40fcf3c","type":"while-loop","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"No Match","condi":"msg.payload.status != 0","limit":true,"limitTime":"60","time":"loops","timeType":"msg","x":420,"y":4380,"wires":[["e422bd64e999decb","02dca310d30d41ec"],["28e26da9f431b399","02dca310d30d41ec"]]},{"id":"d0cd45ceef8e8641","type":"api-render-template","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Time","server":"e1dc0b88.463bb8","version":0,"template":"{{ now().strftime(\"%m-%d-%YT%H:%M:%S\") }}","resultsLocation":"timestamp","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":1010,"y":4560,"wires":[["523a5be045f29150"]]},{"id":"28e26da9f431b399","type":"delay","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":490,"y":4300,"wires":[["54c1081f98fd1945"]]},{"id":"e3b312790143d451","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Resize","data":"payload","dataType":"msg","ret":"buf","parameter1":"350","parameter1Type":"num","parameter2":"350","parameter2Type":"num","parameter3":"0","parameter3Type":"none","parameter4":"Press doorbell then show","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":3,"jimpFunction":"resize","selectedJimpFunction":{"name":"resize","fn":"resize","description":"resize the image. One of the w or h parameters can be set to automatic (\"Jimp.AUTO\" or -1).","parameters":[{"name":"w","type":"num|auto","required":true,"hint":"the width to resize the image to (or \"Jimp.AUTO\" or -1)"},{"name":"h","type":"num|auto","required":true,"hint":"the height to resize the image to (or \"Jimp.AUTO\" or -1)"},{"name":"mode","type":"resizeMode","required":false,"hint":"a scaling method (e.g. Jimp.RESIZE_BEZIER)"}]},"x":870,"y":4560,"wires":[["d0cd45ceef8e8641"]]},{"id":"523a5be045f29150","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_16_BLACK","parameter1Type":"jimpFont","parameter2":"40","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"Press doorbell then hold ~8\" in front of\\n camera for up to 30 seconds","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":200,"y":4640,"wires":[["a6187e2d761f18bd"]]},{"id":"a4574f947fc3c876","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Unlock Door","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"lock","service":"unlock","areaId":[],"deviceId":[],"entityId":["lock.front_door"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":4440,"wires":[["58c162476af5c2df"]]},{"id":"10bf2ad7f818bba5","type":"link in","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"link in 1","links":["58c162476af5c2df"],"x":205,"y":4600,"wires":[["38010b7e5f85b9f6"]]},{"id":"58c162476af5c2df","type":"link out","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"link out 1","mode":"link","links":["10bf2ad7f818bba5"],"x":1035,"y":4440,"wires":[]},{"id":"a6187e2d761f18bd","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_14_BLACK","parameter1Type":"jimpFont","parameter2":"20","parameter2Type":"num","parameter3":"310","parameter3Type":"num","parameter4":"Say \"Alexa, lock the front door\" before leaving","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":340,"y":4640,"wires":[["6d38c8b88ab6e9b1"]]},{"id":"6d38c8b88ab6e9b1","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_14_BLACK","parameter1Type":"jimpFont","parameter2":"85","parameter2Type":"num","parameter3":"322","parameter3Type":"num","parameter4":"and quickly closing the door","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":480,"y":4640,"wires":[["aa0e87207265845d"]]},{"id":"02dca310d30d41ec","type":"debug","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Found","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":4280,"wires":[]},{"id":"e422bd64e999decb","type":"switch","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"If Value","property":"payload.value","propertyType":"msg","rules":[{"t":"istype","v":"string","vt":"string"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":4380,"wires":[["72737cfc3371b80f"]]},{"id":"fc7cc6d0b1911358","type":"delay","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"1s","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":890,"y":4380,"wires":[["8db5019cab97ba65"]]},{"id":"f93c269fdb777a65","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Rate Limiter","func":"var interval = (1000*30); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":2140,"wires":[["bcaf3569e7816922"]]},{"id":"e45fa3455968d380","type":"server-state-changed","z":"9584418c.dafc2","name":"Device Battery Levels","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"_battery_level","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"20","ifStateType":"num","ifStateOperator":"lt","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":3840,"wires":[["84c749850e5b4db9"],[]]},{"id":"84c749850e5b4db9","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has low battery (\" & payload & \"%)\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":420,"y":3840,"wires":[[]]},{"id":"9d6f4f2f2b1e1400","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has low battery (\" & payload & \")\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":3840,"wires":[[]]},{"id":"bc96c3f77cb59c1a","type":"server-state-changed","z":"9584418c.dafc2","name":"Smoke Alarm Battery Levels","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"alarm_battery_level","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"80","ifStateType":"num","ifStateOperator":"lt","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":660,"y":3840,"wires":[["9d6f4f2f2b1e1400"],[]]},{"id":"d269f175.c9dc6","type":"server-events","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Custom Water Event Fired","server":"e1dc0b88.463bb8","version":3,"exposeAsEntityConfig":"","eventType":"irrigation_custom_water","eventData":"","waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":190,"y":340,"wires":[["883f2c00.1d94e8"]]},{"id":"3367e45f.cc981c","type":"function","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"++","func":"if ( (msg.i += 1) < msg.zones.length ) return msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":400,"wires":[["116d5bb3.ee92a4"]]},{"id":"116d5bb3.ee92a4","type":"function","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"For Each","func":"if( msg.i == undefined ) msg.i = 0;\n\nmsg.payload = msg.zones[ msg.i ];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":340,"wires":[["565ee5c1.561bfc","80df47d5.602888","e2c37b65c5582c2b"]]},{"id":"80df47d5.602888","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":340,"wires":[[]]},{"id":"fb46876c.845298","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":400,"wires":[["98eeafa7.bd2b9","860a4c61d7557dc9"]]},{"id":"98eeafa7.bd2b9","type":"delay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Delay 5","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":980,"y":480,"wires":[["3367e45f.cc981c"]]},{"id":"565ee5c1.561bfc","type":"change","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":400,"wires":[["22a20603.86a06a"]]},{"id":"22a20603.86a06a","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"x":1090,"y":400,"wires":[["fb46876c.845298"],[],["a8d96e.1f00969"]]},{"id":"a8d96e.1f00969","type":"mqtt out","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":1350,"y":340,"wires":[]},{"id":"3b656b89.1ac154","type":"inject","z":"f602e6ba.609d28","g":"79694877249c9902","name":"3:00 Attempt","props":[{"p":"payload"}],"repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"zone\":\"switch.irrigation_front_beds\",\"time\":10,\"name\":\"Front beds\"},{\"zone\":\"switch.irrigation_front_lawn\",\"time\":20,\"name\":\"Front lawn\"},{\"zone\":\"switch.irrigation_left_and_main_rear_lawn\",\"time\":20,\"name\":\"Left and main rear lawn\"},{\"zone\":\"switch.irrigation_front_and_right_rear_lawn\",\"time\":20,\"name\":\"Front and right rear lawn\"},{\"zone\":\"switch.irrigation_side_lawn\",\"time\":20,\"name\":\"Side lawn\"}]","payloadType":"json","x":180,"y":1280,"wires":[["493b435f.c9851c"]]},{"id":"493b435f.c9851c","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Schedule Enabled","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.lawn_irrigation_scheduling","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":1280,"wires":[["8c060f00.cf577"],["7b12e66f.57d068"]]},{"id":"7b12e66f.57d068","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Automation Off\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1300,"wires":[[]]},{"id":"8c060f00.cf577","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","576b66fa1bd202a3"],"x":595,"y":1260,"wires":[]},{"id":"4422f61c.847d88","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["3ff9ce03ef7b554b"],"x":135,"y":1480,"wires":[["219b37105a8304f1"]]},{"id":"dcdeabc7.780578","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["1eaa857e.b6b8db","c90fd5e6.c5c678","b8fe96458628f202"],"x":595,"y":1460,"wires":[]},{"id":"722d03d6.2ff77c","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["8d4bfe8e.ee805","d67106b42368e630"],"x":135,"y":1900,"wires":[["b3c4a3638c17629e"]]},{"id":"af4788fe.215ba8","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["405789f7.0727a8","eb1a5268c1aec843","9896327569c234da"],"x":595,"y":1900,"wires":[]},{"id":"c90fd5e6.c5c678","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["dcdeabc7.780578","89d715ddf12d2195"],"x":135,"y":1600,"wires":[["e7430e17f0b24ed8"]]},{"id":"862ad27a.d347d","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["83edf648.3f9ed8"],"x":595,"y":1580,"wires":[]},{"id":"808e6a81.92e2e8","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":400,"wires":[["e42ff3d9.593dc"]]},{"id":"883f2c00.1d94e8","type":"api-current-state","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"24v Power","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.irrigation_24v_power","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":400,"wires":[["808e6a81.92e2e8"],["808e6a81.92e2e8"]]},{"id":"e42ff3d9.593dc","type":"delay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Delay 5","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":480,"y":340,"wires":[["76160bc4.8cd644"]]},{"id":"76160bc4.8cd644","type":"change","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"","rules":[{"t":"set","p":"zones","pt":"msg","to":"payload.event.zones","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":340,"wires":[["116d5bb3.ee92a4"]]},{"id":"83edf648.3f9ed8","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["862ad27a.d347d","1bb3825011174363"],"x":135,"y":1700,"wires":[["b6e7d5b8891bba6d"]]},{"id":"8d4bfe8e.ee805","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["722d03d6.2ff77c"],"x":595,"y":1720,"wires":[]},{"id":"583f46a3.fc4c38","type":"inject","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"5:00 Attempt","props":[{"p":"payload"}],"repeat":"","crontab":"00 05 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"zone\":\"switch.irrigation_front_beds\",\"time\":10,\"name\":\"Front beds\"},{\"zone\":\"switch.irrigation_front_lawn\",\"time\":20,\"name\":\"Front lawn\"},{\"zone\":\"switch.irrigation_left_and_main_rear_lawn\",\"time\":20,\"name\":\"Left and main rear lawn\"},{\"zone\":\"switch.irrigation_front_and_right_rear_lawn\",\"time\":20,\"name\":\"Front and right rear lawn\"},{\"zone\":\"switch.irrigation_side_lawn\",\"time\":20,\"name\":\"Side lawn\"}]","payloadType":"json","x":180,"y":2620,"wires":[["d9147878.b61cf8"]]},{"id":"d9147878.b61cf8","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Schedule Enabled","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.front_bed_irrigation_scheduling","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":2620,"wires":[["c7e5552e.7f8a08"],["45c5dbbbd8ce50a1"]]},{"id":"c7e5552e.7f8a08","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","f6881b4bf93c27c5"],"x":595,"y":2600,"wires":[]},{"id":"6bcf06fb.9ca748","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["4f2902edc77f2d3b"],"x":135,"y":2820,"wires":[["ed6e3d4225582e20"]]},{"id":"f587589f.d739e8","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["1eaa857e.b6b8db","9d851699.6a8458"],"x":595,"y":2800,"wires":[]},{"id":"d9d17e8f.590e6","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["4fae5b92.a9cd44"],"x":135,"y":3040,"wires":[["d8637d8d96b68fca"]]},{"id":"d9f893eb.834f3","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["5ce1803b.06628"],"x":595,"y":3040,"wires":[]},{"id":"9d851699.6a8458","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f587589f.d739e8"],"x":135,"y":2940,"wires":[["593bee0e8c958df8"]]},{"id":"4fae5b92.a9cd44","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["d9d17e8f.590e6"],"x":595,"y":2920,"wires":[]},{"id":"a2ab7368.923fb","type":"template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Zone Settings Front Beds","field":"zones","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"zone\": \"switch.irrigation_front_beds\",\n \"time\": 20,\n \"name\": \"Front beds\"\n}","output":"json","x":250,"y":3200,"wires":[["62b5545bc6d6e627"]]},{"id":"a31e3daf.17207","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":3200,"wires":[["21ced698.708b5a","0fe0d325194604dd"]]},{"id":"21ced698.708b5a","type":"delay","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"2s","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":730,"y":3200,"wires":[["c661d489.9c9bc8"]]},{"id":"c661d489.9c9bc8","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": msg.zones.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":880,"y":3200,"wires":[["accc6697.196268"]]},{"id":"accc6697.196268","type":"change","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"msg.zones.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":3200,"wires":[["487ff788.8c5c98"]]},{"id":"487ff788.8c5c98","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"55a2162532da4e14","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"ignoretimerpass":false,"x":850,"y":3260,"wires":[["2238b09b.1b5b5","9129b06e.d8925"],[],["84258ddd.41da4"]]},{"id":"2238b09b.1b5b5","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": msg.zones.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":3340,"wires":[[]]},{"id":"84258ddd.41da4","type":"mqtt out","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":1130,"y":3320,"wires":[]},{"id":"9129b06e.d8925","type":"function","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Create msg object","func":"var message = \"Sprinkler auto-run: \" + msg.zones.name + \" ran for \" + msg.zones.time + \" minutes\"\n\nreturn { alert: message };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1050,"y":3260,"wires":[["d83b5ff7a2212931"]]},{"id":"5ce1803b.06628","type":"link in","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"","links":["db46e0c1.f9ab5","d9f893eb.834f3"],"x":95,"y":3200,"wires":[["a2ab7368.923fb"]]},{"id":"815fddc0.6604c","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Turn On 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":470,"y":1900,"wires":[["af4788fe.215ba8"]]},{"id":"418058c4.af3158","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Turn On 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":470,"y":3040,"wires":[["d9f893eb.834f3"]]},{"id":"1ae21386.a831bc","type":"inject","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"06:00 24v Off","props":[],"repeat":"","crontab":"00 06 * * *","once":false,"onceDelay":0.1,"topic":"","x":180,"y":1140,"wires":[["117145a7.67e99a","882aff35f788008b"]]},{"id":"117145a7.67e99a","type":"api-call-service","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"Turn Off 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1100,"wires":[[]]},{"id":"06d6255efdc31c47","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":1380,"wires":[["2fc67b25514de5a5"],["3ff9ce03ef7b554b"]]},{"id":"5420d0eed32223fb","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","08e3098cf183e086"],"x":595,"y":1360,"wires":[]},{"id":"3ff9ce03ef7b554b","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","4422f61c.847d88","8524a273a6a8ffd0"],"x":595,"y":1400,"wires":[]},{"id":"576b66fa1bd202a3","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["8c060f00.cf577"],"x":135,"y":1380,"wires":[["06d6255efdc31c47"]]},{"id":"7350c911a0b1a86d","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":2720,"wires":[["abb8777dd08aa743"],["4f2902edc77f2d3b"]]},{"id":"fdcfa1521191fa40","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","b403eec7866aea22"],"x":595,"y":2700,"wires":[]},{"id":"4f2902edc77f2d3b","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","6bcf06fb.9ca748"],"x":595,"y":2740,"wires":[]},{"id":"f6881b4bf93c27c5","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["c7e5552e.7f8a08"],"x":135,"y":2720,"wires":[["7350c911a0b1a86d"]]},{"id":"882aff35f788008b","type":"api-call-service","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"Turn Off Force Run","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_force_run"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":410,"y":1160,"wires":[[]]},{"id":"a3d75225807b70eb","type":"delay","z":"f602e6ba.609d28","g":"79694877249c9902","name":"30 Minute Delay","pauseType":"delay","timeout":"30","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":280,"y":1760,"wires":[["339ee0ada21856e0"]]},{"id":"e2c37b65c5582c2b","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn Off Start/Stop tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["automation.store_sprinkler_start_stop_times"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":300,"wires":[[]]},{"id":"860a4c61d7557dc9","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Start/Stop tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["automation.store_sprinkler_start_stop_times"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1360,"y":460,"wires":[[]]},{"id":"aa53225140781dd7","type":"api-render-template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Evaluate Template","server":"e1dc0b88.463bb8","version":0,"template":"","resultsLocation":"data.continue","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":250,"y":3320,"wires":[["8113d83074ff7701"]]},{"id":"8113d83074ff7701","type":"switch","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Last Ran >= Template Hrs Ago","property":"data.continue","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":3320,"wires":[["a31e3daf.17207"],["f78cdb84200eb171"]]},{"id":"d83b5ff7a2212931","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Notify via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": alert \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1270,"y":3260,"wires":[[]]},{"id":"dd9855ca4017c8c0","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rainfall_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":580,"wires":[[]]},{"id":"c3a696a117416327","type":"function","z":"f602e6ba.609d28","d":true,"g":"a9182c2cc04d2d9a","name":"Check Rainfall","func":"var rain_override = false\n\nfor (var i = 0; i < msg.payload.length; i++) {\n if (parseFloat(msg.payload[i].state) > 0.25) {\n rain_override = true\n }\n}\n\n// top = proceed\n// bottom = overridden\nif (rain_override === true) {\n return [ null, {rain_override} ];\n} \nelse {\n return [ {rain_override}, null ];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":680,"wires":[["47f1a8018e58e032"],["dd9855ca4017c8c0"]]},{"id":"27f2580e35031830","type":"api-get-history","z":"f602e6ba.609d28","d":true,"g":"a9182c2cc04d2d9a","name":"Rainfall 120h","server":"e1dc0b88.463bb8","version":1,"startDate":"","endDate":"","entityId":"sensor.netatmo_home_rain_sum_rain_today_inches","entityIdType":"equals","useRelativeTime":true,"relativeTime":"120h","flatten":true,"outputType":"array","outputLocationType":"msg","outputLocation":"payload","x":310,"y":680,"wires":[["c3a696a117416327"]]},{"id":"9cb8187c669c6485","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rainfall","info":"","x":150,"y":600,"wires":[]},{"id":"47f1a8018e58e032","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rainfall_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":660,"wires":[[]]},{"id":"427f7fa58d86cc59","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/30","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":640,"wires":[["27f2580e35031830","93965a61d2c4f5de"]]},{"id":"1d9a4d0bb4645f32","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rain_forecast_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":840,"wires":[[]]},{"id":"d9ebbaa37f5911a9","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rain Forecast","info":"","x":170,"y":760,"wires":[]},{"id":"eeecfc1e8864e39f","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rain_forecast_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":760,"wires":[[]]},{"id":"89487a4efedec1db","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/30","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":800,"wires":[["2c45af5b3ee5cf0a","c3cb1c7d15767014"]]},{"id":"1e4b3bc7c25b294f","type":"function","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rain Chance","func":"// Check next 4 precipitation_probability values\n// HA Template: \n// {% for j in state_attr(\"weather.kcll_daynight\",\"forecast\")[:4] %}\n// {{ j.precipitation_probability }}\n// {% endfor %}\n\nvar forecast_override = false\n\n// if (parseFloat(msg.payload) > 40) {\n// forecast_override = true\n// }\n \nfor (var i = 0; i < 4; i++) {\n if (parseFloat(msg.data.attributes.forecast[i].precipitation_probability) >= 60) {\n forecast_override = true\n }\n}\n\n// top = proceed\n// bottom = overridden\nif (forecast_override === true) {\n return [ null, {forecast_override} ];\n} \nelse {\n return [ {forecast_override}, null ];\n}","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":800,"wires":[["eeecfc1e8864e39f"],["1d9a4d0bb4645f32"]]},{"id":"2c45af5b3ee5cf0a","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Weather","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"weather.kcll_daynight","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":300,"y":800,"wires":[["1e4b3bc7c25b294f"]]},{"id":"d7e50e7a2810667d","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_wind_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":1000,"wires":[[]]},{"id":"28936ec687ee4eb0","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Wind","info":"","x":150,"y":920,"wires":[]},{"id":"974833b6a2eca853","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_wind_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":920,"wires":[[]]},{"id":"478a5a84d38ba181","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/5","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":960,"wires":[["c01fd0612615e927"]]},{"id":"c01fd0612615e927","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Wind <= 10 MPH","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"10","halt_if_type":"num","halt_if_compare":"lte","entity_id":"sensor.nws_wind_speed","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":330,"y":960,"wires":[["974833b6a2eca853"],["d7e50e7a2810667d"]]},{"id":"219b37105a8304f1","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Rainfall Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rainfall_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":260,"y":1480,"wires":[["dcdeabc7.780578"],["d01fbafafbb34692"]]},{"id":"e7430e17f0b24ed8","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Rain Forecast Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rain_forecast_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":280,"y":1600,"wires":[["862ad27a.d347d"],["f5684be88477322f"]]},{"id":"b6e7d5b8891bba6d","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Wind Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_wind_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":1700,"wires":[["8d4bfe8e.ee805"],["a3d75225807b70eb"]]},{"id":"339ee0ada21856e0","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Wind Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_wind_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":1820,"wires":[["8d4bfe8e.ee805"],["336585d4eee0ca73"]]},{"id":"ed6e3d4225582e20","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Rainfall Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rainfall_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":260,"y":2820,"wires":[["f587589f.d739e8"],["f7ac7a90f3da2298"]]},{"id":"593bee0e8c958df8","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Rain Forecast Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rain_forecast_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":280,"y":2940,"wires":[["4fae5b92.a9cd44"],["67916c3a5554a794","4fae5b92.a9cd44"]]},{"id":"d01fbafafbb34692","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Rainfall\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1500,"wires":[[]]},{"id":"f5684be88477322f","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Rain Forecasted\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1620,"wires":[[]]},{"id":"336585d4eee0ca73","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Wind\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1820,"wires":[[]]},{"id":"b3c4a3638c17629e","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Clear Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"None\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":1900,"wires":[["815fddc0.6604c"]]},{"id":"67916c3a5554a794","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Rain Forecasted\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2960,"wires":[[]]},{"id":"f7ac7a90f3da2298","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Rainfall\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2840,"wires":[[]]},{"id":"45c5dbbbd8ce50a1","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Automation Off\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2640,"wires":[[]]},{"id":"2fc67b25514de5a5","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Force Run\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":1360,"wires":[["5420d0eed32223fb"]]},{"id":"08e3098cf183e086","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["5420d0eed32223fb"],"x":325,"y":1960,"wires":[["815fddc0.6604c"]]},{"id":"abb8777dd08aa743","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Force Run\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":2700,"wires":[["fdcfa1521191fa40"]]},{"id":"d8637d8d96b68fca","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Clear Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"None\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":3040,"wires":[["418058c4.af3158"]]},{"id":"b403eec7866aea22","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["fdcfa1521191fa40"],"x":325,"y":3100,"wires":[["418058c4.af3158"]]},{"id":"f2c9c3a5b8b11a64","type":"switch","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Continue?","property":"data.continue","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1230,"y":2060,"wires":[["287dd3b1af5dc2d0"],["bf015af2161c5ec2"]]},{"id":"9896327569c234da","type":"link in","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"","links":["af4788fe.215ba8"],"x":95,"y":2060,"wires":[["e95ac52f03478921"]]},{"id":"e95ac52f03478921","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Lawn Zones","field":"all_zones","fieldType":"msg","format":"json","syntax":"mustache","template":"[\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"name\": \"Side lawn\"\n }\n]","output":"json","x":290,"y":2060,"wires":[["287dd3b1af5dc2d0"]]},{"id":"174186fb5d054240","type":"api-render-template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Evaluate Template","server":"e1dc0b88.463bb8","version":0,"template":"","resultsLocation":"data.continue","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1050,"y":2060,"wires":[["f2c9c3a5b8b11a64"]]},{"id":"287dd3b1af5dc2d0","type":"array-loop","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Loop Through Zones","key":"al287dd3b1af5dc2d0","keyType":"msg","reset":true,"resetValue":"value-null","array":"all_zones","arrayType":"msg","x":220,"y":2120,"wires":[["74cd40702021e86d","acdcc72fea065aac"],["224d30a98f52c287"]]},{"id":"74cd40702021e86d","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Zone Settings Lawn","field":"zones","fieldType":"msg","format":"json","syntax":"mustache","template":"[\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"time\": 10,\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"time\": 10,\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"time\": 10,\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"time\": 10,\n \"name\": \"Side lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"time\": 10,\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"time\": 10,\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"time\": 10,\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"time\": 10,\n \"name\": \"Side lawn\"\n }\n]","output":"json","x":460,"y":2180,"wires":[["151eb6ba5b2d39cd"]]},{"id":"bf015af2161c5ec2","type":"function","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Append Run Zones","func":"if (typeof msg.run_zones === 'undefined'){\n msg.run_zones = []\n}\n\n// Add zone to run_zones\nmsg.run_zones.push(msg.payload.zone)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":210,"y":2180,"wires":[["287dd3b1af5dc2d0"]]},{"id":"151eb6ba5b2d39cd","type":"array-loop","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Loop Through Zones","key":"al287dd3b1af5dc2d0","keyType":"msg","reset":true,"resetValue":"value-null","array":"zones","arrayType":"msg","x":720,"y":2180,"wires":[[],["45ee74d06e9cac2c"]]},{"id":"45ee74d06e9cac2c","type":"switch","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"If Zone in Run Zone","property":"run_zones","propertyType":"msg","rules":[{"t":"cont","v":"payload.zone","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":2240,"wires":[["8d3c8370996be2da"],["151eb6ba5b2d39cd"]]},{"id":"95a54981805b22f2","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":880,"y":2320,"wires":[["02d1e639f7ac6596","7b985932412db47d"]]},{"id":"a4b3eba196a504dc","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":540,"y":2500,"wires":[["6ea0448df1383ec2"]]},{"id":"02d1e639f7ac6596","type":"change","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2380,"wires":[["863b8fa63f210ebe"]]},{"id":"8d3c8370996be2da","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":2320,"wires":[["b1c9631973c2f4b1","8f83c8d1d4492be0"]]},{"id":"863b8fa63f210ebe","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"ignoretimerpass":false,"x":510,"y":2440,"wires":[["a4b3eba196a504dc","de509d99b9d965b3"],[],["7d8374976c01e3dc"]]},{"id":"7d8374976c01e3dc","type":"mqtt out","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":790,"y":2460,"wires":[]},{"id":"b0debe46542c4c67","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Notify via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": alert \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":2420,"wires":[[]]},{"id":"de509d99b9d965b3","type":"function","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Create msg object","func":"var message = \"Sprinkler auto-run: \" + msg.payload.name + \" ran for \" + msg.payload.time + \" minutes\"\n\nreturn { alert: message };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2420,"wires":[["b0debe46542c4c67"]]},{"id":"b1c9631973c2f4b1","type":"delay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"2s","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":730,"y":2320,"wires":[["95a54981805b22f2"]]},{"id":"6ea0448df1383ec2","type":"delay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Delay 10","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":320,"y":2440,"wires":[["151eb6ba5b2d39cd"]]},{"id":"224d30a98f52c287","type":"api-current-state","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":510,"y":2060,"wires":[["bf015af2161c5ec2"],["38affe5cc680d076"]]},{"id":"5a27d31bfb4a6990","type":"comment","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Actually Handle Watering","info":"","x":1150,"y":2340,"wires":[]},{"id":"197853479ad9eeda","type":"comment","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Decide Which Zones to Run","info":"","x":1020,"y":2160,"wires":[]},{"id":"7b985932412db47d","type":"debug","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Log Zone On","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":2280,"wires":[]},{"id":"acdcc72fea065aac","type":"debug","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Log Run Zones","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":2260,"wires":[]},{"id":"f78cdb84200eb171","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Recently Ran\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":750,"y":3380,"wires":[[]]},{"id":"93965a61d2c4f5de","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"< 1\" in 5 Days","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"1","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.neighbor_5in1_rain_last_5_days","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":420,"y":620,"wires":[["dd9855ca4017c8c0"],["47f1a8018e58e032"]]},{"id":"54bad548.7e9fcc","type":"ha-get-entities","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Get \"On\" Sprinklers","server":"e1dc0b88.463bb8","version":1,"rules":[{"property":"entity_id","logic":"starts_with","value":"switch.irrigation","valueType":"str"},{"property":"entity_id","logic":"does_not_include","value":"switch.irrigation_master_valve,switch.irrigation_24v_power,switch.irrigation_drip","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"outputType":"array","outputEmptyResults":true,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":390,"y":100,"wires":[["bcbf413e.7b188"]]},{"id":"5a10cd93.8e94b4","type":"inject","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":100,"wires":[["54bad548.7e9fcc"]]},{"id":"a77808ff.3f1288","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"On Longer than 26 minutes?","property":"payload[0].timeSinceChangedMs","propertyType":"msg","rules":[{"t":"gte","v":"1600000","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":720,"y":60,"wires":[["54ae6ec3.1bc63"]]},{"id":"54ae6ec3.1bc63","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload[0].entity_id }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":60,"wires":[[]]},{"id":"bcbf413e.7b188","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["a77808ff.3f1288","3b848bce.76aea4"],["656ad2cd6fb99f57"]]},{"id":"3b848bce.76aea4","type":"change","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Reset Delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":100,"wires":[["cdd3b7ef.04a618"]]},{"id":"43dedcca.ac7734","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Turn Off Master","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":180,"wires":[["5093cf5ba33eb30a"]]},{"id":"c42e6d62.7a24c","type":"api-current-state","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Master On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.irrigation_master_valve","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":510,"y":200,"wires":[["cdd3b7ef.04a618","21aa3b57a72b3336"],["3b848bce.76aea4","1b05625730953169"]]},{"id":"cdd3b7ef.04a618","type":"trigger","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Wait 1m","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":880,"y":120,"wires":[["5e9007a27732bba9"]]},{"id":"63f07877e73b952a","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":1100,"y":180,"wires":[[],["749afd72791a5127"]]},{"id":"5e9007a27732bba9","type":"ha-get-entities","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Get \"On\" Sprinklers","server":"e1dc0b88.463bb8","version":1,"rules":[{"property":"entity_id","logic":"starts_with","value":"switch.irrigation","valueType":"str"},{"property":"entity_id","logic":"does_not_include","value":"switch.irrigation_master_valve,switch.irrigation_24v_power","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"outputType":"array","outputEmptyResults":true,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":1070,"y":120,"wires":[["63f07877e73b952a"]]},{"id":"061b74f643477dd9","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":1360,"y":120,"wires":[["43dedcca.ac7734"],[]]},{"id":"749afd72791a5127","type":"trigger","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Wait 1m","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1260,"y":60,"wires":[["061b74f643477dd9"]]},{"id":"656ad2cd6fb99f57","type":"function","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"clear msg","func":"msg = {}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":200,"wires":[["c42e6d62.7a24c"]]},{"id":"c3cb1c7d15767014","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Weather","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"50","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.precip_probability","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":300,"y":860,"wires":[["1d9a4d0bb4645f32"],["eeecfc1e8864e39f"]]},{"id":"38affe5cc680d076","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Template: Zone Last Ran >= 71 hours","field":"template","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{%- set entity_name = \"input_datetime{{ payload.zone }}\" | regex_replace(find='switch', replace='', ignorecase=False) -%}\n{%- set time = (as_timestamp(now()) - as_timestamp(states(entity_name+\"_last_start\"))) | int -%}\n{% if time >= 71*3600 %}1{% else %}0{% endif %}","output":"str","x":790,"y":2060,"wires":[["174186fb5d054240"]]},{"id":"62b5545bc6d6e627","type":"template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Template: Zone Last Ran >= 23 hours","field":"template","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{%- set entity_name = \"input_datetime{{ zones.zone }}\" | regex_replace(find='switch', replace='', ignorecase=False) -%}\n{%- set time = (as_timestamp(now()) - as_timestamp(states(entity_name+\"_last_start\"))) | int -%}\n{% if time >= 23*3600 %}1{% else %}0{% endif %}","output":"str","x":310,"y":3260,"wires":[["aa53225140781dd7"]]},{"id":"5093cf5ba33eb30a","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Disable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"disable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1520,"y":180,"wires":[[]]},{"id":"1b05625730953169","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Disable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"disable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":200,"wires":[[]]},{"id":"21aa3b57a72b3336","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":160,"wires":[[]]},{"id":"8f83c8d1d4492be0","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":2280,"wires":[[]]},{"id":"0fe0d325194604dd","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":3280,"wires":[[]]}] \ No newline at end of file +[{"id":"9584418c.dafc2","type":"tab","label":"Automations","disabled":false,"info":""},{"id":"f602e6ba.609d28","type":"tab","label":"Irrigation","disabled":false,"info":""},{"id":"9cfe6331fbc680d5","type":"group","z":"9584418c.dafc2","name":"Delivery Vehicle Logo Object Detection","style":{"label":true},"nodes":["ed80a3f.522526","f3a3e80f.3e8e38","6f08d11c854dfb00","9b7c5535c74a94a3","d8a16fd91366d112","bcaf3569e7816922","d58f6ef71c326040","42be35f83b764861","b2a5543693ac851e","c13f0f20a56d6af5","7151828122e3b80c","bace446bfa7b343d","5acbb2cbdbdea368","c061be05c01527e0","e263410e9a3af7d8","d9e9a93275328762","a12e93d199527cae","b4b8f84a.7e57a8","63fd5090444c9cad","2dfdead1d2e3b78b","c1fe21bcb3184137","f93c269fdb777a65","28609db070a98f82","04300ba2a76891a6","0a096bcbb68139e5"],"x":54,"y":2099,"w":1392,"h":322},{"id":"3c4349a7eea9bd3b","type":"group","z":"9584418c.dafc2","name":"Set Cameras Online","style":{"label":true},"nodes":["bd19a17005513c2f","24d1a94e275e5e44","58d0c98797e19829","7a8e43b6f7c84bac","ab66afa5b576de3f","ccf5998fdf8ee50d"],"x":54,"y":1839,"w":492,"h":242},{"id":"35da177d9e2fd258","type":"group","z":"9584418c.dafc2","name":"Virtual Radar Server","style":{"label":true},"nodes":["a9a323de66b6f772","ee139512bcad0966","7da69a7e8ecadc7c","26e32b1d7824356a","3a82b835.c57d48","91afebbf8b9edf05","5684b08aacd6d225","4ca1a5ad47ce7a18","ba68e03143ba4af8","5f1d1b471a1c7cbb","2cd08c8da06afaf6","ea911291f04c7d18","43e5fa289c7550ff","97761f13f8e5c31b","ea239028eda07991"],"x":54,"y":1499,"w":1272,"h":322},{"id":"bd2acc7efb5be5fd","type":"group","z":"9584418c.dafc2","name":"Front Porch Light Occupancy Brightness","style":{"label":true},"nodes":["3f2a2e4d99057b69","3e399d83e4e7f4c3","59f5bc2571b0f12f","c68c969a6b8c2833","b1a99d9698d831b2","17b35d69307a8455","d11c183fff8d848d","fae7fa701710e258","1ef176bec8ed5da0","254a48eabb9cf476"],"x":54,"y":1279,"w":1092,"h":202},{"id":"11e25fc28c23144c","type":"group","z":"9584418c.dafc2","name":"Front House Lights","style":{"label":true},"nodes":["86bc310cbc0562af","2fb6a7afb6502a32","8c55985bffebd56a"],"x":54,"y":1119,"w":472,"h":142},{"id":"b808f2d7ae539c87","type":"group","z":"9584418c.dafc2","name":"Indoor Lights Dim Evening","style":{"label":true},"nodes":["e93027cb.6a6308","fc81cfda.29ff5","8ee35d65.a7569","41b918d5.7ce018","5420f9c0.5356c8","77184c93.8790d4","39a5ce57.78e3d2","ea19fe14.80749","ea2604f9.4cdf98","8a82f465.846018","d8ad0651.bf7a18","d9cc182cc3eb2a93","cde7b3c9ca39891b","1457bf6605a50448","fa90c550.d6c948"],"x":54,"y":659,"w":1073,"h":444},{"id":"9df353d4c0fc9a54","type":"group","z":"9584418c.dafc2","name":"Server Rack Temperature","style":{"label":true},"nodes":["73550501.be7fbc","7dff3ae1.e36a04","88822bfe.2cc598","96b5207d.407dd","b259f0eb.3e83","c7ff978f.ff0728","29b17ed7.fab972"],"x":54,"y":459,"w":932,"h":182},{"id":"18fe74aea06a1180","type":"group","z":"9584418c.dafc2","name":"AC Stale Air","style":{"label":true},"nodes":["ebe84a6f70b4bc2f","cf1c689e51b98aec","6af7abba85612dd9","8b6280c5c448720c","9ce46ce21d8cc964","2b6721107586ceae","830c3ddd08ef396c"],"x":54,"y":299,"w":1132,"h":142},{"id":"cf3a0410bcf837ae","type":"group","z":"9584418c.dafc2","name":"Door Alerts","style":{"label":true},"nodes":["2022689a.938918","8ec438b6.4eb2e8","9c1d9c7c.ed9c7","896f5b34.7b4328","c5124616.c9bd48","f9d93af6.184028","3314ec9f.ca8994","5c24f744.30fcb8","6aa388d0.707768","cf758271.d4fd6","5a740c2d.009864","c5c85c0aa2d8c8ca","28fa66cd.af058a","aee87977a0670889"],"x":54,"y":19,"w":1012,"h":262},{"id":"3cf0491ac33aecfa","type":"group","z":"f602e6ba.609d28","name":"Max Time and Master Valve Control","style":{"label":true},"nodes":["54bad548.7e9fcc","5a10cd93.8e94b4","a77808ff.3f1288","54ae6ec3.1bc63","bcbf413e.7b188","3b848bce.76aea4","43dedcca.ac7734","c42e6d62.7a24c","cdd3b7ef.04a618","63f07877e73b952a","5e9007a27732bba9","061b74f643477dd9","749afd72791a5127","656ad2cd6fb99f57","5093cf5ba33eb30a","1b05625730953169","21aa3b57a72b3336"],"x":54,"y":19,"w":1572,"h":222},{"id":"43a30fe5a5052c22","type":"group","z":"f602e6ba.609d28","name":"Custom Water","style":{"label":true},"nodes":["d269f175.c9dc6","3367e45f.cc981c","116d5bb3.ee92a4","80df47d5.602888","fb46876c.845298","98eeafa7.bd2b9","565ee5c1.561bfc","22a20603.86a06a","a8d96e.1f00969","808e6a81.92e2e8","883f2c00.1d94e8","e42ff3d9.593dc","76160bc4.8cd644","e2c37b65c5582c2b","860a4c61d7557dc9"],"x":54,"y":259,"w":1452,"h":262},{"id":"a9182c2cc04d2d9a","type":"group","z":"f602e6ba.609d28","name":"Irrigation Delays","style":{"label":true},"nodes":["dd9855ca4017c8c0","c3a696a117416327","27f2580e35031830","9cb8187c669c6485","47f1a8018e58e032","427f7fa58d86cc59","1d9a4d0bb4645f32","d9ebbaa37f5911a9","eeecfc1e8864e39f","89487a4efedec1db","1e4b3bc7c25b294f","2c45af5b3ee5cf0a","d7e50e7a2810667d","28936ec687ee4eb0","974833b6a2eca853","478a5a84d38ba181","c01fd0612615e927","93965a61d2c4f5de","c3cb1c7d15767014"],"x":54,"y":539,"w":752,"h":502},{"id":"0f07749a4e1672ad","type":"group","z":"f602e6ba.609d28","name":"Supply Voltage Control","style":{"label":true},"nodes":["1ae21386.a831bc","117145a7.67e99a","882aff35f788008b"],"x":54,"y":1059,"w":472,"h":142},{"id":"a08dae6118c91c19","type":"group","z":"f602e6ba.609d28","name":"Run Lawn","style":{"label":true},"nodes":["f2c9c3a5b8b11a64","9896327569c234da","e95ac52f03478921","174186fb5d054240","287dd3b1af5dc2d0","74cd40702021e86d","bf015af2161c5ec2","151eb6ba5b2d39cd","45ee74d06e9cac2c","95a54981805b22f2","a4b3eba196a504dc","02d1e639f7ac6596","8d3c8370996be2da","863b8fa63f210ebe","7d8374976c01e3dc","b0debe46542c4c67","de509d99b9d965b3","b1c9631973c2f4b1","6ea0448df1383ec2","224d30a98f52c287","5a27d31bfb4a6990","197853479ad9eeda","7b985932412db47d","acdcc72fea065aac","38affe5cc680d076","8f83c8d1d4492be0"],"x":54,"y":2019,"w":1272,"h":522},{"id":"79694877249c9902","type":"group","z":"f602e6ba.609d28","name":"Attempt Lawn","style":{"label":true},"nodes":["3b656b89.1ac154","493b435f.c9851c","7b12e66f.57d068","8c060f00.cf577","4422f61c.847d88","dcdeabc7.780578","722d03d6.2ff77c","af4788fe.215ba8","c90fd5e6.c5c678","862ad27a.d347d","83edf648.3f9ed8","8d4bfe8e.ee805","815fddc0.6604c","06d6255efdc31c47","5420d0eed32223fb","3ff9ce03ef7b554b","576b66fa1bd202a3","a3d75225807b70eb","219b37105a8304f1","e7430e17f0b24ed8","b6e7d5b8891bba6d","339ee0ada21856e0","d01fbafafbb34692","f5684be88477322f","336585d4eee0ca73","b3c4a3638c17629e","2fc67b25514de5a5","08e3098cf183e086"],"x":54,"y":1219,"w":672,"h":782},{"id":"68ec980b932fdba7","type":"group","z":"f602e6ba.609d28","name":"Attempt Front Beds","style":{"label":true},"nodes":["583f46a3.fc4c38","d9147878.b61cf8","c7e5552e.7f8a08","6bcf06fb.9ca748","f587589f.d739e8","d9d17e8f.590e6","d9f893eb.834f3","9d851699.6a8458","4fae5b92.a9cd44","418058c4.af3158","7350c911a0b1a86d","fdcfa1521191fa40","4f2902edc77f2d3b","f6881b4bf93c27c5","ed6e3d4225582e20","593bee0e8c958df8","67916c3a5554a794","f7ac7a90f3da2298","45c5dbbbd8ce50a1","abb8777dd08aa743","d8637d8d96b68fca","b403eec7866aea22"],"x":54,"y":2559,"w":672,"h":582},{"id":"55a2162532da4e14","type":"group","z":"f602e6ba.609d28","name":"Run Front Beds","style":{"label":true},"nodes":["a2ab7368.923fb","a31e3daf.17207","21ced698.708b5a","c661d489.9c9bc8","accc6697.196268","487ff788.8c5c98","2238b09b.1b5b5","84258ddd.41da4","9129b06e.d8925","5ce1803b.06628","aa53225140781dd7","8113d83074ff7701","d83b5ff7a2212931","f78cdb84200eb171","62b5545bc6d6e627","0fe0d325194604dd"],"x":54,"y":3159,"w":1332,"h":262},{"id":"59ea88a27ef998e7","type":"group","z":"9584418c.dafc2","name":"Drone Delivery Logo Object Detection","style":{"label":true},"nodes":["4e2d750742dc8890","cdc9c2c982e3fe5f","300267d7c89b0955","1ae58f8afe36e04c","5c59c5c412e759ce","aa523c5cbfe26949","b4392caec775b305","81d6e9a99eb61c67","8bec0433aa6e51fa","1aa9e39b6be88864","ec51454057c055e2","765c7c5a61100728","1bda1e8b7f76e5f3","14855ff357d5fbad","a95b4fa60f1238d7","081d788e92e34986","9799e777bb06f63f","6d56b297fcfe0016","2f18405339079200","b4d7bb6e129bacea","b442c20392c7ce60","ec6b4698123ebc34"],"x":54,"y":2439,"w":1412,"h":282},{"id":"cb7e3560a0078392","type":"group","z":"9584418c.dafc2","name":"Global Entry Schedule","style":{"label":true},"nodes":["5123f652827fa902","970920516fa379e8","51f2291060d07336","91d3d26774f9468e","7415468104c18108","b8a4a1ee4e15f778","79c00f8c61888f52","a61d605915dc23ff","c44a5c4d6d17ee9f","fa9f2ef8fecf1de2","7d01abce7bc68291","b7c50947c4507d03","1480d9470754a6a3","ca8d58af48d7b7c5","414a38bf0735b27c","c0546e86d17e99e9","d5ab0aa6d198ba81","88d3b091fc333998","1b266e9b338a4dfe","85644b2ab18e7141","041a81d375ec985d","bfbece91f0b61e8b","f3b23466b80725e0"],"x":54,"y":2739,"w":1102,"h":342},{"id":"26b2ac79d4c32bda","type":"group","z":"9584418c.dafc2","name":"Timelapse","style":{"label":true},"nodes":["83e2179938d08d58","59e4459459f077c9","089b07fa48286f29","7ff9bf1a917cbf50","a826a8c498d6d1e3"],"x":54,"y":3099,"w":612,"h":262},{"id":"6f393a92ae952332","type":"group","z":"9584418c.dafc2","name":"Faucet Auto Drip","style":{"label":true},"nodes":["08b26d8311cd9187","716e8fabff85ffb9","7b988b93a658f526","7fe1e564efbd46af","16e1a3e2f53e6bdf","d85faf19968afde1"],"x":54,"y":3379,"w":1032,"h":202},{"id":"e28fc796ce042622","type":"group","z":"9584418c.dafc2","name":"Generic Listener to Push Notifications from SMTP Inbox","style":{"label":true},"nodes":["7eb1a3d60fccbc76","cb1f141562c8fd2b","1cd709e001bf5e89","7f48460e08988c9e","24fc1882c8436738"],"x":54,"y":3599,"w":892,"h":142},{"id":"445e81780ba935ac","type":"group","z":"9584418c.dafc2","name":"License Plate Garage Door","style":{"label":true},"nodes":["5caa1a9942bc27ee","9b25e9a8817a7d8e","7c060a1e3c0ff12e","4fc565f7b86648dc","220bca8570d66770","184d6d5272648136","500ee424e3f6b6a1","6f27f3028b1805e2","004c0ae121925ea2","5218eca8a79a79a5","1fce953ec4b1ee3d","8c5272ae89e85e74","8067ec66aa846765","6648e0bdaa2d8170","18d9178fd318e333","b70d2ca780b98259","75bc8ac5d1afe28f"],"x":54,"y":3899,"w":1292,"h":242},{"id":"516939e66b0b3d5d","type":"group","z":"9584418c.dafc2","name":"QR Door Opener","style":{"label":true},"nodes":["4e761223bbb97b8d","4882c608e1fa69c7","72737cfc3371b80f","6cecf24fbf959b73","cde6c9446e054107","54c1081f98fd1945","519990f56ae7a4e9","8db5019cab97ba65","dd24955fcf11d0b8","6084ebe4fee0af4d","a8e5d53fc40fcf3c","28e26da9f431b399","a4574f947fc3c876","58c162476af5c2df","02dca310d30d41ec","e422bd64e999decb","fc7cc6d0b1911358"],"x":54,"y":4179,"w":1132,"h":302},{"id":"7a1cb951d36ebc37","type":"group","z":"9584418c.dafc2","name":"QR Send","style":{"label":true},"nodes":["e1a4ef361b9fc7ff","b6dbca53c840164c","38010b7e5f85b9f6","4c8457c87150cbf8","e073799764f16bc0","aa0e87207265845d","06871bb32f66c1ab","d0cd45ceef8e8641","e3b312790143d451","523a5be045f29150","10bf2ad7f818bba5","a6187e2d761f18bd","6d38c8b88ab6e9b1"],"x":54,"y":4519,"w":1032,"h":162},{"id":"e1dc0b88.463bb8","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"546e31ed.0db1c","type":"mqtt-broker","name":"Mosquitto","broker":"10.0.1.22","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"9f81fd881d01a666","type":"position-config","name":"","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""},{"id":"4f8f8feffed26998","type":"sqlitedb","db":"/data/amazon.db","mode":"RWC"},{"id":"96b8babe5c0a6107","type":"deepstack-server","proto":"http","host":"codeproject","port":"32168","version":"v1","rejectUnauthorized":true},{"id":"27555ce732fc54b0","type":"global-config","name":"global-config","env":[{"name":"bb_pass","value":"PASSWORD","type":"str"},{"name":"bb_number","value":"15128798125","type":"str"},{"name":"plate_andrew","value":"BNW7211","type":"str"},{"name":"qr_code","value":"zZxJ2GWG9W4MusFQ","type":"str"}]},{"id":"169e2bac20a4c980","type":"deepstack-server","proto":"http","host":"codeproject","port":"32168","version":"v1/vision/alpr","rejectUnauthorized":true},{"id":"2022689a.938918","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper: Opened 1 Minute","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"The \" & $lowercase(msg.data.new_state.attributes.friendly_name) & \" has been opened for 1 minute\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":120,"wires":[[]]},{"id":"8ec438b6.4eb2e8","type":"api-current-state","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Door Notify On","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"input_boolean.door_notify","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":60,"wires":[["c5124616.c9bd48"],[]]},{"id":"9c1d9c7c.ed9c7","type":"change","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Reset If Closed","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":220,"wires":[["5c24f744.30fcb8","cf758271.d4fd6","5a740c2d.009864","28fa66cd.af058a"]]},{"id":"896f5b34.7b4328","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload, \"data\": {\"priority\": 1} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":950,"y":60,"wires":[[]]},{"id":"c5124616.c9bd48","type":"template","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Opened","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{ data.new_state.attributes.friendly_name }} opened","output":"str","x":740,"y":60,"wires":[["896f5b34.7b4328"]]},{"id":"f9d93af6.184028","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Door Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.*_door$","entityIdType":"regex","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":100,"wires":[["8ec438b6.4eb2e8","5c24f744.30fcb8","cf758271.d4fd6","5a740c2d.009864","28fa66cd.af058a"],["9c1d9c7c.ed9c7"]]},{"id":"73550501.be7fbc","type":"trigger-state","z":"9584418c.dafc2","d":true,"g":"9df353d4c0fc9a54","name":"Rack Temperature","server":"e1dc0b88.463bb8","version":4,"inputs":1,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.rack_exhaust_temperature","entityIdType":"exact","debugEnabled":false,"constraints":[],"customOutputs":[],"outputInitially":false,"stateType":"num","enableInput":true,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":170,"y":560,"wires":[["7dff3ae1.e36a04"],[]]},{"id":"7dff3ae1.e36a04","type":"switch","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Above 90?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"95","vt":"num"},{"t":"lte","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":560,"wires":[["29b17ed7.fab972"],["96b5207d.407dd"]]},{"id":"88822bfe.2cc598","type":"api-call-service","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Turn on Fan","server":"e1dc0b88.463bb8","version":5,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["fan.rack_fan"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":710,"y":500,"wires":[[]]},{"id":"96b5207d.407dd","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack Fan","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"fan.rack_fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":580,"wires":[["c7ff978f.ff0728"],[]]},{"id":"b259f0eb.3e83","type":"api-call-service","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Turn off fan","server":"e1dc0b88.463bb8","version":5,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["fan.rack_fan"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":890,"y":540,"wires":[[]]},{"id":"e93027cb.6a6308","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Master Bedroom Lamps On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.master_bedroom_lamps","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":680,"y":702,"wires":[["fc81cfda.29ff5"],[]]},{"id":"fc81cfda.29ff5","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 128","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"128\",\"transition\":5, \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1001,"y":700,"wires":[[]]},{"id":"c7ff978f.ff0728","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack fan auto off?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.rack_fan_auto_off","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":730,"y":600,"wires":[["b259f0eb.3e83"],[]]},{"id":"29b17ed7.fab972","type":"api-current-state","z":"9584418c.dafc2","g":"9df353d4c0fc9a54","name":"Rack Fan","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","entity_id":"fan.rack_fan","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":520,"wires":[[],["88822bfe.2cc598"]]},{"id":"3314ec9f.ca8994","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Garage Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"cover.garage_door","entityIdType":"regex","outputInitially":false,"stateType":"str","ifState":"open","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":160,"wires":[["8ec438b6.4eb2e8"],[]]},{"id":"8ee35d65.a7569","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Cans On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_can_lights","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":942,"wires":[["5420f9c0.5356c8"],[]]},{"id":"41b918d5.7ce018","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Table On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_table_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":1062,"wires":[["d8ad0651.bf7a18"],[]]},{"id":"5420f9c0.5356c8","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 40","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"40\",\"transition\": \"5\", \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":842,"wires":[[]]},{"id":"77184c93.8790d4","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Kitchen Sink On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.kitchen_sink_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":650,"y":882,"wires":[["5420f9c0.5356c8"],[]]},{"id":"39a5ce57.78e3d2","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Living Room Cans On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.living_room_can_lights","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":670,"y":822,"wires":[["5420f9c0.5356c8"],[]]},{"id":"5c24f744.30fcb8","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 5m","op1":"","op2":"5","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":160,"wires":[["6aa388d0.707768","aee87977a0670889"]]},{"id":"6aa388d0.707768","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Alexa Announce Opened","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"The\" & $lowercase(msg.data.new_state.attributes.friendly_name) & \"has been opened for\" & msg.payload & \" minutes.\",\"data\":{\"method\":\"all\",\"type\":\"announce\"},\"target\":[\"Office\",\"Kitchen\",\"Master\",\"Living Room\"]}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":850,"y":220,"wires":[[]]},{"id":"cf758271.d4fd6","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 10m","op1":"","op2":"10","op1type":"nul","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":200,"wires":[["6aa388d0.707768"]]},{"id":"5a740c2d.009864","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 15m","op1":"","op2":"15","op1type":"nul","op2type":"str","duration":"15","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":240,"wires":[["6aa388d0.707768"]]},{"id":"ea19fe14.80749","type":"api-current-state","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"Entryway On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.entryway_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":640,"y":1002,"wires":[["5420f9c0.5356c8"],[]]},{"id":"ea2604f9.4cdf98","type":"api-current-state","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Living Room Sconces On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.living_room_sconces","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":680,"y":762,"wires":[["fc81cfda.29ff5"],[]]},{"id":"8a82f465.846018","type":"comment","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"100% = 255","info":"","x":970,"y":773,"wires":[]},{"id":"d8ad0651.bf7a18","type":"api-call-service","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"Set brightness to 80","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\"brightness\":\"80\",\"transition\": \"5\", \"entity_id\": msg.data.entity_id}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1000,"y":922,"wires":[[]]},{"id":"86bc310cbc0562af","type":"inject","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"At 10:30PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1200,"wires":[["2fb6a7afb6502a32","8c55985bffebd56a"]]},{"id":"2fb6a7afb6502a32","type":"api-call-service","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"Front Porch Lights Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":400,"y":1220,"wires":[[]]},{"id":"3f2a2e4d99057b69","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Motion","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door_all_occupancy","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1380,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"3e399d83e4e7f4c3","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Porch Lights to 254","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{\"brightness\":\"254\",\"transition\":2}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":710,"y":1360,"wires":[["1ef176bec8ed5da0","59f5bc2571b0f12f"]]},{"id":"59f5bc2571b0f12f","type":"delay","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":560,"y":1440,"wires":[["c68c969a6b8c2833"]]},{"id":"c68c969a6b8c2833","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Porch Lights Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_porch_lights"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":780,"y":1440,"wires":[["254a48eabb9cf476"]]},{"id":"d9cc182cc3eb2a93","type":"inject","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"At 10 PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 22 * * 3","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":742,"wires":[["1457bf6605a50448"]]},{"id":"b1a99d9698d831b2","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Open","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":1440,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"17b35d69307a8455","type":"within-time-switch","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"22:30","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"sunriseStart","endTimeType":"pdsTime","endOffset":"-30","endOffsetType":"num","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"","withinTimeValueType":"msgInput","outOfTimeValue":"","outOfTimeValueType":"msgInput","tsCompare":"0","x":400,"y":1380,"wires":[["3e399d83e4e7f4c3"],[]]},{"id":"d11c183fff8d848d","type":"change","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1440,"wires":[["59f5bc2571b0f12f"]]},{"id":"a9a323de66b6f772","type":"http request","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Get Aircraft","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://vrs:8080/VirtualRadar/AircraftList.json","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/json"}],"x":610,"y":1660,"wires":[["7da69a7e8ecadc7c","91afebbf8b9edf05","4ca1a5ad47ce7a18","2cd08c8da06afaf6","43e5fa289c7550ff"]]},{"id":"ee139512bcad0966","type":"inject","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Every 20 Seconds","props":[],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":1660,"wires":[["ea239028eda07991"]]},{"id":"7da69a7e8ecadc7c","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Amazon","func":"var alert = {}\nvar message = \"Airborne:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Man !== \"undefined\") {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":1660,"wires":[["5684b08aacd6d225"]]},{"id":"26e32b1d7824356a","type":"api-call-service","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_adsb","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":1660,"wires":[[]]},{"id":"3a82b835.c57d48","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1600,"wires":[["26e32b1d7824356a"]]},{"id":"91afebbf8b9edf05","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Interesting Tail #","func":"var alert = {}\nvar message = \"Interesting:\\n\"\n// N518GS George Strait\n// N628TS Elon\n// N898TS Taylor Swift\n// N621MM Taylor Swift\n// 82-8000 AF1\n// 92-9000 AF1\n// N5DA Don Adams Prop\n// N4DA Don Adams Lear\n// N68885 Zuckerberg\n// N681JK JB\n// N635PA\n// N628PA\n// N636PA\nvar interesting = [\"N68885\", \"N518GS\", \"N628TS\", \"82-8000\", \"92-9000\", \"N621MM\", \"N898TS\", \"N681JK\", \"N635PA\", \"N628PA\", \"N636PA\"]\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\") {\n if (interesting.includes(msg.payload.acList[i].Reg)) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":1600,"wires":[["3a82b835.c57d48"]]},{"id":"5684b08aacd6d225","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1660,"wires":[["26e32b1d7824356a"]]},{"id":"4ca1a5ad47ce7a18","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Amazon Landing","func":"var alert = {}\nvar message = \"Landing:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Man !== \"undefined\") {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Alt < 50){\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":1720,"wires":[["ba68e03143ba4af8"]]},{"id":"ba68e03143ba4af8","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1720,"wires":[["26e32b1d7824356a"]]},{"id":"5f1d1b471a1c7cbb","type":"sqlite","z":"9584418c.dafc2","g":"35da177d9e2fd258","mydb":"4f8f8feffed26998","sqlquery":"msg.topic","sql":"","name":"Amazon","x":1000,"y":1780,"wires":[["ea911291f04c7d18"]]},{"id":"2cd08c8da06afaf6","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Write Amazon Landing","func":"var sql = \"\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n var latlong = \"0,0\"\n if (typeof msg.payload.acList[i].Reg !== \"undefined\" && typeof msg.payload.acList[i].Lat !== \"undefined\" && typeof msg.payload.acList[i].Long !== \"undefined\") {\n //if (msg.payload.acList[i].Reg.endsWith(\"PA\") && msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Man.toLowerCase().includes(\"amazon\")) {\n if (msg.payload.acList[i].Alt < 50){\n latlong = msg.payload.acList[i].Lat + \",\" + msg.payload.acList[i].Long.toString()\n sql += `INSERT INTO deliveries (timestamp, registration, latlong, altitude) VALUES (\"${Date.now()}\", \"${msg.payload.acList[i].Reg}\", \"${latlong}\", \"${msg.payload.acList[i].Alt}\"); `\n }\n }\n }\n}\n\nif (sql.length > 0){\n msg.topic = sql\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":1780,"wires":[["5f1d1b471a1c7cbb"]]},{"id":"ea911291f04c7d18","type":"api-call-service","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Generate Heatmap","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"shell_command","service":"generate_heatmap","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":1780,"wires":[[]]},{"id":"cde7b3c9ca39891b","type":"link in","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"","links":["1457bf6605a50448"],"x":325,"y":722,"wires":[["e93027cb.6a6308","ea2604f9.4cdf98","39a5ce57.78e3d2","77184c93.8790d4","8ee35d65.a7569","ea19fe14.80749","41b918d5.7ce018"]]},{"id":"1457bf6605a50448","type":"link out","z":"9584418c.dafc2","g":"b808f2d7ae539c87","name":"","links":["cde7b3c9ca39891b"],"x":295,"y":722,"wires":[]},{"id":"8c55985bffebd56a","type":"api-call-service","z":"9584418c.dafc2","g":"11e25fc28c23144c","name":"Front Sconces Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_sconces"],"data":"{ \"transition\": 5 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1160,"wires":[[]]},{"id":"fae7fa701710e258","type":"server-state-changed","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Front Door Unlock","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"lock.front_door","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"unlocked","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1320,"wires":[["17b35d69307a8455","d11c183fff8d848d"],[]]},{"id":"ebe84a6f70b4bc2f","type":"inject","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Every 30 Minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":340,"wires":[["830c3ddd08ef396c"]]},{"id":"cf1c689e51b98aec","type":"api-current-state","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Thermostat Idle","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"Idle","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.thermostat_state","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":340,"wires":[["6af7abba85612dd9"],[]]},{"id":"6af7abba85612dd9","type":"function","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Idle > 2 hours","func":"// If last changed > 3 hours\nif (parseInt(msg.payload.timeSinceChangedMs) > 3600000*2) {\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":400,"wires":[["8b6280c5c448720c"]]},{"id":"8b6280c5c448720c","type":"api-call-service","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Turn AC Fan on Low","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":[],"entityId":["climate.thermostat"],"data":"{\"fan_mode\":\"low\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":340,"wires":[["9ce46ce21d8cc964"]]},{"id":"9ce46ce21d8cc964","type":"delay","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":900,"y":400,"wires":[["2b6721107586ceae"]]},{"id":"2b6721107586ceae","type":"api-call-service","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Turn AC Fan on Auto","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":[],"deviceId":[],"entityId":["climate.thermostat"],"data":"{\"fan_mode\":\"auto\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":340,"wires":[[]]},{"id":"830c3ddd08ef396c","type":"api-current-state","z":"9584418c.dafc2","g":"18fe74aea06a1180","name":"Attic > 100","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"100","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.netatmo_home_attic_temperature","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"attic","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":290,"y":400,"wires":[["cf1c689e51b98aec"],[]]},{"id":"43e5fa289c7550ff","type":"function","z":"9584418c.dafc2","d":true,"g":"35da177d9e2fd258","name":"Speedy","func":"var alert = {}\nvar message = \"Speedy:\\n\"\n\nfor (var i = 0; i < msg.payload.acList.length; i++) {\n if (typeof msg.payload.acList[i].Reg !== \"undefined\") {\n if (typeof msg.payload.acList[i].Spd == \"number\") {\n if (msg.payload.acList[i].Spd > 600) {\n alert[msg.payload.acList[i].Reg] = msg.payload.acList[i].Icao\n }\n }\n }\n}\n\nif (Object.keys(alert).length > 0) {\n for (const [key, value] of Object.entries(alert)) {\n message += key + \": https://globe.adsbexchange.com/?icao=\" + value + \"\\n\"\n }\n return { payload: message + \"https://vrs.aneis.ch\" }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":1540,"wires":[["97761f13f8e5c31b"]]},{"id":"97761f13f8e5c31b","type":"function","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"Rate Limiter","func":"var interval = (1000*60*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":1540,"wires":[["26e32b1d7824356a"]]},{"id":"ed80a3f.522526","type":"server-state-changed","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Vehicle Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.street_car_count","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"1","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":2200,"wires":[["f93c269fdb777a65"],[]]},{"id":"f3a3e80f.3e8e38","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n event_id: msg.event_id,\n loops: msg.loops\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":2200,"wires":[["e263410e9a3af7d8"]]},{"id":"6f08d11c854dfb00","type":"file","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Write File","filename":"/data/logo.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1020,"y":2260,"wires":[["b2a5543693ac851e"]]},{"id":"9b7c5535c74a94a3","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Output msg","func":"msg = {\n payload: msg.outlinedImage,\n detection_result: msg.payload[0].label,\n event_id: msg.event_id\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":2260,"wires":[["6f08d11c854dfb00"]]},{"id":"d8a16fd91366d112","type":"switch","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Match Found","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":2260,"wires":[["63fd5090444c9cad"]]},{"id":"bcaf3569e7816922","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Get Events","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events?cameras=driveway&labels=car&has_snapshot=1&zones=street&in_progress=1&limit=1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":350,"y":2200,"wires":[["d58f6ef71c326040"]]},{"id":"d58f6ef71c326040","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Extract Event ID","func":"if (JSON.parse(msg.payload).length > 0) {\n msg = {\n event_id: JSON.parse(msg.payload)[0].id,\n };\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":2200,"wires":[["c13f0f20a56d6af5"]]},{"id":"bd19a17005513c2f","type":"inject","z":"9584418c.dafc2","g":"3c4349a7eea9bd3b","name":"Every 15 Minutes","props":[],"repeat":"900","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":1940,"wires":[["24d1a94e275e5e44","ab66afa5b576de3f","7a8e43b6f7c84bac","58d0c98797e19829","ccf5998fdf8ee50d"]]},{"id":"24d1a94e275e5e44","type":"http request","z":"9584418c.dafc2","g":"3c4349a7eea9bd3b","name":"Set Doorbell Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.34/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":410,"y":2000,"wires":[[]]},{"id":"42be35f83b764861","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Add SubLabel","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/{{{event_id}}}/sub_label","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1340,"y":2200,"wires":[[]]},{"id":"b2a5543693ac851e","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Detection to payload","func":"var new_msg = {\n payload: { \"subLabel\": msg.detection_result },\n detection_result: msg.detection_result,\n event_id: msg.event_id\n};\nvar msg = new_msg\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1280,"y":2260,"wires":[["42be35f83b764861","04300ba2a76891a6","0a096bcbb68139e5","c1fe21bcb3184137"]]},{"id":"c13f0f20a56d6af5","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=driveway&h=1000","tls":"","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":730,"y":2200,"wires":[["f3a3e80f.3e8e38"]]},{"id":"7151828122e3b80c","type":"deepstack-custom-model","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post to Deepstack","server":"96b8babe5c0a6107","confidence":"60","customModel":"delivery","drawPredictions":true,"outlineColor":"red","custom":"","outputs":1,"x":190,"y":2260,"wires":[["5acbb2cbdbdea368","bace446bfa7b343d"]]},{"id":"ea239028eda07991","type":"within-time-switch","z":"9584418c.dafc2","g":"35da177d9e2fd258","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"08:00:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"21:00:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":410,"y":1660,"wires":[["a9a323de66b6f772"],[]]},{"id":"58d0c98797e19829","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 1 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1880,"wires":[[]]},{"id":"7a8e43b6f7c84bac","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 2 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.33/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1920,"wires":[[]]},{"id":"ab66afa5b576de3f","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set Camera 3 Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.35/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":420,"y":1960,"wires":[[]]},{"id":"ccf5998fdf8ee50d","type":"http request","z":"9584418c.dafc2","d":true,"g":"3c4349a7eea9bd3b","name":"Set PTZ Online","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.36/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":400,"y":2040,"wires":[[]]},{"id":"1ef176bec8ed5da0","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Doorbell Ring Light On","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.front_door_ring_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1020,"y":1340,"wires":[[]]},{"id":"254a48eabb9cf476","type":"api-call-service","z":"9584418c.dafc2","g":"bd2acc7efb5be5fd","name":"Doorbell Ring Light Off","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.front_door_ring_light"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1020,"y":1440,"wires":[[]]},{"id":"4e2d750742dc8890","type":"server-state-changed","z":"9584418c.dafc2","d":true,"g":"59ea88a27ef998e7","name":"Drone Motion Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.drone_detect_motion","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":2480,"wires":[["9799e777bb06f63f"],[]]},{"id":"cdc9c2c982e3fe5f","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n loops: msg.loops\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2480,"wires":[["b4392caec775b305"]]},{"id":"300267d7c89b0955","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Deepstack Output","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":2620,"wires":[]},{"id":"1ae58f8afe36e04c","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:5000/api/bullet/latest.jpg?quality=100","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":670,"y":2480,"wires":[["cdc9c2c982e3fe5f"]]},{"id":"5c59c5c412e759ce","type":"deepstack-custom-model","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Post to Deepstack","server":"96b8babe5c0a6107","confidence":"40","customModel":"delivery","drawPredictions":true,"outlineColor":"red","custom":"","outputs":1,"x":190,"y":2540,"wires":[["300267d7c89b0955","aa523c5cbfe26949","2f18405339079200"]]},{"id":"aa523c5cbfe26949","type":"image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","width":"800","data":"outlinedImage","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":200,"y":2680,"wires":[[]]},{"id":"b4392caec775b305","type":"jimp-image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","data":"payload","dataType":"msg","ret":"buf","parameter1":"380","parameter1Type":"num","parameter2":"0","parameter2Type":"num","parameter3":"170","parameter3Type":"num","parameter4":"170","parameter4Type":"num","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":4,"jimpFunction":"crop","selectedJimpFunction":{"name":"crop","fn":"crop","description":"crop to the given region","parameters":[{"name":"x","type":"num","required":true,"hint":"the x coordinate to crop form"},{"name":"y","type":"num","required":true,"hint":"the y coordinate to crop form"},{"name":"w","type":"num","required":true,"hint":"the width of the crop region"},{"name":"h","type":"num","required":true,"hint":"the height of the crop region"}]},"x":1050,"y":2480,"wires":[["5c59c5c412e759ce","081d788e92e34986"]]},{"id":"81d6e9a99eb61c67","type":"switch","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Match Found","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":2540,"wires":[["8bec0433aa6e51fa"]]},{"id":"8bec0433aa6e51fa","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Output msg","func":"var oldmsg = msg;\n\nmsg = {\n payload: msg.outlinedImage,\n detection_result: msg.payload[0].label,\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":2540,"wires":[["1aa9e39b6be88864","b4d7bb6e129bacea"]]},{"id":"1aa9e39b6be88864","type":"file","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Write File","filename":"/data/logo.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1060,"y":2540,"wires":[["ec51454057c055e2"]]},{"id":"ec51454057c055e2","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Detection to payload","func":"var new_msg = {\n payload: { \"subLabel\": msg.detection_result },\n detection_result: msg.detection_result,\n event_id: msg.event_id\n};\nvar msg = new_msg\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":2540,"wires":[["6d56b297fcfe0016"]]},{"id":"765c7c5a61100728","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Create Event","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/drone_detect/PrimeAir/create","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1270,"y":2600,"wires":[[]]},{"id":"1bda1e8b7f76e5f3","type":"http request","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Create Event","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://frigate:5000/api/events/back_porch/PrimeAir/create","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1270,"y":2640,"wires":[[]]},{"id":"14855ff357d5fbad","type":"mqtt out","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","topic":"frigate/events","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"546e31ed.0db1c","x":1360,"y":2680,"wires":[]},{"id":"a95b4fa60f1238d7","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Build MQTT","func":"msg.payload = {'type':'update', 'after':{'label':'PrimeAir'}}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1190,"y":2680,"wires":[["14855ff357d5fbad"]]},{"id":"081d788e92e34986","type":"image","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1000,"y":2680,"wires":[[]]},{"id":"9799e777bb06f63f","type":"within-time-switch","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"08:30:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"15:30:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":430,"y":2480,"wires":[["1ae58f8afe36e04c"],[]]},{"id":"6d56b297fcfe0016","type":"function","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Rate Limiter","func":"var interval = (1000*30); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":2600,"wires":[["a95b4fa60f1238d7","1bda1e8b7f76e5f3","765c7c5a61100728","b442c20392c7ce60"]]},{"id":"2f18405339079200","type":"while-loop","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Loop \"payload.length == 0\"","condi":"msg.payload.length == 0","limit":true,"limitTime":"10","time":"loops","timeType":"msg","x":460,"y":2540,"wires":[["81d6e9a99eb61c67"],["1ae58f8afe36e04c"]]},{"id":"bace446bfa7b343d","type":"while-loop","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Loop \"msg.payload.length == 0\"","condi":"msg.payload.length == 0","limit":true,"limitTime":"4","time":"loops","timeType":"msg","x":240,"y":2340,"wires":[["d8a16fd91366d112"],["c13f0f20a56d6af5"]]},{"id":"b4d7bb6e129bacea","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Write Match Image","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":740,"y":2600,"wires":[]},{"id":"b442c20392c7ce60","type":"debug","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Call Frigate API","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":2680,"wires":[]},{"id":"5acbb2cbdbdea368","type":"image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","width":"800","data":"outlinedImage","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":200,"y":2380,"wires":[[]]},{"id":"c061be05c01527e0","type":"image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1060,"y":2380,"wires":[[]]},{"id":"ec6b4698123ebc34","type":"inject","z":"9584418c.dafc2","g":"59ea88a27ef998e7","name":"Manually Create Event","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1280,"y":2480,"wires":[["6d56b297fcfe0016"]]},{"id":"e263410e9a3af7d8","type":"jimp-image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","data":"payload","dataType":"msg","ret":"buf","parameter1":"650","parameter1Type":"num","parameter2":"0","parameter2Type":"num","parameter3":"625","parameter3Type":"num","parameter4":"130","parameter4Type":"num","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":4,"jimpFunction":"crop","selectedJimpFunction":{"name":"crop","fn":"crop","description":"crop to the given region","parameters":[{"name":"x","type":"num","required":true,"hint":"the x coordinate to crop form"},{"name":"y","type":"num","required":true,"hint":"the y coordinate to crop form"},{"name":"w","type":"num","required":true,"hint":"the width of the crop region"},{"name":"h","type":"num","required":true,"hint":"the height of the crop region"}]},"x":1110,"y":2200,"wires":[["7151828122e3b80c","a12e93d199527cae","c061be05c01527e0"]]},{"id":"5123f652827fa902","type":"inject","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2860,"wires":[["970920516fa379e8","88d3b091fc333998"]]},{"id":"970920516fa379e8","type":"http request","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"PHX","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://ttp.cbp.dhs.gov/schedulerapi/slot-availability?locationId=7160","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":2860,"wires":[["51f2291060d07336"]]},{"id":"51f2291060d07336","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"11/07","func":"var oldmsg = msg;\nvar match = false\nvar slots = ''\n\nfor (var i = 0; i < msg.payload.availableSlots.length; i++) {\n if (msg.payload.availableSlots[i].startTimestamp.includes('2023-11-07')){\n console.log(msg.payload.availableSlots[i].startTimestamp)\n slots += msg.payload.availableSlots[i].startTimestamp + ' '\n match = true\n }\n}\n\nmsg = {\n payload: \"PHX: \" + slots + \"https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n 'match': match\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2860,"wires":[["7415468104c18108","a61d605915dc23ff"]]},{"id":"91d3d26774f9468e","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"HOU","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2820,"wires":[]},{"id":"7415468104c18108","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"PHX","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2900,"wires":[]},{"id":"b8a4a1ee4e15f778","type":"api-call-service","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": msg.payload\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2860,"wires":[[]]},{"id":"79c00f8c61888f52","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"match","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2780,"wires":[["c44a5c4d6d17ee9f"]]},{"id":"a61d605915dc23ff","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"match","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2860,"wires":[["fa9f2ef8fecf1de2"]]},{"id":"c44a5c4d6d17ee9f","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*600); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2780,"wires":[["d5ab0aa6d198ba81"]]},{"id":"fa9f2ef8fecf1de2","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*600); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2860,"wires":[["b8a4a1ee4e15f778"]]},{"id":"7d01abce7bc68291","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"All","func":"var oldmsg = msg;\nvar slots = msg.payload.availableSlots\n\n// Pass message if slots not empty\nif(slots.length > 0){\n msg.message = slots[0].startTimestamp\n return msg;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2940,"wires":[["1480d9470754a6a3","b7c50947c4507d03"]]},{"id":"b7c50947c4507d03","type":"switch","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2940,"wires":[["ca8d58af48d7b7c5","414a38bf0735b27c"]]},{"id":"1480d9470754a6a3","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"DAL","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":2980,"wires":[]},{"id":"ca8d58af48d7b7c5","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Rate Limiter","func":"var interval = (1000*120); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2940,"wires":[["414a38bf0735b27c","bfbece91f0b61e8b"]]},{"id":"414a38bf0735b27c","type":"api-call-service","z":"9584418c.dafc2","d":true,"g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Dallas https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2940,"wires":[[]]},{"id":"c0546e86d17e99e9","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"11/03","func":"var oldmsg = msg;\nvar match = false\nvar slots = ''\n\nfor (var i = 0; i < msg.payload.availableSlots.length; i++) {\n if (msg.payload.availableSlots[i].startTimestamp.includes('2023-11-03')){\n console.log(msg.payload.availableSlots[i].startTimestamp)\n slots += msg.payload.availableSlots[i].startTimestamp + ' '\n match = true\n }\n}\n\nmsg = {\n payload: \"HOU: \" + slots + \"https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n 'match': match\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":2780,"wires":[["91d3d26774f9468e","79c00f8c61888f52"]]},{"id":"d5ab0aa6d198ba81","type":"api-call-service","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": msg.payload\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":2780,"wires":[[]]},{"id":"83e2179938d08d58","type":"api-call-service","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Timelapse Snapshots","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"camera","service":"snapshot","areaId":[],"deviceId":[],"entityId":["camera.back_porch","camera.bullet","camera.driveway","camera.front_door"],"data":"{\"filename\":\"/config/media/images/{{ entity_id.entity_id }}/{{ now().strftime('%Y%m%d-%H%M%S') }}.webp\"}","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":540,"y":3220,"wires":[[]]},{"id":"59e4459459f077c9","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dawn End","nameInt":"⏲ golden hour dawn end = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDawnEnd","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":200,"y":3140,"wires":[["83e2179938d08d58"]]},{"id":"089b07fa48286f29","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dusk Start","nameInt":"⏲ golden hour dusk start = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDuskStart","timeType":"pdsTime","offset":0,"offsetType":"none","offsetMultiplier":60000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":200,"y":3320,"wires":[["83e2179938d08d58"]]},{"id":"7ff9bf1a917cbf50","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dusk Start - 3h","nameInt":"⏲ golden hour dusk start↶ = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDuskStart","timeType":"pdsTime","offset":"-3","offsetType":"num","offsetMultiplier":3600000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":3260,"wires":[["83e2179938d08d58"]]},{"id":"a826a8c498d6d1e3","type":"time-inject","z":"9584418c.dafc2","g":"26b2ac79d4c32bda","name":"Golden Hour Dawn End + 3h","nameInt":"⏲ golden hour dawn end↷ = $!{lblInject}!","positionConfig":"9f81fd881d01a666","props":[],"injectTypeSelect":"time","intervalCount":1,"intervalCountType":"num","intervalCountMultiplier":60000,"time":"goldenHourDawnEnd","timeType":"pdsTime","offset":"3","offsetType":"num","offsetMultiplier":3600000,"timeEnd":"","timeEndType":"entered","timeEndOffset":0,"timeEndOffsetType":"none","timeEndOffsetMultiplier":60000,"timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltDays":"*","timeAltOnlyOddDays":false,"timeAltOnlyEvenDays":false,"timeAltOnlyOddWeeks":false,"timeAltOnlyEvenWeeks":false,"timeAltMonths":"*","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"recalcTime":2,"x":220,"y":3200,"wires":[["83e2179938d08d58"]]},{"id":"c5c85c0aa2d8c8ca","type":"server-state-changed","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Safe Opened","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.large_safe","entityIdType":"exact","outputInitially":false,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":530,"y":80,"wires":[["c5124616.c9bd48"],[]]},{"id":"fa90c550.d6c948","type":"inject","z":"9584418c.dafc2","d":true,"g":"b808f2d7ae539c87","name":"At 8 PM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 20 * * 1,2,4,5,6,0","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":700,"wires":[["1457bf6605a50448"]]},{"id":"08b26d8311cd9187","type":"inject","z":"9584418c.dafc2","d":true,"g":"6f393a92ae952332","name":"Every 5 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":3480,"wires":[["716e8fabff85ffb9","7b988b93a658f526","d85faf19968afde1"]]},{"id":"716e8fabff85ffb9","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Attic Temperature < 34","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"34","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.netatmo_home_attic_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":3420,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"7b988b93a658f526","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Thermostat Outdoor Temperature <= 35","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"35","halt_if_type":"num","halt_if_compare":"lte","entity_id":"sensor.thermostat_outdoor_ambient_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":480,"y":3480,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"7fe1e564efbd46af","type":"api-call-service","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Turn on Faucet Drip","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.bhyve_1"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":3480,"wires":[[]]},{"id":"16e1a3e2f53e6bdf","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Faucet Drip Off?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.bhyve_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":3480,"wires":[["7fe1e564efbd46af"],[]]},{"id":"d85faf19968afde1","type":"api-current-state","z":"9584418c.dafc2","g":"6f393a92ae952332","name":"Compost External Temperature < 34","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"34","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.compost_external_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":3540,"wires":[["16e1a3e2f53e6bdf"],[]]},{"id":"504a90c2bb116cda","type":"inject","z":"9584418c.dafc2","name":"On Demand","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":690,"y":1920,"wires":[["f7c82af0e299c914"]]},{"id":"f7c82af0e299c914","type":"http request","z":"9584418c.dafc2","name":"Enable Overlay","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].EncodeBlend=true","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":900,"y":1920,"wires":[[]]},{"id":"aa9d132ce4c33794","type":"http request","z":"9584418c.dafc2","name":"Set Overlay Text","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text={{{payload}}}°F","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":1140,"y":1980,"wires":[[]]},{"id":"8f9a073f4ebb3133","type":"inject","z":"9584418c.dafc2","name":"On Demand */5","props":[],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":700,"y":1980,"wires":[["446f812e8b1f4307"]]},{"id":"acd933c5c0eddc8b","type":"http request","z":"9584418c.dafc2","name":"Disable Overlay","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://10.0.0.32/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].EncodeBlend=false","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"digest","senderr":false,"headers":[],"x":900,"y":2040,"wires":[[]]},{"id":"6d26bb1db9ea5e67","type":"inject","z":"9584418c.dafc2","name":"On Demand","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":690,"y":2040,"wires":[["acd933c5c0eddc8b"]]},{"id":"446f812e8b1f4307","type":"api-current-state","z":"9584418c.dafc2","name":"Outdoor Temperature","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.433_weather_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":920,"y":1980,"wires":[["aa9d132ce4c33794"]]},{"id":"7eb1a3d60fccbc76","type":"Mailin SMTP","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Recieve Mail","port":25,"x":150,"y":3660,"wires":[["1cd709e001bf5e89"]]},{"id":"cb1f141562c8fd2b","type":"api-call-service","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Notify Cellular Priority 1","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"cellular_message","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload.html, \"data\": {\"priority\": 1} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":3640,"wires":[[]]},{"id":"88d3b091fc333998","type":"http request","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"DAL","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://ttp.cbp.dhs.gov/schedulerapi/slot-availability?locationId=5300","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":2940,"wires":[["7d01abce7bc68291"]]},{"id":"1cd709e001bf5e89","type":"within-time-switch","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"","nameInt":"","positionConfig":"9f81fd881d01a666","startTime":"09:00:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"22:00:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"timeRestrictions":0,"timeRestrictionsType":"none","timeDays":"*","timeOnlyOddDays":false,"timeOnlyEvenDays":false,"timeOnlyOddWeeks":false,"timeOnlyEvenWeeks":false,"timeMonths":"*","timedatestart":"","timedateend":"","propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltType":"none","startOffsetAltMultiplier":60000,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltType":"none","endOffsetAltMultiplier":60000,"withinTimeValue":"true","withinTimeValueType":"msgInput","outOfTimeValue":"false","outOfTimeValueType":"msgInput","tsCompare":"0","x":370,"y":3660,"wires":[["24fc1882c8436738"],["7f48460e08988c9e"]]},{"id":"7f48460e08988c9e","type":"api-call-service","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Notify Cellular Priority 0","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"cellular_message","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": payload.html, \"data\": {\"priority\": 0} \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":3700,"wires":[[]]},{"id":"24fc1882c8436738","type":"api-current-state","z":"9584418c.dafc2","g":"e28fc796ce042622","name":"Andrew Home?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.andrew","state_type":"habool","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":580,"y":3640,"wires":[["cb1f141562c8fd2b"],["7f48460e08988c9e"]]},{"id":"d9e9a93275328762","type":"inject","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":780,"y":2140,"wires":[["c13f0f20a56d6af5"]]},{"id":"a12e93d199527cae","type":"file","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Write File","filename":"/data/input.jpg","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1200,"y":2140,"wires":[[]]},{"id":"f8a0990e2842810d","type":"server-state-changed","z":"9584418c.dafc2","name":"Dead Zwave Node","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"_node_status","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"dead","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":3780,"wires":[["1ba5d7539019ce84"],[]]},{"id":"1ba5d7539019ce84","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has died\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":420,"y":3780,"wires":[[]]},{"id":"1b266e9b338a4dfe","type":"debug","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"BB Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":3040,"wires":[]},{"id":"85644b2ab18e7141","type":"http request","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"BlueBubbles","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"bb-aneisch","valueType":"other","valueValue":"true"}],"x":870,"y":3040,"wires":[["1b266e9b338a4dfe"]]},{"id":"041a81d375ec985d","type":"function","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Build BB Message","func":"msg.url = msg.payload + \"/api/v1/message/text?password=\" + env.get(\"bb_pass\")\nmsg.payload = {\n \"chatGuid\": \"iMessage;-;+\" + env.get(\"bb_number\"),\n \"message\": \" https://ttp.cbp.dhs.gov/schedulerui/schedule-interview/location?lang=en&vo=true&returnUrl=ttp-external&service=UP\",\n \"method\": \"private-api\"\n}\n\nreturn msg;\n\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":3040,"wires":[["85644b2ab18e7141"]]},{"id":"bfbece91f0b61e8b","type":"api-current-state","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Get BlueBubbles URL","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.bluebubbles_url","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":3040,"wires":[["f3b23466b80725e0"]]},{"id":"f3b23466b80725e0","type":"json","z":"9584418c.dafc2","g":"cb7e3560a0078392","name":"Object to JSON","property":"message","action":"str","pretty":false,"x":460,"y":3040,"wires":[["041a81d375ec985d"]]},{"id":"b4b8f84a.7e57a8","type":"jimp-image","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Annotate","data":"outlinedImage","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_16_WHITE","parameter1Type":"jimpFont","parameter2":"10","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"timestamp","parameter4Type":"msg","parameter5":"HORIZONTAL_ALIGN_LEFT","parameter5Type":"AlignX","parameter6":"VERTICAL_ALIGN_TOP","parameter6Type":"AlignY","parameter7":"","parameter7Type":"auto","parameter8":"","parameter8Type":"auto","sendProperty":"outlinedImage","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":700,"y":2260,"wires":[["9b7c5535c74a94a3","2dfdead1d2e3b78b"]],"icon":"font-awesome/fa-image"},{"id":"63fd5090444c9cad","type":"api-render-template","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Time","server":"e1dc0b88.463bb8","version":0,"template":"{{ now().strftime(\"%m-%d-%YT%H:%M:%S\") }}","resultsLocation":"timestamp","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":570,"y":2260,"wires":[["b4b8f84a.7e57a8"]]},{"id":"2dfdead1d2e3b78b","type":"debug","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post Annotate","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":2360,"wires":[]},{"id":"c1fe21bcb3184137","type":"debug","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Post Output msg","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":2360,"wires":[]},{"id":"28fa66cd.af058a","type":"trigger","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Wait 1m","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":620,"y":120,"wires":[["2022689a.938918"]]},{"id":"aee87977a0670889","type":"api-call-service","z":"9584418c.dafc2","g":"cf3a0410bcf837ae","name":"Notify Via Wrapper: Opened 5 Minutes","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"The \" & $lowercase(msg.data.new_state.attributes.friendly_name) & \" has been opened for 5 minutes\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":160,"wires":[[]]},{"id":"5caa1a9942bc27ee","type":"function","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n event_id: msg.event_id,\n loops: msg.loops,\n looking_for: msg.looking_for\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":950,"y":3960,"wires":[["4fc565f7b86648dc","75bc8ac5d1afe28f"]]},{"id":"9b25e9a8817a7d8e","type":"http request","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=driveway","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":710,"y":3960,"wires":[["5caa1a9942bc27ee"]]},{"id":"7c060a1e3c0ff12e","type":"inject","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":3940,"wires":[["1fce953ec4b1ee3d"]]},{"id":"4fc565f7b86648dc","type":"deepstack-object-detection","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","server":"169e2bac20a4c980","confidence":"70","drawPredictions":false,"printLabel":false,"outlineColor":"pink","custom":"","filters":[],"outputs":1,"x":1190,"y":3960,"wires":[["6f27f3028b1805e2"]]},{"id":"220bca8570d66770","type":"debug","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Log Plate","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":4100,"wires":[]},{"id":"184d6d5272648136","type":"server-state-changed","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Vehicle Detected","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"sensor.driveway_far_car_count","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"0","ifStateType":"num","ifStateOperator":"gt","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":3980,"wires":[["1fce953ec4b1ee3d"],[]]},{"id":"500ee424e3f6b6a1","type":"while-loop","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"No Match","condi":"msg.payload != msg.looking_for","limit":true,"limitTime":"10","time":"loops","timeType":"msg","x":340,"y":4040,"wires":[["5218eca8a79a79a5"],["9b25e9a8817a7d8e"]]},{"id":"6f27f3028b1805e2","type":"change","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Plate to Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].plate","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":4040,"wires":[["500ee424e3f6b6a1","220bca8570d66770"]]},{"id":"004c0ae121925ea2","type":"debug","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Found","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":4100,"wires":[]},{"id":"5218eca8a79a79a5","type":"switch","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"If Match","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"plate_andrew","vt":"env"}],"checkall":"true","repair":false,"outputs":1,"x":540,"y":4040,"wires":[["004c0ae121925ea2","b70d2ca780b98259"]]},{"id":"1fce953ec4b1ee3d","type":"change","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","rules":[{"t":"set","p":"looking_for","pt":"msg","to":"plate_andrew","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":3960,"wires":[["9b25e9a8817a7d8e"]]},{"id":"8c5272ae89e85e74","type":"api-current-state","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Garage Closed","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"closed","halt_if_type":"str","halt_if_compare":"is","entity_id":"cover.garage_door","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":4040,"wires":[["18d9178fd318e333"],[]]},{"id":"8067ec66aa846765","type":"api-call-service","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Open Garage","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"cover","service":"open_cover","areaId":[],"deviceId":[],"entityId":["cover.garage_door"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":4040,"wires":[["6648e0bdaa2d8170"]]},{"id":"6648e0bdaa2d8170","type":"api-call-service","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Garage opened by ALPR\" \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":4100,"wires":[[]]},{"id":"18d9178fd318e333","type":"function","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Rate Limiter","func":"var interval = (1000*10); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":4040,"wires":[["8067ec66aa846765"]]},{"id":"b70d2ca780b98259","type":"api-current-state","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"Andrew in Car","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.andrew_phone_car_connected","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":720,"y":4040,"wires":[["8c5272ae89e85e74"],[]]},{"id":"75bc8ac5d1afe28f","type":"image","z":"9584418c.dafc2","g":"445e81780ba935ac","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":1040,"y":4100,"wires":[[]]},{"id":"4e761223bbb97b8d","type":"function","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Image to Payload","func":"msg = {\n payload: msg.payload,\n loops: msg.loops,\n looking_for: msg.looking_for\n};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":4240,"wires":[["6cecf24fbf959b73","cde6c9446e054107"]]},{"id":"4882c608e1fa69c7","type":"server-state-changed","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Doorbell Button","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.front_door_button_pressed","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":160,"y":4280,"wires":[["dd24955fcf11d0b8"],[]]},{"id":"72737cfc3371b80f","type":"switch","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"If Match","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"looking_for","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":740,"y":4380,"wires":[["519990f56ae7a4e9","a4574f947fc3c876","fc7cc6d0b1911358"]]},{"id":"6cecf24fbf959b73","type":"image","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","width":"800","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":true,"outputs":1,"x":240,"y":4440,"wires":[[]]},{"id":"cde6c9446e054107","type":"qrdecode","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","x":1020,"y":4240,"wires":[["a8e5d53fc40fcf3c"]]},{"id":"54c1081f98fd1945","type":"http request","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Get Current Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://frigate:1984/api/frame.jpeg?src=front_door","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":590,"y":4240,"wires":[["4e761223bbb97b8d"]]},{"id":"519990f56ae7a4e9","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"Front door QR match\" \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":4320,"wires":[[]]},{"id":"8db5019cab97ba65","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Speak \"QR Accepted\"","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":[],"entityId":["media_player.doorbell"],"data":"{\"media_content_id\":\"media-source://tts/microsoft?message=QR+code+validated,+unlocking+door\",\"media_content_type\":\"provider\",\"announce\":true}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":4380,"wires":[[]]},{"id":"dd24955fcf11d0b8","type":"api-current-state","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Get Code","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.qr_code_content","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"looking_for","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":380,"y":4240,"wires":[["54c1081f98fd1945"]]},{"id":"6084ebe4fee0af4d","type":"inject","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":4220,"wires":[["dd24955fcf11d0b8"]]},{"id":"e1a4ef361b9fc7ff","type":"inject","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":4560,"wires":[["38010b7e5f85b9f6"]]},{"id":"b6dbca53c840164c","type":"qrcode-generator","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Generate QR","qrtype":"text2qr","text2qrText":"","ssid":"","hiddenssid":false,"wifitype":"","phonenum":"","smsphonenum":"","smstext":"","mailto":"","mailsubject":"","mailbody":"","latitude":"","longitude":"","colorlight":"#ffffff","colordark":"#000000","printstatus":false,"x":710,"y":4560,"wires":[["e3b312790143d451"]]},{"id":"38010b7e5f85b9f6","type":"random-string","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","size":"15","characters":"","property":"qrcodeinput","x":340,"y":4560,"wires":[["4c8457c87150cbf8"]]},{"id":"4c8457c87150cbf8","type":"api-call-service","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Set QR Value","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.qr_code_content"],"data":"{\"value\": msg.qrcodeinput}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":530,"y":4560,"wires":[["b6dbca53c840164c"]]},{"id":"e073799764f16bc0","type":"api-call-service","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Send Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_self","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": \"QR Code\",\t \"data\": {\t \"attachments\": [\t '/config/media/images/qr.png' \t ]\t }\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":4640,"wires":[[]]},{"id":"aa0e87207265845d","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_10_BLACK","parameter1Type":"jimpFont","parameter2":"5","parameter2Type":"num","parameter3":"335","parameter3Type":"num","parameter4":"timestamp","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":620,"y":4640,"wires":[["06871bb32f66c1ab"]]},{"id":"06871bb32f66c1ab","type":"file","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Write File","filename":"/data/qr.png","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":780,"y":4640,"wires":[["e073799764f16bc0"]]},{"id":"a8e5d53fc40fcf3c","type":"while-loop","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"No Match","condi":"msg.payload.status != 0","limit":true,"limitTime":"60","time":"loops","timeType":"msg","x":420,"y":4380,"wires":[["e422bd64e999decb","02dca310d30d41ec"],["28e26da9f431b399","02dca310d30d41ec"]]},{"id":"d0cd45ceef8e8641","type":"api-render-template","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Time","server":"e1dc0b88.463bb8","version":0,"template":"{{ now().strftime(\"%m-%d-%YT%H:%M:%S\") }}","resultsLocation":"timestamp","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":1010,"y":4560,"wires":[["523a5be045f29150"]]},{"id":"28e26da9f431b399","type":"delay","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":490,"y":4300,"wires":[["54c1081f98fd1945"]]},{"id":"e3b312790143d451","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Resize","data":"payload","dataType":"msg","ret":"buf","parameter1":"350","parameter1Type":"num","parameter2":"350","parameter2Type":"num","parameter3":"0","parameter3Type":"none","parameter4":"Press doorbell then show","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":3,"jimpFunction":"resize","selectedJimpFunction":{"name":"resize","fn":"resize","description":"resize the image. One of the w or h parameters can be set to automatic (\"Jimp.AUTO\" or -1).","parameters":[{"name":"w","type":"num|auto","required":true,"hint":"the width to resize the image to (or \"Jimp.AUTO\" or -1)"},{"name":"h","type":"num|auto","required":true,"hint":"the height to resize the image to (or \"Jimp.AUTO\" or -1)"},{"name":"mode","type":"resizeMode","required":false,"hint":"a scaling method (e.g. Jimp.RESIZE_BEZIER)"}]},"x":870,"y":4560,"wires":[["d0cd45ceef8e8641"]]},{"id":"523a5be045f29150","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_16_BLACK","parameter1Type":"jimpFont","parameter2":"40","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"Press doorbell then hold ~8\" in front of\\n camera for up to 30 seconds","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":200,"y":4640,"wires":[["a6187e2d761f18bd"]]},{"id":"a4574f947fc3c876","type":"api-call-service","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Unlock Door","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"lock","service":"unlock","areaId":[],"deviceId":[],"entityId":["lock.front_door"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":4440,"wires":[["58c162476af5c2df"]]},{"id":"10bf2ad7f818bba5","type":"link in","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"link in 1","links":["58c162476af5c2df"],"x":205,"y":4600,"wires":[["38010b7e5f85b9f6"]]},{"id":"58c162476af5c2df","type":"link out","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"link out 1","mode":"link","links":["10bf2ad7f818bba5"],"x":1035,"y":4440,"wires":[]},{"id":"a6187e2d761f18bd","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_14_BLACK","parameter1Type":"jimpFont","parameter2":"20","parameter2Type":"num","parameter3":"310","parameter3Type":"num","parameter4":"Say \"Alexa, lock the front door\" before leaving","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":340,"y":4640,"wires":[["6d38c8b88ab6e9b1"]]},{"id":"6d38c8b88ab6e9b1","type":"jimp-image","z":"9584418c.dafc2","g":"7a1cb951d36ebc37","name":"Annotate","data":"payload","dataType":"msg","ret":"buf","parameter1":"FONT_SANS_14_BLACK","parameter1Type":"jimpFont","parameter2":"85","parameter2Type":"num","parameter3":"322","parameter3Type":"num","parameter4":"and quickly closing the door","parameter4Type":"str","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"payload","sendPropertyType":"msg","parameterCount":8,"jimpFunction":"print2","selectedJimpFunction":{"name":"print aligned","fn":"print","description":"Print text to the image","parameters":[{"name":"font|str","type":"jimpFont","required":true,"hint":"font to print. NOTE: This can be one of the presets or the path to a fnt file"},{"name":"x","type":"num","required":true,"hint":"x coordinate to print text"},{"name":"y","type":"num","required":true,"hint":"y coordinate to print text"},{"name":"text","group":"options","type":"str","required":true,"hint":"text to print"},{"name":"alignmentX","group":"options","type":"AlignX","required":false,"hint":"X Alignment"},{"name":"alignmentY","group":"options","type":"AlignY","required":false,"hint":"Y Alignment"},{"name":"maxWidth","type":"auto|num","required":false,"hint":"wrap text at maxWidth"},{"name":"maxHeight","type":"auto|num","required":false,"hint":"max height"}]},"x":480,"y":4640,"wires":[["aa0e87207265845d"]]},{"id":"02dca310d30d41ec","type":"debug","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"Found","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":4280,"wires":[]},{"id":"e422bd64e999decb","type":"switch","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"If Value","property":"payload.value","propertyType":"msg","rules":[{"t":"istype","v":"string","vt":"string"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":4380,"wires":[["72737cfc3371b80f"]]},{"id":"fc7cc6d0b1911358","type":"delay","z":"9584418c.dafc2","g":"516939e66b0b3d5d","name":"1s","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":890,"y":4380,"wires":[["8db5019cab97ba65"]]},{"id":"f93c269fdb777a65","type":"function","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Rate Limiter","func":"var interval = (1000*30); // minimum interval between messages (ms)\ncontext.lastTime = context.lastTime || 0;\n\nvar now = Date.now();\n\nif (now-context.lastTime > interval) {\n context.lastTime = now;\n return msg;\n} else {\n return null;\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":2140,"wires":[["bcaf3569e7816922"]]},{"id":"e45fa3455968d380","type":"server-state-changed","z":"9584418c.dafc2","name":"Device Battery Levels","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"_battery_level","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"20","ifStateType":"num","ifStateOperator":"lt","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":3840,"wires":[["84c749850e5b4db9"],[]]},{"id":"84c749850e5b4db9","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has low battery (\" & payload & \"%)\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":420,"y":3840,"wires":[[]]},{"id":"9d6f4f2f2b1e1400","type":"api-call-service","z":"9584418c.dafc2","name":"Notify Via Signal","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"notify","service":"signal_homeassistant","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": topic & \" has low battery (\" & payload & \")\" }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":3840,"wires":[[]]},{"id":"bc96c3f77cb59c1a","type":"server-state-changed","z":"9584418c.dafc2","name":"Smoke Alarm Battery Levels","server":"e1dc0b88.463bb8","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"alarm_battery_level","entityIdType":"substring","outputInitially":false,"stateType":"str","ifState":"80","ifStateType":"num","ifStateOperator":"lt","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":660,"y":3840,"wires":[["9d6f4f2f2b1e1400"],[]]},{"id":"19ede27409237241","type":"inject","z":"9584418c.dafc2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1260,"y":1880,"wires":[[]]},{"id":"28609db070a98f82","type":"http request","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Trigger USPS Automation","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://10.0.1.22:8123/api/webhook/usps_mail_detected","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-type","valueType":"other","valueValue":"application/json"}],"x":1290,"y":2380,"wires":[[]]},{"id":"04300ba2a76891a6","type":"switch","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Match USPS","property":"detection_result","propertyType":"msg","rules":[{"t":"eq","v":"usps","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1250,"y":2300,"wires":[["28609db070a98f82"]]},{"id":"0a096bcbb68139e5","type":"switch","z":"9584418c.dafc2","g":"9cfe6331fbc680d5","name":"Match USPS","property":"detection_result","propertyType":"msg","rules":[{"t":"eq","v":"Usps","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1230,"y":2340,"wires":[["28609db070a98f82"]]},{"id":"d269f175.c9dc6","type":"server-events","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Custom Water Event Fired","server":"e1dc0b88.463bb8","version":3,"exposeAsEntityConfig":"","eventType":"irrigation_custom_water","eventData":"","waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":190,"y":340,"wires":[["883f2c00.1d94e8"]]},{"id":"3367e45f.cc981c","type":"function","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"++","func":"if ( (msg.i += 1) < msg.zones.length ) return msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":400,"wires":[["116d5bb3.ee92a4"]]},{"id":"116d5bb3.ee92a4","type":"function","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"For Each","func":"if( msg.i == undefined ) msg.i = 0;\n\nmsg.payload = msg.zones[ msg.i ];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":340,"wires":[["565ee5c1.561bfc","80df47d5.602888","e2c37b65c5582c2b"]]},{"id":"80df47d5.602888","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":340,"wires":[[]]},{"id":"fb46876c.845298","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":400,"wires":[["98eeafa7.bd2b9","860a4c61d7557dc9"]]},{"id":"98eeafa7.bd2b9","type":"delay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Delay 5","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":980,"y":480,"wires":[["3367e45f.cc981c"]]},{"id":"565ee5c1.561bfc","type":"change","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":400,"wires":[["22a20603.86a06a"]]},{"id":"22a20603.86a06a","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"x":1090,"y":400,"wires":[["fb46876c.845298"],[],["a8d96e.1f00969"]]},{"id":"a8d96e.1f00969","type":"mqtt out","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":1350,"y":340,"wires":[]},{"id":"3b656b89.1ac154","type":"inject","z":"f602e6ba.609d28","g":"79694877249c9902","name":"3:00 Attempt","props":[{"p":"payload"}],"repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"zone\":\"switch.irrigation_front_beds\",\"time\":10,\"name\":\"Front beds\"},{\"zone\":\"switch.irrigation_front_lawn\",\"time\":20,\"name\":\"Front lawn\"},{\"zone\":\"switch.irrigation_left_and_main_rear_lawn\",\"time\":20,\"name\":\"Left and main rear lawn\"},{\"zone\":\"switch.irrigation_front_and_right_rear_lawn\",\"time\":20,\"name\":\"Front and right rear lawn\"},{\"zone\":\"switch.irrigation_side_lawn\",\"time\":20,\"name\":\"Side lawn\"}]","payloadType":"json","x":180,"y":1280,"wires":[["493b435f.c9851c"]]},{"id":"493b435f.c9851c","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Schedule Enabled","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.lawn_irrigation_scheduling","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":1280,"wires":[["8c060f00.cf577"],["7b12e66f.57d068"]]},{"id":"7b12e66f.57d068","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Automation Off\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1300,"wires":[[]]},{"id":"8c060f00.cf577","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","576b66fa1bd202a3"],"x":595,"y":1260,"wires":[]},{"id":"4422f61c.847d88","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["3ff9ce03ef7b554b"],"x":135,"y":1480,"wires":[["219b37105a8304f1"]]},{"id":"dcdeabc7.780578","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["1eaa857e.b6b8db","c90fd5e6.c5c678","b8fe96458628f202"],"x":595,"y":1460,"wires":[]},{"id":"722d03d6.2ff77c","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["8d4bfe8e.ee805","d67106b42368e630"],"x":135,"y":1900,"wires":[["b3c4a3638c17629e"]]},{"id":"af4788fe.215ba8","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["405789f7.0727a8","eb1a5268c1aec843","9896327569c234da"],"x":595,"y":1900,"wires":[]},{"id":"c90fd5e6.c5c678","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["dcdeabc7.780578","89d715ddf12d2195"],"x":135,"y":1600,"wires":[["e7430e17f0b24ed8"]]},{"id":"862ad27a.d347d","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["83edf648.3f9ed8"],"x":595,"y":1580,"wires":[]},{"id":"808e6a81.92e2e8","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":400,"wires":[["e42ff3d9.593dc"]]},{"id":"883f2c00.1d94e8","type":"api-current-state","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"24v Power","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.irrigation_24v_power","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":400,"wires":[["808e6a81.92e2e8"],["808e6a81.92e2e8"]]},{"id":"e42ff3d9.593dc","type":"delay","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Delay 5","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":480,"y":340,"wires":[["76160bc4.8cd644"]]},{"id":"76160bc4.8cd644","type":"change","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"","rules":[{"t":"set","p":"zones","pt":"msg","to":"payload.event.zones","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":340,"wires":[["116d5bb3.ee92a4"]]},{"id":"83edf648.3f9ed8","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["862ad27a.d347d","1bb3825011174363"],"x":135,"y":1700,"wires":[["b6e7d5b8891bba6d"]]},{"id":"8d4bfe8e.ee805","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["722d03d6.2ff77c"],"x":595,"y":1720,"wires":[]},{"id":"583f46a3.fc4c38","type":"inject","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"5:00 Attempt","props":[{"p":"payload"}],"repeat":"","crontab":"00 05 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"zone\":\"switch.irrigation_front_beds\",\"time\":10,\"name\":\"Front beds\"},{\"zone\":\"switch.irrigation_front_lawn\",\"time\":20,\"name\":\"Front lawn\"},{\"zone\":\"switch.irrigation_left_and_main_rear_lawn\",\"time\":20,\"name\":\"Left and main rear lawn\"},{\"zone\":\"switch.irrigation_front_and_right_rear_lawn\",\"time\":20,\"name\":\"Front and right rear lawn\"},{\"zone\":\"switch.irrigation_side_lawn\",\"time\":20,\"name\":\"Side lawn\"}]","payloadType":"json","x":180,"y":2620,"wires":[["d9147878.b61cf8"]]},{"id":"d9147878.b61cf8","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Schedule Enabled","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.front_bed_irrigation_scheduling","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":2620,"wires":[["c7e5552e.7f8a08"],["45c5dbbbd8ce50a1"]]},{"id":"c7e5552e.7f8a08","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","f6881b4bf93c27c5"],"x":595,"y":2600,"wires":[]},{"id":"6bcf06fb.9ca748","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["4f2902edc77f2d3b"],"x":135,"y":2820,"wires":[["ed6e3d4225582e20"]]},{"id":"f587589f.d739e8","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["1eaa857e.b6b8db","9d851699.6a8458"],"x":595,"y":2800,"wires":[]},{"id":"d9d17e8f.590e6","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["4fae5b92.a9cd44"],"x":135,"y":3040,"wires":[["d8637d8d96b68fca"]]},{"id":"d9f893eb.834f3","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["5ce1803b.06628"],"x":595,"y":3040,"wires":[]},{"id":"9d851699.6a8458","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f587589f.d739e8"],"x":135,"y":2940,"wires":[["593bee0e8c958df8"]]},{"id":"4fae5b92.a9cd44","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["d9d17e8f.590e6"],"x":595,"y":2920,"wires":[]},{"id":"a2ab7368.923fb","type":"template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Zone Settings Front Beds","field":"zones","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"zone\": \"switch.irrigation_front_beds\",\n \"time\": 20,\n \"name\": \"Front beds\"\n}","output":"json","x":250,"y":3200,"wires":[["62b5545bc6d6e627"]]},{"id":"a31e3daf.17207","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":3200,"wires":[["21ced698.708b5a","0fe0d325194604dd"]]},{"id":"21ced698.708b5a","type":"delay","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"2s","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":730,"y":3200,"wires":[["c661d489.9c9bc8"]]},{"id":"c661d489.9c9bc8","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": msg.zones.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":880,"y":3200,"wires":[["accc6697.196268"]]},{"id":"accc6697.196268","type":"change","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"msg.zones.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":3200,"wires":[["487ff788.8c5c98"]]},{"id":"487ff788.8c5c98","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"55a2162532da4e14","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"ignoretimerpass":false,"x":850,"y":3260,"wires":[["2238b09b.1b5b5","9129b06e.d8925"],[],["84258ddd.41da4"]]},{"id":"2238b09b.1b5b5","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": msg.zones.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":3340,"wires":[[]]},{"id":"84258ddd.41da4","type":"mqtt out","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":1130,"y":3320,"wires":[]},{"id":"9129b06e.d8925","type":"function","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Create msg object","func":"var message = \"Sprinkler auto-run: \" + msg.zones.name + \" ran for \" + msg.zones.time + \" minutes\"\n\nreturn { alert: message };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1050,"y":3260,"wires":[["d83b5ff7a2212931"]]},{"id":"5ce1803b.06628","type":"link in","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"","links":["db46e0c1.f9ab5","d9f893eb.834f3"],"x":95,"y":3200,"wires":[["a2ab7368.923fb"]]},{"id":"815fddc0.6604c","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Turn On 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":470,"y":1900,"wires":[["af4788fe.215ba8"]]},{"id":"418058c4.af3158","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Turn On 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":470,"y":3040,"wires":[["d9f893eb.834f3"]]},{"id":"1ae21386.a831bc","type":"inject","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"06:00 24v Off","props":[],"repeat":"","crontab":"00 06 * * *","once":false,"onceDelay":0.1,"topic":"","x":180,"y":1140,"wires":[["117145a7.67e99a","882aff35f788008b"]]},{"id":"117145a7.67e99a","type":"api-call-service","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"Turn Off 24v","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.irrigation_24v_power"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1100,"wires":[[]]},{"id":"06d6255efdc31c47","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":1380,"wires":[["2fc67b25514de5a5"],["3ff9ce03ef7b554b"]]},{"id":"5420d0eed32223fb","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","08e3098cf183e086"],"x":595,"y":1360,"wires":[]},{"id":"3ff9ce03ef7b554b","type":"link out","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["f1cbfe0.7dfb4","4422f61c.847d88","8524a273a6a8ffd0"],"x":595,"y":1400,"wires":[]},{"id":"576b66fa1bd202a3","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["8c060f00.cf577"],"x":135,"y":1380,"wires":[["06d6255efdc31c47"]]},{"id":"7350c911a0b1a86d","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":250,"y":2720,"wires":[["abb8777dd08aa743"],["4f2902edc77f2d3b"]]},{"id":"fdcfa1521191fa40","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","b403eec7866aea22"],"x":595,"y":2700,"wires":[]},{"id":"4f2902edc77f2d3b","type":"link out","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["f1cbfe0.7dfb4","6bcf06fb.9ca748"],"x":595,"y":2740,"wires":[]},{"id":"f6881b4bf93c27c5","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["c7e5552e.7f8a08"],"x":135,"y":2720,"wires":[["7350c911a0b1a86d"]]},{"id":"882aff35f788008b","type":"api-call-service","z":"f602e6ba.609d28","g":"0f07749a4e1672ad","name":"Turn Off Force Run","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_force_run"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":410,"y":1160,"wires":[[]]},{"id":"a3d75225807b70eb","type":"delay","z":"f602e6ba.609d28","g":"79694877249c9902","name":"30 Minute Delay","pauseType":"delay","timeout":"30","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":280,"y":1760,"wires":[["339ee0ada21856e0"]]},{"id":"e2c37b65c5582c2b","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn Off Start/Stop tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["automation.store_sprinkler_start_stop_times"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1060,"y":300,"wires":[[]]},{"id":"860a4c61d7557dc9","type":"api-call-service","z":"f602e6ba.609d28","g":"43a30fe5a5052c22","name":"Turn On Start/Stop tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["automation.store_sprinkler_start_stop_times"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1360,"y":460,"wires":[[]]},{"id":"aa53225140781dd7","type":"api-render-template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Evaluate Template","server":"e1dc0b88.463bb8","version":0,"template":"","resultsLocation":"data.continue","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":250,"y":3320,"wires":[["8113d83074ff7701"]]},{"id":"8113d83074ff7701","type":"switch","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Last Ran >= Template Hrs Ago","property":"data.continue","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":3320,"wires":[["a31e3daf.17207"],["f78cdb84200eb171"]]},{"id":"d83b5ff7a2212931","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Notify via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": alert \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1270,"y":3260,"wires":[[]]},{"id":"dd9855ca4017c8c0","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rainfall_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":580,"wires":[[]]},{"id":"c3a696a117416327","type":"function","z":"f602e6ba.609d28","d":true,"g":"a9182c2cc04d2d9a","name":"Check Rainfall","func":"var rain_override = false\n\nfor (var i = 0; i < msg.payload.length; i++) {\n if (parseFloat(msg.payload[i].state) > 0.25) {\n rain_override = true\n }\n}\n\n// top = proceed\n// bottom = overridden\nif (rain_override === true) {\n return [ null, {rain_override} ];\n} \nelse {\n return [ {rain_override}, null ];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":680,"wires":[["47f1a8018e58e032"],["dd9855ca4017c8c0"]]},{"id":"27f2580e35031830","type":"api-get-history","z":"f602e6ba.609d28","d":true,"g":"a9182c2cc04d2d9a","name":"Rainfall 120h","server":"e1dc0b88.463bb8","version":1,"startDate":"","endDate":"","entityId":"sensor.netatmo_home_rain_sum_rain_today_inches","entityIdType":"equals","useRelativeTime":true,"relativeTime":"120h","flatten":true,"outputType":"array","outputLocationType":"msg","outputLocation":"payload","x":310,"y":680,"wires":[["c3a696a117416327"]]},{"id":"9cb8187c669c6485","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rainfall","info":"","x":150,"y":600,"wires":[]},{"id":"47f1a8018e58e032","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rainfall_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":660,"wires":[[]]},{"id":"427f7fa58d86cc59","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/30","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":640,"wires":[["27f2580e35031830","93965a61d2c4f5de"]]},{"id":"1d9a4d0bb4645f32","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rain_forecast_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":840,"wires":[[]]},{"id":"d9ebbaa37f5911a9","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rain Forecast","info":"","x":170,"y":760,"wires":[]},{"id":"eeecfc1e8864e39f","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_rain_forecast_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":760,"wires":[[]]},{"id":"89487a4efedec1db","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/30","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":800,"wires":[["2c45af5b3ee5cf0a","c3cb1c7d15767014"]]},{"id":"1e4b3bc7c25b294f","type":"function","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Rain Chance","func":"// Check next 4 precipitation_probability values\n// HA Template: \n// {% for j in state_attr(\"weather.kcll_daynight\",\"forecast\")[:4] %}\n// {{ j.precipitation_probability }}\n// {% endfor %}\n\nvar forecast_override = false\n\n// if (parseFloat(msg.payload) > 40) {\n// forecast_override = true\n// }\n \nfor (var i = 0; i < 4; i++) {\n if (parseFloat(msg.data.attributes.forecast[i].precipitation_probability) >= 60) {\n forecast_override = true\n }\n}\n\n// top = proceed\n// bottom = overridden\nif (forecast_override === true) {\n return [ null, {forecast_override} ];\n} \nelse {\n return [ {forecast_override}, null ];\n}","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":800,"wires":[["eeecfc1e8864e39f"],["1d9a4d0bb4645f32"]]},{"id":"2c45af5b3ee5cf0a","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Weather","server":"e1dc0b88.463bb8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"weather.kcll_daynight","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":300,"y":800,"wires":[["1e4b3bc7c25b294f"]]},{"id":"d7e50e7a2810667d","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn on Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_wind_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":1000,"wires":[[]]},{"id":"28936ec687ee4eb0","type":"comment","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Wind","info":"","x":150,"y":920,"wires":[]},{"id":"974833b6a2eca853","type":"api-call-service","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Turn off Boolean","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.irrigation_wind_delay"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":920,"wires":[[]]},{"id":"478a5a84d38ba181","type":"inject","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"*/5","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":960,"wires":[["c01fd0612615e927"]]},{"id":"c01fd0612615e927","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Wind <= 10 MPH","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"10","halt_if_type":"num","halt_if_compare":"lte","entity_id":"sensor.nws_wind_speed","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":330,"y":960,"wires":[["974833b6a2eca853"],["d7e50e7a2810667d"]]},{"id":"219b37105a8304f1","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Rainfall Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rainfall_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":260,"y":1480,"wires":[["dcdeabc7.780578"],["d01fbafafbb34692"]]},{"id":"e7430e17f0b24ed8","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Rain Forecast Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rain_forecast_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":280,"y":1600,"wires":[["862ad27a.d347d"],["f5684be88477322f"]]},{"id":"b6e7d5b8891bba6d","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Wind Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_wind_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":1700,"wires":[["8d4bfe8e.ee805"],["a3d75225807b70eb"]]},{"id":"339ee0ada21856e0","type":"api-current-state","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Wind Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_wind_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":1820,"wires":[["8d4bfe8e.ee805"],["336585d4eee0ca73"]]},{"id":"ed6e3d4225582e20","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Rainfall Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rainfall_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":260,"y":2820,"wires":[["f587589f.d739e8"],["f7ac7a90f3da2298"]]},{"id":"593bee0e8c958df8","type":"api-current-state","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Rain Forecast Delay","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_rain_forecast_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":280,"y":2940,"wires":[["4fae5b92.a9cd44"],["67916c3a5554a794","4fae5b92.a9cd44"]]},{"id":"d01fbafafbb34692","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Rainfall\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1500,"wires":[[]]},{"id":"f5684be88477322f","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Rain Forecasted\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1620,"wires":[[]]},{"id":"336585d4eee0ca73","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Wind\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":1820,"wires":[[]]},{"id":"b3c4a3638c17629e","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Clear Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"None\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":1900,"wires":[["815fddc0.6604c"]]},{"id":"67916c3a5554a794","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Rain Forecasted\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2960,"wires":[[]]},{"id":"f7ac7a90f3da2298","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Rainfall\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2840,"wires":[[]]},{"id":"45c5dbbbd8ce50a1","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Automation Off\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":630,"y":2640,"wires":[[]]},{"id":"2fc67b25514de5a5","type":"api-call-service","z":"f602e6ba.609d28","g":"79694877249c9902","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.lawn_irrigation_reason"],"data":"{\"value\":\"Force Run\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":1360,"wires":[["5420d0eed32223fb"]]},{"id":"08e3098cf183e086","type":"link in","z":"f602e6ba.609d28","g":"79694877249c9902","name":"","links":["5420d0eed32223fb"],"x":325,"y":1960,"wires":[["815fddc0.6604c"]]},{"id":"abb8777dd08aa743","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Force Run\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":2700,"wires":[["fdcfa1521191fa40"]]},{"id":"d8637d8d96b68fca","type":"api-call-service","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"Clear Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"None\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":3040,"wires":[["418058c4.af3158"]]},{"id":"b403eec7866aea22","type":"link in","z":"f602e6ba.609d28","g":"68ec980b932fdba7","name":"","links":["fdcfa1521191fa40"],"x":325,"y":3100,"wires":[["418058c4.af3158"]]},{"id":"f2c9c3a5b8b11a64","type":"switch","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Continue?","property":"data.continue","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1230,"y":2060,"wires":[["287dd3b1af5dc2d0"],["bf015af2161c5ec2"]]},{"id":"9896327569c234da","type":"link in","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"","links":["af4788fe.215ba8"],"x":95,"y":2060,"wires":[["e95ac52f03478921"]]},{"id":"e95ac52f03478921","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Lawn Zones","field":"all_zones","fieldType":"msg","format":"json","syntax":"mustache","template":"[\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"name\": \"Side lawn\"\n }\n]","output":"json","x":290,"y":2060,"wires":[["287dd3b1af5dc2d0"]]},{"id":"174186fb5d054240","type":"api-render-template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Evaluate Template","server":"e1dc0b88.463bb8","version":0,"template":"","resultsLocation":"data.continue","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1050,"y":2060,"wires":[["f2c9c3a5b8b11a64"]]},{"id":"287dd3b1af5dc2d0","type":"array-loop","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Loop Through Zones","key":"al287dd3b1af5dc2d0","keyType":"msg","reset":true,"resetValue":"value-null","array":"all_zones","arrayType":"msg","x":220,"y":2120,"wires":[["74cd40702021e86d","acdcc72fea065aac"],["224d30a98f52c287"]]},{"id":"74cd40702021e86d","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Zone Settings Lawn","field":"zones","fieldType":"msg","format":"json","syntax":"mustache","template":"[\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"time\": 10,\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"time\": 10,\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"time\": 10,\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"time\": 10,\n \"name\": \"Side lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_lawn\",\n \"time\": 10,\n \"name\": \"Front lawn\"\n },\n {\n \"zone\": \"switch.irrigation_left_and_main_rear_lawn\",\n \"time\": 10,\n \"name\": \"Left and main rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_front_and_right_rear_lawn\",\n \"time\": 10,\n \"name\": \"Front and right rear lawn\"\n },\n {\n \"zone\": \"switch.irrigation_side_lawn\",\n \"time\": 10,\n \"name\": \"Side lawn\"\n }\n]","output":"json","x":460,"y":2180,"wires":[["151eb6ba5b2d39cd"]]},{"id":"bf015af2161c5ec2","type":"function","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Append Run Zones","func":"if (typeof msg.run_zones === 'undefined'){\n msg.run_zones = []\n}\n\n// Add zone to run_zones\nmsg.run_zones.push(msg.payload.zone)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":210,"y":2180,"wires":[["287dd3b1af5dc2d0"]]},{"id":"151eb6ba5b2d39cd","type":"array-loop","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Loop Through Zones","key":"al287dd3b1af5dc2d0","keyType":"msg","reset":true,"resetValue":"value-null","array":"zones","arrayType":"msg","x":720,"y":2180,"wires":[[],["45ee74d06e9cac2c"]]},{"id":"45ee74d06e9cac2c","type":"switch","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"If Zone in Run Zone","property":"run_zones","propertyType":"msg","rules":[{"t":"cont","v":"payload.zone","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":2240,"wires":[["8d3c8370996be2da"],["151eb6ba5b2d39cd"]]},{"id":"95a54981805b22f2","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn On Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":880,"y":2320,"wires":[["02d1e639f7ac6596","7b985932412db47d"]]},{"id":"a4b3eba196a504dc","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload.zone}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":540,"y":2500,"wires":[["6ea0448df1383ec2"]]},{"id":"02d1e639f7ac6596","type":"change","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Set Delay Variable","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload.time* 60000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2380,"wires":[["863b8fa63f210ebe"]]},{"id":"8d3c8370996be2da","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Turn On Master Valve","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":2320,"wires":[["b1c9631973c2f4b1","8f83c8d1d4492be0"]]},{"id":"863b8fa63f210ebe","type":"stoptimer-varidelay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","duration":"5","durationType":"num","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"Delay","reporting":"every_second","persist":false,"ignoretimerpass":false,"x":510,"y":2440,"wires":[["a4b3eba196a504dc","de509d99b9d965b3"],[],["7d8374976c01e3dc"]]},{"id":"7d8374976c01e3dc","type":"mqtt out","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Publish Time Remaining","topic":"sensor/irrigation_time_remaining","qos":"","retain":"","broker":"546e31ed.0db1c","x":790,"y":2460,"wires":[]},{"id":"b0debe46542c4c67","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Notify via Wrapper","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"script","service":"notify_wrapper","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"message\": alert \t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":2420,"wires":[[]]},{"id":"de509d99b9d965b3","type":"function","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Create msg object","func":"var message = \"Sprinkler auto-run: \" + msg.payload.name + \" ran for \" + msg.payload.time + \" minutes\"\n\nreturn { alert: message };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":2420,"wires":[["b0debe46542c4c67"]]},{"id":"b1c9631973c2f4b1","type":"delay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"2s","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":730,"y":2320,"wires":[["95a54981805b22f2"]]},{"id":"6ea0448df1383ec2","type":"delay","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Delay 10","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":320,"y":2440,"wires":[["151eb6ba5b2d39cd"]]},{"id":"224d30a98f52c287","type":"api-current-state","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Force Run","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.irrigation_force_run","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":510,"y":2060,"wires":[["bf015af2161c5ec2"],["38affe5cc680d076"]]},{"id":"5a27d31bfb4a6990","type":"comment","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Actually Handle Watering","info":"","x":1150,"y":2340,"wires":[]},{"id":"197853479ad9eeda","type":"comment","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Decide Which Zones to Run","info":"","x":1020,"y":2160,"wires":[]},{"id":"7b985932412db47d","type":"debug","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Log Zone On","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":2280,"wires":[]},{"id":"acdcc72fea065aac","type":"debug","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Log Run Zones","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":2260,"wires":[]},{"id":"f78cdb84200eb171","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Set Reason","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.front_bed_irrigation_reason"],"data":"{\"value\":\"Recently Ran\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":750,"y":3380,"wires":[[]]},{"id":"93965a61d2c4f5de","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"< 1\" in 5 Days","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"1","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.neighbor_5in1_rain_last_5_days","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":420,"y":620,"wires":[["dd9855ca4017c8c0"],["47f1a8018e58e032"]]},{"id":"54bad548.7e9fcc","type":"ha-get-entities","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Get \"On\" Sprinklers","server":"e1dc0b88.463bb8","version":1,"rules":[{"property":"entity_id","logic":"starts_with","value":"switch.irrigation","valueType":"str"},{"property":"entity_id","logic":"does_not_include","value":"switch.irrigation_master_valve,switch.irrigation_24v_power,switch.irrigation_drip","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"outputType":"array","outputEmptyResults":true,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":390,"y":100,"wires":[["bcbf413e.7b188"]]},{"id":"5a10cd93.8e94b4","type":"inject","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":100,"wires":[["54bad548.7e9fcc"]]},{"id":"a77808ff.3f1288","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"On Longer than 26 minutes?","property":"payload[0].timeSinceChangedMs","propertyType":"msg","rules":[{"t":"gte","v":"1600000","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":720,"y":60,"wires":[["54ae6ec3.1bc63"]]},{"id":"54ae6ec3.1bc63","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Turn Off Zone","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":[],"data":"{ \"entity_id\": payload[0].entity_id }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":60,"wires":[[]]},{"id":"bcbf413e.7b188","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["a77808ff.3f1288","3b848bce.76aea4"],["656ad2cd6fb99f57"]]},{"id":"3b848bce.76aea4","type":"change","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Reset Delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":100,"wires":[["cdd3b7ef.04a618"]]},{"id":"43dedcca.ac7734","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Turn Off Master","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.irrigation_master_valve"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":180,"wires":[["5093cf5ba33eb30a"]]},{"id":"c42e6d62.7a24c","type":"api-current-state","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Master On?","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.irrigation_master_valve","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":510,"y":200,"wires":[["cdd3b7ef.04a618","21aa3b57a72b3336"],["3b848bce.76aea4","1b05625730953169"]]},{"id":"cdd3b7ef.04a618","type":"trigger","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Wait 1m","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":880,"y":120,"wires":[["5e9007a27732bba9"]]},{"id":"63f07877e73b952a","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":1100,"y":180,"wires":[[],["749afd72791a5127"]]},{"id":"5e9007a27732bba9","type":"ha-get-entities","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Get \"On\" Sprinklers","server":"e1dc0b88.463bb8","version":1,"rules":[{"property":"entity_id","logic":"starts_with","value":"switch.irrigation","valueType":"str"},{"property":"entity_id","logic":"does_not_include","value":"switch.irrigation_master_valve,switch.irrigation_24v_power","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"outputType":"array","outputEmptyResults":true,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":1070,"y":120,"wires":[["63f07877e73b952a"]]},{"id":"061b74f643477dd9","type":"switch","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"More Than 0 Entities?","property":"payload","propertyType":"msg","rules":[{"t":"nempty"},{"t":"empty"}],"checkall":"true","repair":false,"outputs":2,"x":1360,"y":120,"wires":[["43dedcca.ac7734"],[]]},{"id":"749afd72791a5127","type":"trigger","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Wait 1m","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1260,"y":60,"wires":[["061b74f643477dd9"]]},{"id":"656ad2cd6fb99f57","type":"function","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"clear msg","func":"msg = {}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":200,"wires":[["c42e6d62.7a24c"]]},{"id":"c3cb1c7d15767014","type":"api-current-state","z":"f602e6ba.609d28","g":"a9182c2cc04d2d9a","name":"Weather","server":"e1dc0b88.463bb8","version":3,"outputs":2,"halt_if":"50","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.precip_probability","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":300,"y":860,"wires":[["1d9a4d0bb4645f32"],["eeecfc1e8864e39f"]]},{"id":"38affe5cc680d076","type":"template","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Template: Zone Last Ran >= 71 hours","field":"template","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{%- set entity_name = \"input_datetime{{ payload.zone }}\" | regex_replace(find='switch', replace='', ignorecase=False) -%}\n{%- set time = (as_timestamp(now()) - as_timestamp(states(entity_name+\"_last_start\"))) | int -%}\n{% if time >= 71*3600 %}1{% else %}0{% endif %}","output":"str","x":790,"y":2060,"wires":[["174186fb5d054240"]]},{"id":"62b5545bc6d6e627","type":"template","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Template: Zone Last Ran >= 23 hours","field":"template","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{%- set entity_name = \"input_datetime{{ zones.zone }}\" | regex_replace(find='switch', replace='', ignorecase=False) -%}\n{%- set time = (as_timestamp(now()) - as_timestamp(states(entity_name+\"_last_start\"))) | int -%}\n{% if time >= 23*3600 %}1{% else %}0{% endif %}","output":"str","x":310,"y":3260,"wires":[["aa53225140781dd7"]]},{"id":"5093cf5ba33eb30a","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Disable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"disable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1520,"y":180,"wires":[[]]},{"id":"1b05625730953169","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Disable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"disable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":200,"wires":[[]]},{"id":"21aa3b57a72b3336","type":"api-call-service","z":"f602e6ba.609d28","g":"3cf0491ac33aecfa","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":820,"y":160,"wires":[[]]},{"id":"8f83c8d1d4492be0","type":"api-call-service","z":"f602e6ba.609d28","g":"a08dae6118c91c19","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":900,"y":2280,"wires":[[]]},{"id":"0fe0d325194604dd","type":"api-call-service","z":"f602e6ba.609d28","g":"55a2162532da4e14","name":"Enable Tracking","server":"e1dc0b88.463bb8","version":5,"debugenabled":false,"domain":"homeassistant","service":"enable_entity","areaId":[],"deviceId":[],"entityId":["sensor.irrigation_water_usage"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":3280,"wires":[[]]}] \ No newline at end of file diff --git a/extras/appdaemon/apps/apps.yaml b/extras/appdaemon/apps/apps.yaml index 96647219..3e079c25 100644 --- a/extras/appdaemon/apps/apps.yaml +++ b/extras/appdaemon/apps/apps.yaml @@ -38,7 +38,7 @@ Set Smallgroup Boolean On: class: Timer constrain_presence: anyone constrain_days: wed - time_on: "08:00:00" + time_on: "05:00:00" entities: input_boolean.is_smallgroup Set Smallgroup Boolean Off: @@ -484,7 +484,7 @@ RTL433 Docker: class: Timer time_off: "01:00:00" time_on: "01:02:00" - entities: switch.docker_codeproject + entities: switch.docker_433_mqtt BVST Docker: module: entity_timer diff --git a/extras/cloudflared/config.yml b/extras/cloudflared/config.yml index 854727a3..adced8d4 100644 --- a/extras/cloudflared/config.yml +++ b/extras/cloudflared/config.yml @@ -9,6 +9,6 @@ ingress: - hostname: FQDN service: http://10.0.1.22:8123 # Placeholder mostly, but this is accessible - - hostname: FQDN - service: http://10.0.1.22:8123 + #- hostname: FQDN + # service: http://10.0.1.22:8123 - service: http_status:404 diff --git a/extras/docker-compose/other/docker-compose.yml b/extras/docker-compose/other/docker-compose.yml index 54fa6ec7..7f69a0b6 100644 --- a/extras/docker-compose/other/docker-compose.yml +++ b/extras/docker-compose/other/docker-compose.yml @@ -510,13 +510,12 @@ services: - traefik.http.routers.bb.service=bb ports: - 50922:10022 - - 127.0.0.1:1234:1234 # Bluebubbles API + - 1234:1234 # Bluebubbles API - 5999:5999 # vnc volumes: - /tmp/.X11-unix:/tmp/.X11-unix - /opt/macos/macos_ventura.qcow2:/image # Backed up on portable SSD - # networks: - # - macos_network + network_mode: host environment: - DISPLAY=${DISPLAY:-:0.0} - GENERATE_SPECIFIC=true @@ -539,7 +538,7 @@ services: privileged: true restart: always #image: ghcr.io/blakeblackshear/frigate:stable - image: ghcr.io/blakeblackshear/frigate:dev-0d7ee7a + image: ghcr.io/blakeblackshear/frigate:dev-4c2e6f7 shm_size: "256mb" devices: - /dev/bus/usb:/dev/bus/usb diff --git a/extras/docker-compose/unified/docker-compose.yml b/extras/docker-compose/unified/docker-compose.yml index d9ca11ed..454995be 100644 --- a/extras/docker-compose/unified/docker-compose.yml +++ b/extras/docker-compose/unified/docker-compose.yml @@ -725,13 +725,12 @@ services: - traefik.http.routers.bb.service=bb ports: - 50922:10022 - - 127.0.0.1:1234:1234 # Bluebubbles API + - 1234:1234 # Bluebubbles API - 5999:5999 # vnc volumes: - /tmp/.X11-unix:/tmp/.X11-unix - /opt/macos/macos_ventura.qcow2:/image # Backed up on portable SSD - # networks: - # - macos_network + network_mode: host environment: - DISPLAY=${DISPLAY:-:0.0} - GENERATE_SPECIFIC=true @@ -754,7 +753,7 @@ services: privileged: true restart: always #image: ghcr.io/blakeblackshear/frigate:stable - image: ghcr.io/blakeblackshear/frigate:dev-0d7ee7a + image: ghcr.io/blakeblackshear/frigate:dev-4c2e6f7 shm_size: "256mb" devices: - /dev/bus/usb:/dev/bus/usb diff --git a/extras/esphome/coffee_maker.yaml b/extras/esphome/coffee_maker.yaml index 9e6d0963..ea66e813 100644 --- a/extras/esphome/coffee_maker.yaml +++ b/extras/esphome/coffee_maker.yaml @@ -2,6 +2,12 @@ substitutions: name: "coffee_maker" friendly_name: "Coffee Maker" +globals: + - id: last_message + type: std::vector + - id: same_message_count + type: uint8_t + esphome: name: ${name} platform: ESP8266 @@ -9,11 +15,6 @@ esphome: <<: !include common.yaml -# Enable logging -logger: - # Disable serial logging - baud_rate: 0 - external_components: - source: github://TillFleisch/ESPHome-Philips-Smart-Coffee@main @@ -23,19 +24,68 @@ uart: rx_pin: GPIO3 baud_rate: 115200 id: uart_mainboard + # debug: + # direction: TX + # sequence: + # - lambda: | + # while (bytes.size()>=12) + # { + # // Search for start bytes + # // Checking byte 9 filters a lot of noisy (invalid) message but may also remove valuable message + # // Since we don't know how the checksum is calculated, this is the best we can do + # if (bytes[0] == 0xD5 && bytes[1] == 0x55 && + # (bytes[9] == 0x00 || bytes[9] == 0x01)) + # { + # // Assume D5 55 does not appear in messages, skip invalid messages + # for (int i = 2; i < 11; i++){ + # if (bytes[i] == 0xD5 && bytes[i+1] == 0x55){ + # bytes.erase(bytes.begin(), bytes.begin() + (i-1)); + # return; + # } + # } + + # // Log byte subsection + # std::vector subset(bytes.begin(), bytes.begin() + 12); + + # if(subset != id(last_message)){ + # // Append message repetition count + # id(last_message).push_back(0); + # id(last_message).push_back(0); + # id(last_message).push_back(id(same_message_count)); + + # // Filter out rare messages. This may also remove some valuable information + # if(id(same_message_count) > 3){ + # UARTDebug::log_hex(direction, id(last_message), ' '); + # } + # id(same_message_count)=0; + # } + + # id(last_message) = subset; + # id(same_message_count)++; + + # // remove logged bytes from buffer + # bytes.erase(bytes.begin(), bytes.begin() + 12); + # }else{ + # // remove first byte + # bytes.erase(bytes.begin()); + # } + # } # UART connected to the display - tx_pin: GPIO15 rx_pin: GPIO13 baud_rate: 115200 id: uart_display + # debug: + # after: + # bytes: 12 philips_coffee_machine: display_uart: uart_display mainboard_uart: uart_mainboard power_pin: GPIO12 id: philip - power_message_repetitions: 25 + #power_message_repetitions: 5 model: EP_3246 text_sensor: @@ -47,29 +97,84 @@ text_sensor: switch: - platform: philips_coffee_machine controller_id: philip - name: "${friendly_name} Power" + id: coffee_power_with_cleaning + name: "${friendly_name} Power With Cleaning" icon: mdi:coffee-maker - platform: philips_coffee_machine controller_id: philip clean: false - id: power_without_cleaning - name: "Power Without Cleaning" + id: coffee_power_without_cleaning + name: "${friendly_name} Power Without Cleaning" icon: mdi:coffee-maker button: + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_COFFEE + name: "${friendly_name} Select Coffee" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: MAKE_COFFEE + name: "${friendly_name} Make Coffee" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_AMERICANO + name: "${friendly_name} Select Americano" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: MAKE_AMERICANO + name: "${friendly_name} Make Americano" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_ESPRESSO + name: "${friendly_name} Select Espresso" + icon: mdi:coffee + - platform: philips_coffee_machine controller_id: philip action: MAKE_ESPRESSO name: "${friendly_name} Make Espresso" icon: mdi:coffee + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_CAPPUCCINO + name: "${friendly_name} Select Cappuccino" + icon: mdi:coffee + - platform: philips_coffee_machine controller_id: philip action: MAKE_CAPPUCCINO name: "${friendly_name} Make Cappuccino" icon: mdi:coffee + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_HOT_WATER + name: "${friendly_name} Select Hot Water" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: MAKE_HOT_WATER + name: "${friendly_name} Dispense Hot Water" + icon: mdi:coffee + + - platform: philips_coffee_machine + controller_id: philip + action: SELECT_LATTE + name: "${friendly_name} Select Latte" + icon: mdi:coffee + - platform: philips_coffee_machine controller_id: philip action: MAKE_LATTE @@ -79,27 +184,24 @@ button: - platform: philips_coffee_machine controller_id: philip action: PLAY_PAUSE - name: "${friendly_name} Select play/pause" + name: "${friendly_name} Select Play/Pause" icon: mdi:play-pause number: - platform: philips_coffee_machine type: bean - name: "${friendly_name} Coffee Beans" + name: "${friendly_name} Strength" controller_id: philip status_sensor_id: status - source: COFFEE - platform: philips_coffee_machine type: milk - name: "${friendly_name} Milk Setting" + name: "${friendly_name} Milk" controller_id: philip status_sensor_id: status - source: COFFEE - platform: philips_coffee_machine type: size - name: "${friendly_name} Coffee Size" + name: "${friendly_name} Size" controller_id: philip status_sensor_id: status - source: COFFEE \ No newline at end of file diff --git a/extras/esphome/water_meter_s3.yaml b/extras/esphome/water_meter_s3.yaml index af6171eb..36194399 100644 --- a/extras/esphome/water_meter_s3.yaml +++ b/extras/esphome/water_meter_s3.yaml @@ -22,6 +22,11 @@ esphome: "-DARDUINO_USB_MODE=1" ] +logger: + #level: DEBUG + # Disable serial logging + baud_rate: 0 + esp32: board: lolin_s3_mini variant: esp32s3 @@ -37,9 +42,9 @@ wifi: password: !secret wifi_password api: - #reboot_timeout: 0s # default - encryption: - key: !secret encryption_key + # #reboot_timeout: 0s # default + # encryption: + # key: !secret encryption_key ota: platform: esphome diff --git a/images/nodered_1.png b/images/nodered_1.png index ed20e08a4fe4c631d04a512c0bd015a0e1578438..387ec5471c07d54abec09a04c9c1231e77f29f25 100644 GIT binary patch delta 81 zcmey<$n>X?X+jl;9HS-MC5B$_jZGR2qK2j+hQ?L~7FMRl+6D$z1_o=NZH%0}zd=S3 VL*~wI&Zi7O;OXk;vd$@?2>>*s89D#} delta 81 zcmey<$n>X?X+jkTKQD)gt*OxSjZGR2q6U^B21Ztf7FH&f+6D$z1_mkX1q~l#m4U(fhffzzuI-dj W#E`kSCsv*T2s~Z=T-G@yGywp(DjOUC delta 81 zcmdlrnQ7N#rU_LX{Jb2N&MkRS8=IbWh#FXi7#LX@T3DGHYa19?85r=C`aPUn+bN@n VAycdIEtUZYJYD@<);T3K0RRUZ7u5g& diff --git a/packages/frigate.yaml b/packages/frigate.yaml index eca38cf6..636c562f 100644 --- a/packages/frigate.yaml +++ b/packages/frigate.yaml @@ -143,61 +143,99 @@ automation: - media_player.kitchen_photo_frame - media_player.office_photo_frame - - alias: Frigate Notification Deliveries - id: "frigate_notification_deliveries" + - alias: Frigate Notification USPS + id: "frigate_notification_usps" mode: single trigger: - - platform: mqtt - topic: frigate/events - payload: update - value_template: "{{ value_json.type }}" - - platform: mqtt - topic: frigate/events - payload: end - value_template: "{{ value_json.type }}" - condition: "{{ trigger.payload_json['after']['sub_label'] != 'Undefined' or trigger.payload_json['after']['label'] == 'PrimeAir' }}" + - platform: webhook + webhook_id: "usps_mail_detected" + allowed_methods: + - POST + local_only: true action: - - if: "{{ 'usps' in trigger.payload_json['after']['sub_label'] }}" - then: - - service: input_datetime.set_datetime - data: - entity_id: "input_datetime.usps_last" - time: "{{ ((as_timestamp(now())) | timestamp_custom('%H:%M:%S', true)) }}" - date: "{{ (as_timestamp(now()) | timestamp_custom('%Y-%m-%d', true)) }}" - - service: notify.signal_homeassistant + - service: input_datetime.set_datetime + data: + entity_id: "input_datetime.usps_last" + time: "{{ ((as_timestamp(now())) | timestamp_custom('%H:%M:%S', true)) }}" + date: "{{ (as_timestamp(now()) | timestamp_custom('%Y-%m-%d', true)) }}" + - service: camera.snapshot + data: + filename: /config/media/images/{{ '{{ entity_id.entity_id }}' }}/{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg + target: + entity_id: + - camera.usps_vehicle + - if: "{{ states('sensor.mail_usps_delivering') | int > 0 or states('sensor.mail_usps_mail') | int > 0}}" + then: + - service: notify.alexa_media + continue_on_error: true data: - message: "USPS detected" + message: "