diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..86858b3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release Workflow + +on: + release: + types: [published] + +jobs: + zip-files: + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout the repository + uses: actions/checkout@v3 + + - name: 🔢 Get release version + id: get_version + uses: mikefarah/yq@master + with: + cmd: yq '.homeassistant.customize."package.cn".version' packages/centro_notifiche/hub_main.yaml + + - name: 📦 Create zip file for the packages blueprints lovelace folder + uses: vimtor/action-zip@v1 + with: + files: packages/ blueprints/ lovelace/ + dest: centro_notifiche.zip + recursive: false + + - name: 📤 Upload the zip file as a release asset and 🖊️ Set version number + uses: svenstaro/upload-release-action@v1-release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: "${{ github.workspace }}/centro_notifiche.zip" + asset_name: centro_notifiche.zip + # default # tag: ${{ github.ref }} + tag: ${{ steps.get_version.outputs.result }} + prerelease: true + make_latest: false + overwrite: true diff --git a/README.md b/README.md index 9d38a43..da25770 100644 --- a/README.md +++ b/README.md @@ -34,51 +34,50 @@ To get started, head over to the **[Notifier Wiki][Wiki]**. ___ -
- ## Dashboard preview -### [My Lovelace Card Menu](./extra/my_lovelace_card.yaml) +
+ +### [Card My Menu Custom](./lovelace/card_my_menu_custom.yaml)

- +

-

-> Custom cards used for this menu: -> - > [Banner card](https://github.com/nervetattoo/banner-card), - > [Lovelace card mod](https://github.com/thomasloven/lovelace-card-mod), - > [Lovelace fold entity row](https://github.com/thomasloven/lovelace-fold-entity-row), - > [Lovelace multiline text input card](https://github.com/faeibson/lovelace-multiline-text-input-card), - > [Lovelace paper buttons row](https://github.com/jcwillox/lovelace-paper-buttons-row), - > [Lovelace slider entity row](https://github.com/thomasloven/lovelace-slider-entity-row), - > [Vertical stack in card](https://github.com/ofekashery/vertical-stack-in-card) +### My custom menu, contains all in one, but use these custom cards: + +[Hass Browser mod](https://github.com/thomasloven/hass-browser_mod), +[Lovelace card mod](https://github.com/thomasloven/lovelace-card-mod), +[Lovelace fold entity row](https://github.com/thomasloven/lovelace-fold-entity-row), + +[Lovelace multiline text input card](https://github.com/faeibson/lovelace-multiline-text-input-card), +[Lovelace paper buttons row](https://github.com/jcwillox/lovelace-paper-buttons-row), +[Vertical stack in card](https://github.com/ofekashery/vertical-stack-in-card)   -### [My Lovelace view](./extra/my_lovelace_view.yaml) +### [Standard Card Menu](./lovelace/card_menu.yaml)

- +

  -### [Standard Cards & Custom vertical Menu](./lovelace/) +### [Standard Card Menu HUI](./lovelace/card_menu_hui.yaml)

- +

  -### [Standard Lovelace View and Cards](./lovelace/) +### [Standard Dashboard](./lovelace/dashboard_raw.yaml)

- +

diff --git a/assets/images/CN_card_menu.png b/assets/images/CN_card_menu.png new file mode 100644 index 0000000..a7f83ad Binary files /dev/null and b/assets/images/CN_card_menu.png differ diff --git a/assets/images/CN_card_menu_hui.png b/assets/images/CN_card_menu_hui.png new file mode 100644 index 0000000..6ec8cd1 Binary files /dev/null and b/assets/images/CN_card_menu_hui.png differ diff --git a/assets/images/CN_card_my_menu_custom.png b/assets/images/CN_card_my_menu_custom.png new file mode 100644 index 0000000..c021fa4 Binary files /dev/null and b/assets/images/CN_card_my_menu_custom.png differ diff --git a/assets/images/CN_my_card_menu.png b/assets/images/CN_my_card_menu.png deleted file mode 100644 index 7949bcf..0000000 Binary files a/assets/images/CN_my_card_menu.png and /dev/null differ diff --git a/assets/images/CN_my_view.png b/assets/images/CN_my_view.png deleted file mode 100644 index 8679e6b..0000000 Binary files a/assets/images/CN_my_view.png and /dev/null differ diff --git a/assets/images/CN_standard_cards.png b/assets/images/CN_standard_cards.png deleted file mode 100644 index 1be3bb8..0000000 Binary files a/assets/images/CN_standard_cards.png and /dev/null differ diff --git a/assets/images/CN_standard_dashboard.png b/assets/images/CN_standard_dashboard.png new file mode 100644 index 0000000..6ef5f3e Binary files /dev/null and b/assets/images/CN_standard_dashboard.png differ diff --git a/assets/images/CN_vertical_stack_in_card_menu.png b/assets/images/CN_vertical_stack_in_card_menu.png deleted file mode 100644 index 12a21ee..0000000 Binary files a/assets/images/CN_vertical_stack_in_card_menu.png and /dev/null differ diff --git a/blueprints/automation/caiosweet/notifier_startup_configuration.yaml b/blueprints/automation/caiosweet/notifier_startup_configuration.yaml index 73f8814..b3d3ac5 100755 --- a/blueprints/automation/caiosweet/notifier_startup_configuration.yaml +++ b/blueprints/automation/caiosweet/notifier_startup_configuration.yaml @@ -1,15 +1,19 @@ blueprint: - name: Notifier startup configuration + name: Centro Notifiche - Configurazione Avvio description: > + `v5.0.12` + Blueprint per la configurazione del [Package Centro Notifiche](https://api.github.com/repos/caiosweet/Package-Notification-HUB-AppDaemon/releases/latest) per Appdaemon [Notifier Center](https://github.com/jumping2000/notifier) 🔔 - Authors [Caio](https://github.com/caiosweet), [Gianpi](https://github.com/jumping2000) by [Site hassiohelp](https://hassiohelp.eu/) - Date Started 01/11/2019 - Updated 20/05/2023 + Date Started 01/11/2019 - Updated 18/06/2023 Guida di riferimento per l'utilizzo del Progetto Centro Notifiche, ed altre informazioni le trovi sul [wiki](https://github.com/caiosweet/Package-Notification-HUB-AppDaemon/wiki) domain: automation author: https://github.com/caiosweet + homeassistant: + min_version: 2023.6.0 input: packages_folder: name: Package folder @@ -26,7 +30,7 @@ blueprint: name: Personal Assistant description: |- Imposta il nome del tuo assistente personale. - Verrà utilizzato nei titoli dei messaggi testuali e in dashborad. + Verrà utilizzato nei titoli dei messaggi testuali, in plancia, e nelle notifiche di home assistant. Esempio **[Jarvis - 20:43:12] Garage** _Choose a name for your personal assistant_ @@ -151,19 +155,21 @@ blueprint: enabled_home_assistant_event: name: Notification Home Assistant Event description: |- - Abilitazione per la ricezione dei seguentio eventi di home assistant: + Abilitazione per la ricezione dei seguenti eventi di home assistant: Avvio, Scrittura finale, Chiusura, Stop e Riavvio manuale. + Come opzione, puoi aggiungere nel tuo sistema, il sensore per conoscere i tempi di avvio di home assistant, che trovi nel file [utility](https://github.com/caiosweet/Package-Notification-HUB-AppDaemon/tree/main/extra) _Notification Home Assistant Start/Final Write/Close/Stop/Restart_ + _As an option, you can add in your system the sensor to know the home assistant startup time, which you find in the file [utility]_ default: on selector: boolean: {} default: true ha_event_notify: - name: Notification Home Assistant Start - description: >- - Puoi scegliere un o più servizi di "notify" diversi, per le notifiche di Home Assistant, invece di quello predefinito. + name: Notify service Notification Home Assistant Event + description: |- + Puoi scegliere uno o più servizi di "notify" diversi, per le notifiche di Home Assistant, invece di quello predefinito. _You can choose one or more different "notify" services for Home Assistant notifications instead of the default one._ default: the state of the text notification selector @@ -252,8 +258,7 @@ blueprint: sip_server_name: name: Service Sip server name description: |- - N. Tel / @user: inserire qui il numero di telefono da chiamare o l’utente telegram. - [Addon](https://github.com/sdesalve/hassio-addons/tree/master/dss_voip) del nostro Admin SDesalve o chiamata tramite [CallMeBot Telegram](https://www.callmebot.com/telegram-call-api/) + Inserire il servizio utilizzato nell'[Addon](https://github.com/sdesalve/hassio-addons/tree/master/dss_voip) del nostro Admin SDesalve _Service Sip server name_ default: fritz.box:5060 @@ -275,7 +280,8 @@ blueprint: download: name: Download description: |- - Scarica automaticamente le nuove versioni del pacchetto da Github. + Permette di scaricare i file, della versione più recente del package, al riavvio dell'app Notifier. + I file saranno salvati nella cartella centro_notifiche nella directory dei packages. _Download the new stable version of the package from Github._ default: off @@ -309,6 +315,8 @@ mode: parallel # mode: queued max: 50 max_exceeded: silent +trace: + stored_traces: 10 trigger_variables: time_pattern_hours: !input time_pattern_hours @@ -478,7 +486,7 @@ action: entities: >- {# Backword compatible .endswith('hub') #} {{states.automation - | select('match','.*[_\s]hub|.*notifier[_\s]', ignorecase=True) + | select('match','.*[_\s]hub|.*notifier[_\s]|centro.notifiche[_\s]', ignorecase=True) | map(attribute='entity_id') | list }} - alias: "Creation of the notifier_location_tracker Group from Person" @@ -505,25 +513,6 @@ action: object_id: notifier_player_google entities: "{{ google_media_player }}" - - alias: "IF DEBUG - GROUP SETTING" - if: "{{ debug }}" - then: - - service: persistent_notification.create - data: - notification_id: "centro_notifiche_config_group" - title: "GROUP Setting" - message: | - ```yaml - ___ - AUTO GROUPS - PERSON: {{ state_attr('group.notifier_location_tracker', 'entity_id') }} - ALEXA: {{ state_attr('group.notifier_player_alexa', 'entity_id') }} - GOOGLE: {{ state_attr('group.notifier_player_google', 'entity_id') }} - ___ - INTERATION: {{ integration_entities('group') }} - ___ - ``` - - alias: "Set the default settings to get started" if: - "{{ is_script }}" @@ -716,7 +705,7 @@ action: message: |- {% set message = data %} ```json - {{ message | to_json(pretty_print=true,sort_keys=False) }} + {{ message | to_json(pretty_print=true,sort_keys=True) }} ``` #------------------------------------------------------------------------------------# @@ -846,7 +835,6 @@ action: {% set DEFAULT_NOTIFY = iif(CN_NOTIFY in ['unavailable', 'unknown'], HA_NOTIFY, CN_NOTIFY)%} {{ iif(DEFAULT_NOTIFY is string, (DEFAULT_NOTIFY | regex_replace(find=" *, *", replace=",") | lower).rsplit(","), DEFAULT_NOTIFY) }} - ha_start: "{{ states('sensor.ha_start') }}" start_message: >- {{ iif(states('sensor.notifier_config') != "", states('sensor.notifier_config'), 'Il sistema ') }} è operativo!. @@ -861,42 +849,35 @@ action: title: "{{ icon }} {{ title }}" message: | ➡ {{ time }} - - choose: - - conditions: - - "{{ 'start' in title }}" - - "{{ is_script }}" - sequence: - - if: "{{ states.sensor.ha_start.state is defined }}" - then: - - service: homeassistant.update_entity - entity_id: - - sensor.ha_start - - sensor.verifica_tempi_setup - - wait_template: "{{ is_state('sensor.notifier_debug_error', 'on') }}" - # - wait_for_trigger: - # - platform: state - # entity_id: sensor.notifier_debug_error - # to: - # - "on" - # - "OK" - timeout: 120 - continue_on_timeout: true - - service: script.my_notify - data: - title: "HomeAssistant Start!" - notify: "notify.{{ notify_name }}" - message: | - 📬 {{ start_message }} 🕵 - 🟩 {{ iif(ha_start != 'unknown', ha_start, states('sensor.notifier_debug_error')) }} - alexa: - mode: "{{ repeat.index == 1 }}" - message: "{{ start_message }}" - voice: Giorgio - type: tts - google: - mode: "{{ repeat.index == 1 }}" - message: "{{ start_message }}" - # default: - # - service: "notify.{{ notify_service[0] }}" - # data: - # message: "DEFAULT: {{ icon }} {{ title }} {{ this.entity_id }}" + - if: + - "{{ 'start' in title }}" + - "{{ is_script }}" + then: + - wait_template: "{{ is_state('sensor.notifier_debug_error', 'on') }}" + timeout: 180 + continue_on_timeout: true + - if: + - "{{ states.sensor.ha_start.state is defined }}" + then: + - service: homeassistant.update_entity + entity_id: + - sensor.ha_start + # - sensor.verifica_tempi_setup + - wait_template: "{{ states('sensor.ha_start') not in ['Error', 'unknown'] }}" + timeout: "{{ wait.remaining }}" + - service: script.my_notify + data: + title: "HomeAssistant Start!" + notify: "notify.{{ notify_name }}" + message: | + 📬 {{ start_message }} 🕵 + 🟩 {{ iif(states('sensor.ha_start') != 'unknown', + states('sensor.ha_start'), states('sensor.notifier_debug_error')) }} + alexa: + mode: "{{ repeat.index == 1 }}" + message: "{{ start_message }}" + voice: Giorgio + type: tts + google: + mode: "{{ repeat.index == 1 }}" + message: "{{ start_message }}" diff --git a/examples/hub_automations.yaml b/examples/example_automations.yaml similarity index 86% rename from examples/hub_automations.yaml rename to examples/example_automations.yaml index 9b9b5e8..0efbbef 100644 --- a/examples/hub_automations.yaml +++ b/examples/example_automations.yaml @@ -4,95 +4,95 @@ #----------------------------------------------------------------------------------------------------# automation: #----------------------------------------------------------------------------------------------------# - # Home Assistant Start/Final Write/Close/Stop/Restart + # Home Assistant Start/Final Write/Close/Stop/Restart [👍 Integrated into blueprint projects] #----------------------------------------------------------------------------------------------------# - - alias: Home Assistant Start Stop Hub - description: "Notification Home Assistant Start/Final Write/Close/Stop/Restart" - initial_state: true - mode: queued - max_exceeded: silent - trigger: - - platform: homeassistant - event: start - - platform: homeassistant - event: shutdown - - platform: event - event_type: homeassistant_final_write - - platform: event - event_type: homeassistant_close - - platform: event - event_type: call_service - event_data: - domain: homeassistant - service: restart - - platform: event - event_type: core_config_updated - action: - - variables: - title: > - {{ (trigger.description | regex_replace(find="\W|_|event", replace=" ") | trim | capitalize) - if trigger.description is defined else "TEST" }} - time: "{{(now().time()|string)[:-4]}}" - icon: > - {% if 'stop' in title %}🛑 - {% elif 'final' in title %}🏁 - {% elif 'close' in title %}⛔ - {% elif 'restart' in title %}👍👍 - {% elif 'start' in title %}👍 - {% elif 'Call' in title %}📞 - {% else %}❗❓ - {% endif %} - notify_service: >- - {% set DEFAULT_NOTIFY = states('input_select.notifier_text_notify') %} - {{ (DEFAULT_NOTIFY|replace('notify.','')|regex_replace(find=" *, *", replace=",")|lower).rsplit(",") - if DEFAULT_NOTIFY is string else DEFAULT_NOTIFY }} - - choose: - - conditions: "{{ title != 'TEST' }}" - sequence: - - alias: "Repeat text notify" - repeat: - while: "{{ repeat.index <= notify_service | length }}" - sequence: - - variables: - notify_name: "{{ notify_service[repeat.index -1] | replace(' ','_') | lower }}" - - service: "notify.{{ notify_name }}" - data: - title: "{{ icon }} {{ title }}" - message: | - ➡ {{ time }} - - choose: - - conditions: "{{ 'start' in title }}" - sequence: - - service: homeassistant.update_entity - entity_id: - - sensor.ha_start - - sensor.verifica_tempi_setup - - wait_for_trigger: - - platform: state - entity_id: sensor.notifier_debug_error - to: "on" - timeout: 120 - continue_on_timeout: true - - service: script.my_notify - data: - title: "HomeAssistant Start!" - notify: "notify.{{ notify_name }}" - message: | - 📬 Centro Notifiche operativo! 🕵 - 🟩 {{ states('sensor.ha_start') }} - alexa: - message: >- - Il sistema è operativo!. - voice: Giorgio - type: tts - google: - priority: true - message: >- - Il sistema è operativo!. - default: - - service: "notify.{{ (notify_service | default(['notify']))[0] | replace(' ','_') | lower }}" - data: - message: "DEFAULT: {{ icon }} {{ title }} {{ trigger | replace('_','\_') }} {{ this | replace('_','\_') }}" + # - alias: Home Assistant Start Stop Hub + # description: "Notification Home Assistant Start/Final Write/Close/Stop/Restart" + # initial_state: true + # mode: queued + # max_exceeded: silent + # trigger: + # - platform: homeassistant + # event: start + # - platform: homeassistant + # event: shutdown + # - platform: event + # event_type: homeassistant_final_write + # - platform: event + # event_type: homeassistant_close + # - platform: event + # event_type: call_service + # event_data: + # domain: homeassistant + # service: restart + # - platform: event + # event_type: core_config_updated + # action: + # - variables: + # title: > + # {{ (trigger.description | regex_replace(find="\W|_|event", replace=" ") | trim | capitalize) + # if trigger.description is defined else "TEST" }} + # time: "{{(now().time()|string)[:-4]}}" + # icon: > + # {% if 'stop' in title %}🛑 + # {% elif 'final' in title %}🏁 + # {% elif 'close' in title %}⛔ + # {% elif 'restart' in title %}👍👍 + # {% elif 'start' in title %}👍 + # {% elif 'Call' in title %}📞 + # {% else %}❗❓ + # {% endif %} + # notify_service: >- + # {% set DEFAULT_NOTIFY = states('input_select.notifier_text_notify') %} + # {{ (DEFAULT_NOTIFY|replace('notify.','')|regex_replace(find=" *, *", replace=",")|lower).rsplit(",") + # if DEFAULT_NOTIFY is string else DEFAULT_NOTIFY }} + # - choose: + # - conditions: "{{ title != 'TEST' }}" + # sequence: + # - alias: "Repeat text notify" + # repeat: + # while: "{{ repeat.index <= notify_service | length }}" + # sequence: + # - variables: + # notify_name: "{{ notify_service[repeat.index -1] | replace(' ','_') | lower }}" + # - service: "notify.{{ notify_name }}" + # data: + # title: "{{ icon }} {{ title }}" + # message: | + # ➡ {{ time }} + # - choose: + # - conditions: "{{ 'start' in title }}" + # sequence: + # - service: homeassistant.update_entity + # entity_id: + # - sensor.ha_start + # - sensor.verifica_tempi_setup + # - wait_for_trigger: + # - platform: state + # entity_id: sensor.notifier_debug_error + # to: "on" + # timeout: 120 + # continue_on_timeout: true + # - service: script.my_notify + # data: + # title: "HomeAssistant Start!" + # notify: "notify.{{ notify_name }}" + # message: | + # 📬 Centro Notifiche operativo! 🕵 + # 🟩 {{ states('sensor.ha_start') }} + # alexa: + # message: >- + # Il sistema è operativo!. + # voice: Giorgio + # type: tts + # google: + # priority: true + # message: >- + # Il sistema è operativo!. + # default: + # - service: "notify.{{ (notify_service | default(['notify']))[0] | replace(' ','_') | lower }}" + # data: + # message: "DEFAULT: {{ icon }} {{ title }} {{ trigger | replace('_','\_') }} {{ this | replace('_','\_') }}" #----------------------------------------------------------------------------------------------------# # Accesso Fallito # Banned IP persistent_notification.ip_ban title: Banning IP address diff --git a/examples/hub_build_message.yml b/examples/example_build_message.yml similarity index 100% rename from examples/hub_build_message.yml rename to examples/example_build_message.yml diff --git a/examples/hub_build_message.yml_by_Angelo b/examples/example_build_message.yml_by_Angelo similarity index 100% rename from examples/hub_build_message.yml_by_Angelo rename to examples/example_build_message.yml_by_Angelo diff --git a/extra/utility.yaml b/extra/utility.yaml new file mode 100644 index 0000000..2b1182c --- /dev/null +++ b/extra/utility.yaml @@ -0,0 +1,37 @@ +command_line: +#------------------------------------------------------------------------------# +# Home Assistant initialized sesnor +#------------------------------------------------------------------------------# + - sensor: + name: HA Start + command: > + grep -m1 'Home Assistant initialized' home-assistant.log + | awk '{ print $6, $7, $8, $9, $10 }' + value_template: '{{ value | default("Error", true) }}' + scan_interval: 525600 # 1 year + +#------------------------------------------------------------------------------# +# Home Assistant Setup of domain sensor +#------------------------------------------------------------------------------# + - sensor: + name: Verifica tempi setup + command: > + grep 'Setup of domain' home-assistant.log + | tail | cut -c -255 | awk '$11 > 10 { print $9, $11 " sec" }' + value_template: '{{ value | default("Setup Domain Ok", true) }}' + scan_interval: 525600 # 1 year + +## N.B. In order to use sensor.ha_start, set the info logs in this way + +# logger: +# default: warn # or whatever you want (info, error...) +# logs: +# homeassistant.bootstrap: info + +## If you need to use these sensors outside my project, +## then remember to insert this service when Home Assistant restarts. + +# service: homeassistant.update_entity +# entity_id: +# - sensor.ha_start +# - sensor.verifica_tempi_setup \ No newline at end of file diff --git a/lovelace/card_alexa.yaml b/lovelace/card_alexa.yaml index 60bd5d4..b1d593f 100755 --- a/lovelace/card_alexa.yaml +++ b/lovelace/card_alexa.yaml @@ -1,40 +1,45 @@ -type: entities -title: Alexa -show_header_toggle: false -state_color: true -entities: - - type: section - label: '' - - entity: input_boolean.notifier_alexa_switch - icon: mdi:dots-circle - - entity: select.notifier_player_alexa - - entity: input_select.notifier_alexa_type - - entity: input_select.notifier_alexa_method - - entity: input_boolean.notifier_alexa_smart_volume - - entity: binary_sensor.notifier_alexa_speak - icon: mdi:speaker-message - name: Alexa Parla - - type: section - label: SSML - - entity: input_boolean.notifier_alexa_ssml - - entity: input_select.notifier_alexa_voice - - entity: input_select.notifier_alexa_language - - entity: input_number.notifier_alexa_prosody_rate - - entity: input_number.notifier_alexa_prosody_pitch - - entity: input_number.notifier_alexa_prosody_volume - - entity: button.notifier_ssml_reset - - type: section - label: Info +type: conditional +conditions: - entity: sensor.notifier_player_alexa - - type: attribute - name: Entities list - entity: sensor.notifier_player_alexa - attribute: entities - - type: attribute - entity: sensor.notifier_player_alexa - attribute: selected - - entity: group.notifier_player_alexa - - type: attribute - entity: group.notifier_player_alexa - attribute: entity_id - name: Players + state_not: unavailable +card: + type: entities + title: Alexa + show_header_toggle: false + state_color: true + entities: + - type: section + label: '' + - entity: input_boolean.notifier_alexa_switch + icon: mdi:dots-circle + - entity: select.notifier_player_alexa + - entity: input_select.notifier_alexa_type + - entity: input_select.notifier_alexa_method + - entity: input_boolean.notifier_alexa_smart_volume + - entity: binary_sensor.notifier_alexa_speak + icon: mdi:speaker-message + name: Alexa Parla + - type: section + label: SSML + - entity: input_boolean.notifier_alexa_ssml + - entity: input_select.notifier_alexa_voice + - entity: input_select.notifier_alexa_language + - entity: input_number.notifier_alexa_prosody_rate + - entity: input_number.notifier_alexa_prosody_pitch + - entity: input_number.notifier_alexa_prosody_volume + - entity: button.notifier_ssml_reset + - type: section + label: Info + - entity: sensor.notifier_player_alexa + - type: attribute + name: Entities list + entity: sensor.notifier_player_alexa + attribute: entities + - type: attribute + entity: sensor.notifier_player_alexa + attribute: selected + - entity: group.notifier_player_alexa + - type: attribute + entity: group.notifier_player_alexa + attribute: entity_id + name: Players diff --git a/lovelace/card_centro_notifiche.yaml b/lovelace/card_centro_notifiche.yaml index 076963d..08c2cce 100755 --- a/lovelace/card_centro_notifiche.yaml +++ b/lovelace/card_centro_notifiche.yaml @@ -1,29 +1,34 @@ -type: entities -title: Centro Notifiche -show_header_toggle: false -state_color: true -entities: - - type: section - label: Monitor - - entity: binary_sensor.notifier_people_home - - entity: group.notifier_location_tracker - - entity: sensor.notifier_day_period - - entity: sensor.notifier_day_period_volume - - entity: binary_sensor.notifier_dnd - - type: section - label: Modalità - - entity: group.notifier_group_notification - - entity: input_boolean.notifier_text_notifications - - entity: input_boolean.notifier_screen_notifications - - entity: input_boolean.notifier_speech_notifications - - entity: input_boolean.notifier_phone_notifications - - type: section - label: '' - - entity: input_boolean.notifier_holidays - - entity: input_boolean.notifier_guest_mode - - entity: input_boolean.notifier_priority_message - - type: section - label: Interfono - - entity: input_number.notifier_intercom_volume - - entity: input_text.notifier_intercom_message - - entity: button.notifier_last_message +type: conditional +conditions: + - entity: script.my_notify + state_not: unavailable +card: + type: entities + title: Centro Notifiche + show_header_toggle: false + state_color: true + entities: + - type: section + label: Monitor + - entity: binary_sensor.notifier_people_home + - entity: group.notifier_location_tracker + - entity: sensor.notifier_day_period + - entity: sensor.notifier_day_period_volume + - entity: binary_sensor.notifier_dnd + - type: section + label: Modalità + - entity: group.notifier_group_notification + - entity: input_boolean.notifier_text_notifications + - entity: input_boolean.notifier_screen_notifications + - entity: input_boolean.notifier_speech_notifications + - entity: input_boolean.notifier_phone_notifications + - type: section + label: '' + - entity: input_boolean.notifier_holidays + - entity: input_boolean.notifier_guest_mode + - entity: input_boolean.notifier_priority_message + - type: section + label: Interfono + - entity: input_number.notifier_intercom_volume + - entity: input_text.notifier_intercom_message + - entity: button.notifier_last_message diff --git a/lovelace/card_google.yaml b/lovelace/card_google.yaml index dc3326e..6a2b856 100755 --- a/lovelace/card_google.yaml +++ b/lovelace/card_google.yaml @@ -1,25 +1,30 @@ -type: entities -title: Google -show_header_toggle: false -state_color: true -entities: - - type: section - label: '' - - entity: input_boolean.notifier_google_switch - - entity: select.notifier_player_google - - entity: input_select.notifier_tts_notify - - type: section - label: Info +type: conditional +conditions: - entity: sensor.notifier_player_google - - type: attribute - name: Entities list - entity: sensor.notifier_player_google - attribute: entities - - type: attribute - name: Selected - entity: sensor.notifier_player_google - attribute: selected - - entity: group.notifier_player_google - - type: attribute - entity: group.notifier_player_google - attribute: entity_id + state_not: unavailable +card: + type: entities + title: Google + show_header_toggle: false + state_color: true + entities: + - type: section + label: '' + - entity: input_boolean.notifier_google_switch + - entity: select.notifier_player_google + - entity: input_select.notifier_tts_notify + - type: section + label: Info + - entity: sensor.notifier_player_google + - type: attribute + name: Entities list + entity: sensor.notifier_player_google + attribute: entities + - type: attribute + name: Selected + entity: sensor.notifier_player_google + attribute: selected + - entity: group.notifier_player_google + - type: attribute + entity: group.notifier_player_google + attribute: entity_id diff --git a/lovelace/card_impostazioni_assistente.yaml b/lovelace/card_impostazioni_assistente.yaml index b90d068..4df4031 100755 --- a/lovelace/card_impostazioni_assistente.yaml +++ b/lovelace/card_impostazioni_assistente.yaml @@ -3,10 +3,16 @@ title: Impostazioni Assistente show_header_toggle: false state_color: true entities: - - entity: automation.notifier_startup_configuration + - entity: automation.centro_notifiche_configurazione_avvio - entity: sensor.notifier_config - - entity: sensor.notifier_debug_error - icon: mdi:account-wrench + - type: conditional + conditions: + - entity: sensor.notifier_debug_error + state_not: unavailable + row: + entity: sensor.notifier_debug_error + name: Notifier Debug Error + icon: mdi:account-wrench - entity: input_button.notifier_reset_config - type: button icon: mdi:restart @@ -38,7 +44,7 @@ entities: - entity: input_datetime.notifier_start_holidays - entity: input_datetime.notifier_end_holidays - type: section - label: VOLUME di default durante il griorno + label: VOLUME di default e Periodo del griorno - entity: group.notifier_group_volumes - entity: input_datetime.notifier_start_early_morning - entity: input_number.notifier_early_morning_volume diff --git a/lovelace/card_menu.yaml b/lovelace/card_menu.yaml index 86cbf42..f66807c 100755 --- a/lovelace/card_menu.yaml +++ b/lovelace/card_menu.yaml @@ -1,257 +1,284 @@ -type: vertical-stack -cards: - - type: markdown - content: > -
🤵 - {{states('sensor.notifier_config')}}
+type: conditional +conditions: + - entity: script.my_notify + state_not: unavailable +card: + type: vertical-stack + cards: + - type: markdown + content: > +
🤵 {{ states('sensor.notifier_config') + }}
- {% if states('sensor.notifier_debug_error') not in ['on','OK']%} + {% if states('sensor.notifier_debug_error') not in ['on','OK'] %} - + - {{states('sensor.notifier_debug_error')}} + {{ states('sensor.notifier_debug_error') }} - + - {% endif %} - - square: true - type: grid - columns: 8 - cards: - - show_name: false - show_icon: true - type: button - show_state: false - entity: group.notifier_group_notification - icon: '' - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_speech_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_text_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_screen_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_phone_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_guest_mode - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_priority_message - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_holidays - - square: true - type: grid - columns: 5 - cards: - - show_name: false - show_icon: true - type: button - show_state: true - entity: binary_sensor.notifier_dnd - tap_action: - action: more-info - - show_name: false - show_icon: true - type: button - show_state: true - entity: binary_sensor.notifier_people_home - tap_action: - action: more-info - - show_name: false - show_icon: true - type: button - show_state: true - entity: group.notifier_location_tracker - tap_action: - action: more-info - - show_name: false - show_icon: true - icon: '' - type: button - show_state: true - tap_action: - action: more-info - entity: sensor.notifier_config - - show_name: false - show_icon: true - icon: mdi:account-wrench - type: button - show_state: true - tap_action: - action: more-info - entity: sensor.notifier_debug_error - - type: glance - columns: 3 - show_icon: false - entities: - - entity: sensor.notifier_day_period - - entity: sensor.notifier_day_period_volume - - entity: input_select.notifier_language - - type: entities - entities: - - type: conditional - conditions: - - entity: sensor.notifier_text_notify - state_not: unavailable - row: - entity: sensor.notifier_text_notify - type: attribute - attribute: selected + {% endif %} + - type: grid + square: true + columns: 8 + cards: + - type: button + entity: group.notifier_group_notification + show_icon: true + show_name: false + show_state: false + icon: '' + - type: button + entity: input_boolean.notifier_speech_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_text_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_screen_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_phone_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_guest_mode + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_priority_message + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_holidays + show_icon: true + show_name: false + show_state: false + - type: grid + square: false + columns: 5 + cards: + - type: button + entity: automation.centro_notifiche_configurazione_avvio + show_icon: true + show_name: false tap_action: - action: call-service - service: select.select_next - target: - entity_id: select.notifier_text_notify - data: - cycle: true - double_tap_action: - action: call-service - service: select.select_first - target: - entity_id: select.notifier_text_notify - hold_action: action: more-info - - type: conditional - conditions: - - entity: sensor.notifier_player_alexa - state_not: unavailable - row: - entity: sensor.notifier_player_alexa - type: attribute - attribute: selected + - type: button + entity: sensor.notifier_config + show_icon: true + show_name: false tap_action: - action: call-service - service: select.select_next - target: - entity_id: select.notifier_player_alexa - data: - cycle: true - double_tap_action: - action: call-service - service: select.select_first - target: - entity_id: select.notifier_player_alexa - hold_action: action: more-info - - type: conditional - conditions: - - entity: sensor.notifier_player_google - state_not: unavailable - row: - entity: sensor.notifier_player_google - type: attribute - attribute: selected + - type: button + entity: sensor.notifier_debug_error + show_icon: true + show_name: false + icon: mdi:account-wrench tap_action: - action: call-service - service: select.select_next - target: - entity_id: select.notifier_player_google - data: - cycle: true - double_tap_action: - action: call-service - service: select.select_first - target: - entity_id: select.notifier_player_google - hold_action: action: more-info - - type: horizontal-stack - cards: - - type: conditional - conditions: - - entity: input_boolean.notifier_google_switch - state_not: unavailable - card: - type: button - show_name: false + - type: button + entity: input_button.notifier_reset_config show_icon: true - icon_height: 24px - entity: input_boolean.notifier_google_switch + show_name: false + show_state: false + action_name: Reset tap_action: action: toggle - - type: conditional - conditions: - - entity: input_boolean.notifier_google_switch - state_not: unavailable - card: - type: button - show_name: false - show_icon: false - show_state: true - entity: input_select.notifier_tts_notify + confirmation: + text: Procedo al reset della configurazione? + - type: button + icon: mdi:restart tap_action: action: call-service - service: input_select.select_next + confirmation: + text: Sei sicuro di voler riavviare l'App Notifier? + service: script.my_notify service_data: - entity_id: input_select.notifier_tts_notify - - type: conditional - conditions: - - entity: input_boolean.notifier_alexa_switch - state_not: unavailable - card: - type: button - show_name: false + ad: + command: restart + - type: grid + square: false + columns: 4 + cards: + - type: button + entity: group.notifier_location_tracker show_icon: true - icon_height: 24px - entity: input_boolean.notifier_alexa_switch - tap_action: - action: toggle - icon: mdi:dots-circle - - type: conditional - conditions: - - entity: input_boolean.notifier_alexa_switch - state_not: unavailable - card: - type: button show_name: false - show_icon: false show_state: true - entity: input_select.notifier_alexa_type tap_action: - action: call-service - service: input_select.select_next - service_data: - entity_id: input_select.notifier_alexa_type - - type: conditional - conditions: - - entity: input_boolean.notifier_alexa_switch - state_not: unavailable - card: - type: button + action: more-info + - type: button + entity: sensor.notifier_day_period + show_name: false + show_state: true + - type: button + entity: sensor.notifier_day_period_volume + show_name: false + show_state: true + - type: button + entity: binary_sensor.notifier_dnd + show_name: false + show_state: true + - type: entities + state_color: true + entities: + - type: attribute + entity: binary_sensor.notifier_people_home + name: In casa + attribute: name + - type: conditional + conditions: + - entity: sensor.notifier_text_notify + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_text_notify + attribute: selected + name: Notify + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_text_notify + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_text_notify + hold_action: + action: more-info + - type: conditional + conditions: + - entity: sensor.notifier_player_alexa + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_player_alexa + attribute: selected + name: Alexa + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_player_alexa + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_player_alexa + hold_action: + action: more-info + - type: conditional + conditions: + - entity: sensor.notifier_player_google + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_player_google + attribute: selected + name: Google + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_player_google + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_player_google + hold_action: + action: more-info + - entity: input_text.notifier_intercom_message + - entity: input_number.notifier_intercom_volume + - type: horizontal-stack + cards: + - type: conditional + conditions: + - entity: input_boolean.notifier_google_switch + state_not: unavailable + card: + type: button + entity: input_boolean.notifier_google_switch + show_name: false + show_icon: true + icon_height: 24px + tap_action: + action: toggle + - type: conditional + conditions: + - entity: input_boolean.notifier_google_switch + state_not: unavailable + card: + type: button + entity: input_select.notifier_tts_notify + show_name: false + show_icon: false + show_state: true + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.notifier_tts_notify + - type: conditional + conditions: + - entity: input_boolean.notifier_alexa_switch + state_not: unavailable + card: + type: button + entity: input_boolean.notifier_alexa_switch + show_name: false + show_icon: true + icon_height: 24px + tap_action: + action: toggle + icon: mdi:dots-circle + - type: conditional + conditions: + - entity: input_boolean.notifier_alexa_switch + state_not: unavailable + card: + type: button + entity: input_select.notifier_alexa_type + show_name: false + show_icon: false + show_state: true + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.notifier_alexa_type + - type: conditional + conditions: + - entity: input_boolean.notifier_alexa_switch + state_not: unavailable + card: + type: button + entity: input_boolean.notifier_alexa_ssml + show_name: false + icon_height: 24px + tap_action: + action: toggle + - type: button + entity: button.notifier_last_message show_name: false icon_height: 24px - entity: input_boolean.notifier_alexa_ssml tap_action: action: toggle - - type: button - show_name: false - icon_height: 24px - entity: button.notifier_last_message - tap_action: - action: toggle - - type: entities - show_header_toggle: false - state_color: true - entities: - - entity: input_text.notifier_intercom_message - - entity: input_number.notifier_intercom_volume diff --git a/lovelace/card_menu_custom.yaml b/lovelace/card_menu_custom.yaml deleted file mode 100755 index eccf187..0000000 --- a/lovelace/card_menu_custom.yaml +++ /dev/null @@ -1,195 +0,0 @@ -type: custom:vertical-stack-in-card -cards: - - type: markdown - content: > -
🤵 - {{states('sensor.notifier_config')}}
- - {% if not states('sensor.notifier_debug_error') in ['on','OK']%} - - - - {{states('sensor.notifier_debug_error')}} - - - - {% endif %} - - type: divider - style: - background-color: var(--primary-color) - height: 1px - - type: grid - columns: 10 - square: true - cards: - - show_name: false - show_icon: true - type: button - show_state: false - entity: binary_sensor.notifier_people_home - tap_action: - action: more-info - - show_name: false - show_icon: true - type: button - show_state: false - entity: group.notifier_location_tracker - tap_action: - action: more-info - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_phone_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_speech_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_text_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_screen_notifications - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_guest_mode - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_priority_message - - show_name: false - show_icon: true - type: button - show_state: false - entity: input_boolean.notifier_holidays - - show_name: false - show_icon: true - type: button - show_state: false - entity: binary_sensor.notifier_dnd - tap_action: - action: more-info - - type: divider - style: - background-color: var(--primary-color) - height: 1px - - type: glance - columns: 3 - show_icon: false - entities: - - entity: sensor.notifier_day_period - - entity: sensor.notifier_day_period_volume - - entity: input_select.notifier_language - - entity: select.notifier_player_alexa - tap_action: - action: call-service - service: select.select_next - service_data: - entity_id: select.notifier_player_alexa - hold_action: - action: call-service - service: input_select.select_previous - service_data: - entity_id: select.notifier_player_alexa - double_tap_action: - action: more-info - - entity: select.notifier_player_google - tap_action: - action: call-service - service: select.select_next - service_data: - entity_id: select.notifier_player_google - hold_action: - action: call-service - service: input_select.select_previous - service_data: - entity_id: select.notifier_player_google - double_tap_action: - action: more-info - - entity: select.notifier_text_notify - tap_action: - action: call-service - service: select.select_next - service_data: - entity_id: select.notifier_text_notify - hold_action: - action: call-service - service: input_select.select_previous - service_data: - entity_id: select.notifier_text_notify - double_tap_action: - action: more-info - - type: divider - style: - background-color: var(--primary-color) - height: 1px - - type: horizontal-stack - cards: - - type: button - state_color: true - show_name: false - icon_height: 24px - entity: input_boolean.notifier_google_switch - tap_action: - action: toggle - - type: button - state_color: true - show_name: false - show_icon: false - show_state: true - entity: input_select.notifier_tts_notify - tap_action: - action: call-service - service: input_select.select_next - service_data: - entity_id: input_select.notifier_tts_notify - - type: button - state_color: true - show_name: false - icon_height: 24px - entity: input_boolean.notifier_alexa_switch - tap_action: - action: toggle - - show_name: false - show_icon: false - type: button - show_state: true - entity: input_select.notifier_alexa_type - tap_action: - action: call-service - service: input_select.select_next - service_data: - entity_id: input_select.default_alexa_type - - type: button - state_color: true - show_name: false - icon_height: 24px - entity: input_boolean.notifier_alexa_ssml - tap_action: - action: toggle - - type: button - state_color: true - show_name: false - icon_height: 24px - entity: button.notifier_last_message - tap_action: - action: toggle - - type: divider - style: - background-color: var(--primary-color) - height: 1px - - type: entities - show_header_toggle: false - state_color: true - entities: - - entity: input_text.notifier_intercom_message - - entity: input_number.notifier_intercom_volume diff --git a/lovelace/card_menu_hui.yaml b/lovelace/card_menu_hui.yaml new file mode 100755 index 0000000..a708fc0 --- /dev/null +++ b/lovelace/card_menu_hui.yaml @@ -0,0 +1,299 @@ +type: conditional +conditions: + - entity: script.my_notify + state_not: unavailable +card: + type: entities + state_color: true + show_header_toggle: false + entities: + - type: custom:hui-markdown-card + content: > +
🤵 {{ states('sensor.notifier_config') }} + +
{% if states('sensor.notifier_debug_error') not in + ['on','OK'] %} + {{states('sensor.notifier_debug_error')}} {% endif %} + - type: divider + style: + background-color: var(--primary-color) + height: 1px + - type: custom:hui-grid-card + square: true + columns: 8 + cards: + - type: button + entity: group.notifier_group_notification + show_icon: true + show_name: false + show_state: false + icon: '' + - type: button + entity: input_boolean.notifier_speech_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_text_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_screen_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_phone_notifications + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_guest_mode + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_priority_message + show_icon: true + show_name: false + show_state: false + - type: button + entity: input_boolean.notifier_holidays + show_icon: true + show_name: false + show_state: false + - type: custom:hui-grid-card + square: false + columns: 5 + cards: + - type: button + entity: automation.centro_notifiche_configurazione_avvio + show_icon: true + show_name: false + tap_action: + action: more-info + - type: button + entity: sensor.notifier_config + show_icon: true + show_name: false + tap_action: + action: more-info + - type: button + entity: sensor.notifier_debug_error + icon: mdi:account-wrench + show_icon: true + show_name: false + tap_action: + action: more-info + - type: button + entity: input_button.notifier_reset_config + show_icon: true + show_name: false + show_state: false + tap_action: + action: toggle + confirmation: + text: Procedo al reset della configurazione? + - type: button + icon: mdi:restart + tap_action: + action: call-service + confirmation: + text: Sei sicuro di voler riavviare l'App Notifier? + service: script.my_notify + service_data: + ad: + command: restart + - type: custom:hui-grid-card + square: false + columns: 4 + cards: + - type: button + entity: group.notifier_location_tracker + show_icon: true + show_name: false + show_state: true + tap_action: + action: more-info + - type: button + entity: sensor.notifier_day_period + show_name: false + show_state: true + - type: button + entity: sensor.notifier_day_period_volume + show_name: false + show_state: true + - type: button + entity: binary_sensor.notifier_dnd + show_name: false + show_state: true + - type: divider + style: + background-color: var(--primary-color) + height: 1px + - type: attribute + entity: binary_sensor.notifier_people_home + name: In casa + attribute: name + - type: conditional + conditions: + - entity: sensor.notifier_text_notify + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_text_notify + attribute: selected + name: Notify + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_text_notify + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_text_notify + hold_action: + action: more-info + - type: conditional + conditions: + - entity: sensor.notifier_player_alexa + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_player_alexa + attribute: selected + name: Alexa + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_player_alexa + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_player_alexa + hold_action: + action: more-info + - type: conditional + conditions: + - entity: sensor.notifier_player_google + state_not: unavailable + row: + type: attribute + entity: sensor.notifier_player_google + attribute: selected + name: Google + tap_action: + action: call-service + service: select.select_next + target: + entity_id: select.notifier_player_google + data: + cycle: true + double_tap_action: + action: call-service + service: select.select_first + target: + entity_id: select.notifier_player_google + hold_action: + action: more-info + - entity: input_text.notifier_intercom_message + name: Interfono + - entity: input_number.notifier_intercom_volume + - type: divider + style: + background-color: var(--primary-color) + height: 1px + - type: conditional + conditions: + - entity: sensor.notifier_player_google + state_not: unavailable + row: + type: custom:hui-horizontal-stack-card + cards: + - type: button + entity: input_boolean.notifier_google_switch + icon_height: 24px + show_icon: true + show_name: false + tap_action: + action: toggle + - type: button + entity: input_select.notifier_tts_notify + show_icon: false + show_name: false + show_state: true + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.notifier_tts_notify + - type: button + entity: button.notifier_last_message + icon_height: 24px + show_name: false + tap_action: + action: toggle + - type: conditional + conditions: + - entity: sensor.notifier_player_alexa + state_not: unavailable + row: + type: custom:hui-horizontal-stack-card + cards: + - type: button + entity: input_boolean.notifier_alexa_switch + icon: mdi:dots-circle + icon_height: 24px + show_icon: true + show_name: false + tap_action: + action: toggle + - type: button + entity: binary_sensor.notifier_alexa_speak + icon: mdi:speaker-message + icon_height: 24px + show_name: false + tap_action: + action: more-info + - type: button + entity: input_select.notifier_alexa_type + show_icon: false + show_name: false + show_state: true + tap_action: + action: call-service + service: input_select.select_next + service_data: + entity_id: input_select.notifier_alexa_type + - type: button + entity: input_boolean.notifier_alexa_ssml + icon_height: 24px + show_name: false + tap_action: + action: toggle + - type: button + entity: input_boolean.notifier_alexa_smart_volume + icon_height: 24px + show_name: false + tap_action: + action: toggle + - type: conditional + conditions: + - entity: input_boolean.notifier_google_switch + state: unavailable + card: + type: button + entity: button.notifier_last_message + icon_height: 24px + show_name: false + tap_action: + action: toggle diff --git a/lovelace/card_my_menu_custom.yaml b/lovelace/card_my_menu_custom.yaml index 9361c25..64a36b8 100755 --- a/lovelace/card_my_menu_custom.yaml +++ b/lovelace/card_my_menu_custom.yaml @@ -5,6 +5,8 @@ cards: background: var(--primary-color) buttons: - entity: sensor.notifier_config + icon: mdi:account-tie + name: '{{ states(config.entity) }}' styles: button: font-size: 16px @@ -12,8 +14,6 @@ cards: tap_action: action: navigate navigation_path: centro-notifiche - icon: mdi:account-tie - name: '{{ states(config.entity) }}' - type: conditional conditions: - entity: sensor.notifier_debug_error @@ -30,7 +30,7 @@ cards: content: |-
- Notifier Debug Error + Attenzione {{ user }}, si è verificato un errore in Notifier App {{states('sensor.notifier_debug_error')}}
- type: custom:paper-buttons-row @@ -38,27 +38,8 @@ cards: display: flex justify-content: space-between buttons: - - entity: binary_sensor.notifier_people_home - layout: state - state: - attribute: number - - entity: group.notifier_location_tracker + - entity: group.notifier_group_notification layout: icon - styles: - button: - margin-left: '-24px' - tap_action: - action: more-info - state_icons: - not_home: mdi:home-export-outline - home: mdi:home-import-outline - state_styles: - not_home: - button: - color: red - home: - button: - color: var(--state-person-home-color) - entity: input_boolean.notifier_speech_notifications layout: icon state_icons: @@ -83,6 +64,57 @@ cards: 'off': mdi:alarm-light-outline - entity: input_boolean.notifier_holidays layout: icon + - entity: automation.centro_notifiche_configurazione_avvio + layout: icon + icon: mdi:cog + styles: + button: + color: > + {{ iif(is_state(config.entity, 'off'), 'var(--error-color)', + 'var(--state-active-color)') }} + hold_action: + action: more-info + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: Impostazioni + content: + type: entities + state_color: true + entities: + - entity: automation.centro_notifiche_configurazione_avvio + - entity: sensor.notifier_debug_error + name: Notifier Debug Error + icon: mdi:account-wrench + - entity: sensor.notifier_config + - entity: input_button.notifier_reset_config + tap_action: + action: call-service + service: input_button.press + target: + entity_id: input_button.notifier_reset_config + confirmation: + text: Procedo al reset della configurazione? + - type: button + icon: mdi:restart + entity: sensor.notifier_debug_error + name: Restart App + tap_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + content: | + Sei sicuro di voler riavviare l'App Notifier? + right_button: SI + left_button: 'NO' + right_button_action: + service: script.my_notify + data: + ad: + command: restart - type: divider style: background-color: var(--primary-color) @@ -93,22 +125,33 @@ cards: grid-template-columns: repeat(4, 1fr) font-size: 0.9em buttons: - - entity: sensor.notifier_debug_error + - entity: group.notifier_location_tracker layout: icon|name|state - name: Notifier + name: | + {{ state_attr('binary_sensor.notifier_people_home', 'number') }} styles: button: justify-content: flex-start - color: >- - {{ iif(states(config.entity)|lower in ['on','ok'], - 'var(--success-color)', 'var(--error-color)') }} + color: var(--state-person-home-color) icon: scale: 70% - state: | - {{ iif(states(config.entity)|lower in ['on','ok'], - states(config.entity), 'Error') }} + state_icons: + not_home: mdi:home-export-outline + home: mdi:home-import-outline + state_styles: + not_home: + button: + color: var(--red-color) + home: + button: + color: var(--state-person-home-color) + tap_action: + action: more-info - entity: sensor.notifier_day_period layout: state + styles: + button: + color: var(--info-color) tap_action: action: fire-dom-event browser_mod: @@ -124,8 +167,13 @@ cards: - input_datetime.notifier_start_evening - input_datetime.notifier_start_night - input_datetime.notifier_start_late_night - icon: '{{state_attr(''sensor.notifier_day_period'',''icon'')}}' - entity: sensor.notifier_day_period_volume + layout: name|state + state: '{{states(config.entity)}}%' + name: VOL + styles: + button: + color: var(--info-color) tap_action: action: fire-dom-event browser_mod: @@ -142,19 +190,14 @@ cards: - input_number.notifier_night_volume - input_number.notifier_late_night_volume - input_number.notifier_intercom_volume - icon: '{{state_attr(''sensor.notifier_day_period_volume'',''icon'')}}' - state: | - {{states('sensor.notifier_day_period_volume')}}% - name: VOL - layout: name|state - entity: binary_sensor.notifier_dnd - name: DND layout: name|state + name: DND styles: button: - color: >- {{ iif(states(config.entity) == 'on', 'var(--warning-color)', - '') }} + 'var(--info-color)') }} state_icons: 'on': mdi:minus-circle 'off': mdi:minus-circle-off @@ -171,6 +214,10 @@ cards: - input_datetime.notifier_end_weekdays - input_datetime.notifier_start_holidays - input_datetime.notifier_end_holidays + - type: divider + style: + background-color: var(--primary-color) + height: 1px - type: custom:paper-buttons-row styles: display: grid @@ -191,7 +238,59 @@ cards: 'blink 1.5s linear infinite alternate', '') }} icon: scale: 70% + hold_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: Alexa + content: + type: entities + state_color: true + entities: + - entity: input_boolean.notifier_alexa_switch + icon: mdi:dots-circle + - entity: select.notifier_player_alexa + - entity: input_select.notifier_alexa_type + - entity: input_select.notifier_alexa_method + - entity: input_boolean.notifier_alexa_smart_volume + - entity: binary_sensor.notifier_alexa_speak + icon: mdi:speaker-message + name: Alexa Parla + - type: section + label: SSML + - entity: input_boolean.notifier_alexa_ssml + - entity: input_select.notifier_alexa_voice + - entity: input_select.notifier_alexa_language + - entity: input_number.notifier_alexa_prosody_rate + - entity: input_number.notifier_alexa_prosody_pitch + - entity: input_number.notifier_alexa_prosody_volume + - entity: button.notifier_ssml_reset + - type: section + label: Info + - entity: sensor.notifier_player_alexa + - type: attribute + name: Entities list + entity: sensor.notifier_player_alexa + attribute: entities + - type: attribute + entity: sensor.notifier_player_alexa + attribute: selected + - entity: group.notifier_player_alexa + - type: attribute + entity: group.notifier_player_alexa + attribute: entity_id + name: Players - entity: select.notifier_player_alexa + layout: state + state: + case: first + state_icons: + 'on': mdi:minus-circle + 'off': mdi:minus-circle-off + styles: + button: + color: var(--primary-text-color) tap_action: action: call-service service: select.select_next @@ -204,15 +303,6 @@ cards: service: select.select_first target: entity_id: select.notifier_player_alexa - layout: state - state: - case: first - state_icons: - 'on': mdi:minus-circle - 'off': mdi:minus-circle-off - styles: - button: - color: var(--primary-text-color) - entity: input_select.notifier_alexa_type layout: state state: @@ -220,7 +310,7 @@ cards: state_styles: announce: button: - color: var(--paper-item-icon-active-color) + color: var(--state-active-color) styles: button: color: var(--primary-text-color) @@ -229,9 +319,17 @@ cards: service: input_select.select_next service_data: entity_id: input_select.notifier_alexa_type - - entity: input_boolean.notifier_alexa_ssml - layout: name - name: SSML + - entity: sensor.notifier_player_alexa + layout: state + styles: + button: + color: var(--info-color) + icon: + scale: 70% + state: > + {{ state_attr(config.entity, 'entities') |map('state_attr', + 'volume_level') |unique |list }} + - type: custom:paper-buttons-row styles: display: grid @@ -246,7 +344,41 @@ cards: justify-content: flex-start icon: scale: 70% + hold_action: + action: fire-dom-event + browser_mod: + service: browser_mod.popup + data: + title: Google + content: + type: entities + state_color: true + entities: + - entity: input_boolean.notifier_google_switch + - entity: select.notifier_player_google + - entity: input_select.notifier_tts_notify + - type: section + label: Info + - entity: sensor.notifier_player_google + - type: attribute + name: Entities list + entity: sensor.notifier_player_google + attribute: entities + - type: attribute + name: Selected + entity: sensor.notifier_player_google + attribute: selected + - entity: group.notifier_player_google + - type: attribute + entity: group.notifier_player_google + attribute: entity_id - entity: select.notifier_player_google + layout: state + state: + case: first + styles: + button: + color: var(--primary-text-color) tap_action: action: call-service service: select.select_next @@ -259,12 +391,6 @@ cards: service: select.select_first target: entity_id: select.notifier_player_google - layout: state - state: - case: first - styles: - button: - color: var(--primary-text-color) - entity: input_select.notifier_tts_notify layout: icon|state icon: false @@ -281,10 +407,21 @@ cards: service: input_select.select_next service_data: entity_id: input_select.notifier_tts_notify + - entity: sensor.notifier_player_google + layout: state + styles: + button: + color: var(--info-color) + icon: + scale: 70% + state: > + {{ state_attr('sensor.notifier_player_google', 'entities') | + map('state_attr','volume_level') | reject('none') | map('round', 1) + | list |default('OFF',true) }} - type: custom:paper-buttons-row styles: display: grid - grid-template-columns: 1fr 1fr 2fr + grid-template-columns: repeat(4, 1fr) font-size: 0.9em buttons: - entity: input_boolean.notifier_phone_notifications @@ -295,28 +432,40 @@ cards: justify-content: flex-start icon: scale: 70% + state_icons: + 'off': mdi:phone-off - entity: input_select.notifier_phone_notify - name: Voip layout: state state: case: first styles: button: color: var(--primary-text-color) - - entity: group.notifier_player_alexa - layout: name|state + - entity: input_button.notifier_reset_config + layout: icon|name + name: Reset styles: button: - color: var(--info-color) - justify-content: flex-start - icon: - scale: 70% - name: > - {{ state_attr(config.entity, 'entity_id') |map('state_attr', - 'friendly_name') | join(', ') }} - state: > - {{ state_attr(config.entity, 'entity_id') |map('state_attr', - 'volume_level') | join(', ') }} + color: var(--error-color) + tap_action: + action: toggle + confirmation: + text: Procedo al reset della configurazione? + - type: button + layout: icon|name + name: Restart + icon: mdi:restart + styles: + button: + color: var(--error-color) + tap_action: + action: call-service + confirmation: + text: Sei sicuro di voler riavviare l'App Notifier? + service: script.my_notify + service_data: + ad: + command: restart - type: divider style: background-color: var(--primary-color) @@ -327,7 +476,29 @@ cards: justify-content: space-between font-size: 0.9em buttons: + - entity: input_boolean.notifier_text_notifications + layout: icon|name + name: Notify + styles: + button: + justify-content: flex-start + icon: + scale: 70% + state_icons: + 'off': mdi:cellphone-message-off - entity: select.notifier_text_notify + layout: state + state: + case: first + styles: + button: + justify-self: flex-start + icon: + color: > + {{ iif(is_state(config.entity, 'on'), 'var(--state-active-color)', + '') }} + state: + color: var(--primary-text-color) tap_action: action: call-service service: select.select_next @@ -340,21 +511,14 @@ cards: service: select.select_first target: entity_id: select.notifier_text_notify - layout: icon|name|state - name: Notify - state: - case: first - styles: - state: - color: var(--primary-text-color) - entity: input_boolean.notifier_html_mode + layout: icon icon: | {{ iif(is_state(config.entity, 'off'), 'mdi:language-markdown', '') }} - layout: icon - entity: input_boolean.notifier_wrap_text + layout: icon icon: | {{ iif(is_state(config.entity, 'off'), 'mdi:text-long', '') }} - layout: icon - entity: input_boolean.notifier_tts_clock layout: icon - type: divider @@ -372,23 +536,26 @@ cards: - type: custom:fold-entity-row cickable: true head: - entity: button.notifier_last_message - state_color: true + entity: input_number.notifier_intercom_volume + icon: mdi:bullhorn-outline name: Interfono tap_action: - action: toggle + action: fire-dom-event + fold_row: true extend_paper_buttons_row: hide_state: true position: right buttons: - - entity: input_boolean.notifier_last_message - layout: icon|name - state_styles: - 'on': - ripple: - color: var(--accent-color) - button: - background-color: var(--table-row-alternative-background-color) + - entity: button.notifier_last_message + layout: icon + tap_action: + action: call-service + service: button.press + target: + entity_id: button.notifier_last_message + styles: + ripple: + color: var(--accent-color) entities: - type: custom:lovelace-multiline-text-input-card card_mod: @@ -435,3 +602,22 @@ cards: service: input_number.increment service_data: entity_id: input_number.notifier_intercom_volume + - type: conditional + conditions: + - entity: input_text.notifier_last_message + state_not: '' + card: + type: markdown + entity_id: input_text.notifier_last_message + card_mod: + style: | + ha-markdown.no-header { + padding: 0px !important; + } + content: |- + +
+ Ultimo Messaggio + {{states('input_text.notifier_last_message')}} +
+
diff --git a/lovelace/card_voip.yaml b/lovelace/card_voip.yaml index bb72b7d..6bc9822 100755 --- a/lovelace/card_voip.yaml +++ b/lovelace/card_voip.yaml @@ -1,10 +1,15 @@ -type: entities -title: VoIP -show_header_toggle: false -state_color: true -entities: - - type: section - label: '' +type: conditional +conditions: - entity: input_boolean.notifier_phone_notifications - - entity: input_text.notifier_called_number - - entity: input_select.notifier_phone_notify + state_not: unavailable +card: + type: entities + title: VoIP + show_header_toggle: false + state_color: true + entities: + - type: section + label: '' + - entity: input_boolean.notifier_phone_notifications + - entity: input_text.notifier_called_number + - entity: input_select.notifier_phone_notify diff --git a/lovelace/dashboard_raw.yaml b/lovelace/dashboard_raw.yaml index 1b222ab..3b811cc 100755 --- a/lovelace/dashboard_raw.yaml +++ b/lovelace/dashboard_raw.yaml @@ -6,21 +6,22 @@ views: cards: - type: conditional conditions: - - entity: input_boolean.notifier_phone_notifications + - entity: script.my_notify state_not: unavailable card: type: vertical-stack cards: - type: markdown content: > -
🤵 - {{states('sensor.notifier_config')}}
+
🤵 {{ states('sensor.notifier_config') + }}
- {% if states('sensor.notifier_debug_error') not in ['on','OK']%} + {% if states('sensor.notifier_debug_error') not in ['on','OK'] + %} - {{states('sensor.notifier_debug_error')}} + {{ states('sensor.notifier_debug_error') }} @@ -29,105 +30,129 @@ views: type: grid columns: 8 cards: - - show_name: false - show_icon: true - type: button - show_state: false + - type: button entity: group.notifier_group_notification - icon: '' - - show_name: false show_icon: true - type: button + show_name: false show_state: false + icon: '' + - type: button entity: input_boolean.notifier_speech_notifications - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_text_notifications - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_screen_notifications - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_phone_notifications - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_guest_mode - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_priority_message - - show_name: false show_icon: true - type: button + show_name: false show_state: false + - type: button entity: input_boolean.notifier_holidays - - square: true + show_icon: true + show_name: false + show_state: false + - square: false type: grid columns: 5 cards: - - show_name: false + - type: button + entity: automation.centro_notifiche_configurazione_avvio show_icon: true - type: button - show_state: true - entity: binary_sensor.notifier_dnd + show_name: false tap_action: action: more-info - - show_name: false + - type: button + entity: sensor.notifier_config show_icon: true - type: button - show_state: true - entity: binary_sensor.notifier_people_home + show_name: false tap_action: action: more-info - - show_name: false + - type: button + entity: sensor.notifier_debug_error show_icon: true - type: button - show_state: true - entity: group.notifier_location_tracker + show_name: false + icon: mdi:account-wrench tap_action: action: more-info - - show_name: false + - type: button + entity: input_button.notifier_reset_config show_icon: true - icon: '' - type: button - show_state: true + show_name: false + show_state: false + action_name: Reset tap_action: - action: more-info - entity: sensor.notifier_config - - show_name: false + action: toggle + confirmation: + text: Procedo al reset della configurazione? + - type: button + icon: mdi:restart + tap_action: + action: call-service + confirmation: + text: Sei sicuro di voler riavviare l'App Notifier? + service: script.my_notify + service_data: + ad: + command: restart + - type: grid + square: false + columns: 4 + cards: + - type: button + entity: group.notifier_location_tracker show_icon: true - icon: mdi:account-wrench - type: button + show_name: false show_state: true tap_action: action: more-info - entity: sensor.notifier_debug_error - - type: glance - columns: 3 - show_icon: false - entities: - - entity: sensor.notifier_day_period - - entity: sensor.notifier_day_period_volume - - entity: input_select.notifier_language + - type: button + entity: sensor.notifier_day_period + show_name: false + show_state: true + - type: button + entity: sensor.notifier_day_period_volume + show_name: false + show_state: true + - type: button + entity: binary_sensor.notifier_dnd + show_name: false + show_state: true - type: entities + state_color: true entities: + - type: attribute + entity: binary_sensor.notifier_people_home + name: In casa + attribute: name - type: conditional conditions: - entity: sensor.notifier_text_notify state_not: unavailable row: - entity: sensor.notifier_text_notify type: attribute + entity: sensor.notifier_text_notify attribute: selected + name: Notify tap_action: action: call-service service: select.select_next @@ -147,9 +172,10 @@ views: - entity: sensor.notifier_player_alexa state_not: unavailable row: - entity: sensor.notifier_player_alexa type: attribute + entity: sensor.notifier_player_alexa attribute: selected + name: Alexa tap_action: action: call-service service: select.select_next @@ -169,9 +195,10 @@ views: - entity: sensor.notifier_player_google state_not: unavailable row: - entity: sensor.notifier_player_google type: attribute + entity: sensor.notifier_player_google attribute: selected + name: Google tap_action: action: call-service service: select.select_next @@ -186,6 +213,8 @@ views: entity_id: select.notifier_player_google hold_action: action: more-info + - entity: input_text.notifier_intercom_message + - entity: input_number.notifier_intercom_volume - type: horizontal-stack cards: - type: conditional @@ -194,10 +223,10 @@ views: state_not: unavailable card: type: button + entity: input_boolean.notifier_google_switch show_name: false show_icon: true icon_height: 24px - entity: input_boolean.notifier_google_switch tap_action: action: toggle - type: conditional @@ -206,10 +235,10 @@ views: state_not: unavailable card: type: button + entity: input_select.notifier_tts_notify show_name: false show_icon: false show_state: true - entity: input_select.notifier_tts_notify tap_action: action: call-service service: input_select.select_next @@ -221,10 +250,10 @@ views: state_not: unavailable card: type: button + entity: input_boolean.notifier_alexa_switch show_name: false show_icon: true icon_height: 24px - entity: input_boolean.notifier_alexa_switch tap_action: action: toggle icon: mdi:dots-circle @@ -234,10 +263,10 @@ views: state_not: unavailable card: type: button + entity: input_select.notifier_alexa_type show_name: false show_icon: false show_state: true - entity: input_select.notifier_alexa_type tap_action: action: call-service service: input_select.select_next @@ -249,32 +278,32 @@ views: state_not: unavailable card: type: button + entity: input_boolean.notifier_alexa_ssml show_name: false icon_height: 24px - entity: input_boolean.notifier_alexa_ssml tap_action: action: toggle - type: button + entity: button.notifier_last_message show_name: false icon_height: 24px - entity: button.notifier_last_message tap_action: action: toggle - - type: entities - show_header_toggle: false - state_color: true - entities: - - entity: input_text.notifier_intercom_message - - entity: input_number.notifier_intercom_volume - type: entities title: Impostazioni Assistente show_header_toggle: false state_color: true entities: - - entity: automation.notifier_startup_configuration + - entity: automation.centro_notifiche_configurazione_avvio - entity: sensor.notifier_config - - entity: sensor.notifier_debug_error - icon: mdi:account-wrench + - type: conditional + conditions: + - entity: sensor.notifier_debug_error + state_not: unavailable + row: + entity: sensor.notifier_debug_error + name: Notifier Debug Error + icon: mdi:account-wrench - entity: input_button.notifier_reset_config - type: button icon: mdi:restart @@ -306,7 +335,7 @@ views: - entity: input_datetime.notifier_start_holidays - entity: input_datetime.notifier_end_holidays - type: section - label: VOLUME di default durante il griorno + label: VOLUME di default e Periodo del griorno - entity: group.notifier_group_volumes - entity: input_datetime.notifier_start_early_morning - entity: input_number.notifier_early_morning_volume diff --git a/packages/centro_notifiche/hub_alexa.yaml b/packages/centro_notifiche/hub_alexa.yaml index 8aa5610..9eed67d 100755 --- a/packages/centro_notifiche/hub_alexa.yaml +++ b/packages/centro_notifiche/hub_alexa.yaml @@ -1,86 +1,84 @@ homeassistant: - # https://github.com/vigonotion/hass-simpleicons - ######################################-####################################### - ## CUSTOMIZE - ######################################-####################################### customize: - ## NODE ANCHORS package.cn: - customize: &customize + icon: https://github.com/vigonotion/hass-simpleicons + extra_attributes: &extra_attributes package: "Centro Notifiche 🔔" - site: "hassiohelp.eu 🌐" - author: "Caio & Gianpi" + authors: "Caio & Gianpi" + ######################################-###################################### + ## CUSTOMIZE + ######################################-###################################### ## BINARY SENSOR binary_sensor.notifier_alexa_speak: - <<: *customize + <<: *extra_attributes friendly_name: "Alexa parla" icon: mdi:speaker-message ## BUTTON button.notifier_ssml_reset: - <<: *customize + <<: *extra_attributes friendly_name: "Ripristina SSML" # icon: mdi:restore ## GROUP group.notifier_player_alexa: - <<: *customize + <<: *extra_attributes friendly_name: "Gruppo Alexa" icon: mdi:speaker-multiple ## INPUT input_boolean.notifier_alexa_switch: - <<: *customize + <<: *extra_attributes friendly_name: "Alexa Off/On" icon: mdi:dots-circle # icon: mdi:alpha-a-circle input_boolean.notifier_alexa_smart_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Imposta volume smart" icon: mdi:volume-equal input_boolean.notifier_alexa_ssml: - <<: *customize + <<: *extra_attributes friendly_name: "SSML Off/On" icon: mdi:waveform input_number.notifier_alexa_prosody_rate: - <<: *customize + <<: *extra_attributes friendly_name: "Rate" icon: mdi:alpha-r input_number.notifier_alexa_prosody_pitch: - <<: *customize + <<: *extra_attributes friendly_name: "Pitch" icon: mdi:alpha-p input_number.notifier_alexa_prosody_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Volume" icon: mdi:alpha-v unit_of_measurement: "dB" input_select.notifier_alexa_voice: - <<: *customize + <<: *extra_attributes friendly_name: "Amazon Polly voice" icon: mdi:account-tie-voice-outline input_select.notifier_alexa_language: - <<: *customize + <<: *extra_attributes friendly_name: Amazon Polly language icon: mdi:flag-variant input_select.notifier_alexa_method: - <<: *customize + <<: *extra_attributes friendly_name: "Metodo Predefinito Alexa" icon: mdi:monitor-speaker input_select.notifier_alexa_type: - <<: *customize + <<: *extra_attributes friendly_name: "Tipo Predefinito Alexa" icon: mdi:bugle ## SELECT select.notifier_player_alexa: - <<: *customize + <<: *extra_attributes friendly_name: "Sorgente Alexa" icon: mdi:speaker-wireless ## SENSOR sensor.last_alexa: - <<: *customize + <<: *extra_attributes friendly_name: "Last Alexa" icon: mdi:play-network sensor.notifier_player_alexa: - <<: *customize + <<: *extra_attributes friendly_name: "Player Alexa Predefinito" #######################################-####################################### diff --git a/packages/centro_notifiche/hub_build_message.yml b/packages/centro_notifiche/hub_build_message.yml index cd1e263..5a2021a 100755 --- a/packages/centro_notifiche/hub_build_message.yml +++ b/packages/centro_notifiche/hub_build_message.yml @@ -1,55 +1,55 @@ ->- - {# ** NON RIMUOVERE IL SIMBOLO " > " QUI SOPRA * #} - {# ********************************************* #} - {# MACRO E IMPOSTAZIONI #} - {# ********************************************* #} - - {% set nome = states('sensor.notifier_config') | default('Maggiordomo') %} - {% if nome | length == 0 %} - {% set nome = 'Hassio' %} - {% endif %} - - {%- macro annuncio() -%} - {% if now().hour < 12 and now().hour > 6 %} - {% set annuncio = ["Buondì. ", "Buongiorno. "] %} - {% elif now().hour >= 12 and now().hour < 17 %} - {% set annuncio = ["Buon pomeriggio. "] %} - {% else %} - {% set annuncio = ["Buonasera. "] %} - {% endif %} - {{ annuncio|random }} - {%- endmacro -%} - - {%- macro modo_ospite() -%} - {% if is_state ('input_boolean.notifier_guest_mode', 'on') %} - {% set modo_ospite = [ - "Sembra che abbiamo un ospite in casa. ", - "Abbiamo un ospite. Attiverò la modalità ospite. ", - "Ho attivato la modalità ospite per la visita della nostra casa. ", - "Passo alla modalità ospite. ", - "Non capita spesso di avere ospiti, lascia che prepari la casa per la tua visita. " - ] %} - {% else %} - {% set modo_ospite = [ - "Sembra che il nostro ospite se ne sia andato, disabiliterò la modalità ospite. ", - "Consentimi di disabilitare la modalità ospite poiché non ci sono più ospiti. ", - "Ho disabilitato la modalità ospite e ho ripreso le normali operazioni. ", - "Disabilito la modalità ospite. ", - "Dal momento che non ci sono più ospiti mi permetto di disabilitare la modalità ospite. " - ] %} - {% endif %} - {{ modo_ospite|random }} - {%- endmacro -%} - - - {# *************************************************************************** #} - {# INIZIO SEQUENZIALE DELLA COSTRUZIONE DEL MESSAGGIO / NOTICIA #} - {# *************************************************************************** #} - {% if not call_no_annuncio|default %} {{ annuncio() }} {% endif %} - {% if call_modo_ospite|default %} {{ modo_ospite() }} {% endif %} - - {# Esempio di come aggiungere altre variabili - Chiamata da Automazione di Benvenuto #} - {{ benvenuto|default }} - - {# + Contenuto del messaggio passato tramite automazioni/script + #} - {{ message|default }} +>- + {# ** NON RIMUOVERE IL SIMBOLO " > " QUI SOPRA * #} + {# ********************************************* #} + {# MACRO E IMPOSTAZIONI #} + {# ********************************************* #} + + {% set nome = states('sensor.notifier_config') | default('Centro Notifiche') %} + {% if nome | length == 0 %} + {% set nome = 'Hassio' %} + {% endif %} + + {%- macro annuncio() -%} + {% if now().hour < 12 and now().hour > 6 %} + {% set annuncio = ["Buondì. ", "Buongiorno. "] %} + {% elif now().hour >= 12 and now().hour < 17 %} + {% set annuncio = ["Buon pomeriggio. "] %} + {% else %} + {% set annuncio = ["Buonasera. "] %} + {% endif %} + {{ annuncio|random }} + {%- endmacro -%} + + {%- macro modo_ospite() -%} + {% if is_state ('input_boolean.notifier_guest_mode', 'on') %} + {% set modo_ospite = [ + "Sembra che abbiamo un ospite in casa. ", + "Abbiamo un ospite. Attiverò la modalità ospite. ", + "Ho attivato la modalità ospite per la visita della nostra casa. ", + "Passo alla modalità ospite. ", + "Non capita spesso di avere ospiti, lascia che prepari la casa per la tua visita. " + ] %} + {% else %} + {% set modo_ospite = [ + "Sembra che il nostro ospite se ne sia andato, disabiliterò la modalità ospite. ", + "Consentimi di disabilitare la modalità ospite poiché non ci sono più ospiti. ", + "Ho disabilitato la modalità ospite e ho ripreso le normali operazioni. ", + "Disabilito la modalità ospite. ", + "Dal momento che non ci sono più ospiti mi permetto di disabilitare la modalità ospite. " + ] %} + {% endif %} + {{ modo_ospite|random }} + {%- endmacro -%} + + + {# *************************************************************************** #} + {# INIZIO SEQUENZIALE DELLA COSTRUZIONE DEL MESSAGGIO / NOTIZIA #} + {# *************************************************************************** #} + {% if not call_no_annuncio|default %} {{ annuncio() }} {% endif %} + {% if call_modo_ospite|default %} {{ modo_ospite() }} {% endif %} + + {# Esempio di come aggiungere altre variabili - Chiamata da Automazione di Benvenuto #} + {{ benvenuto|default }} + + {# + Contenuto del messaggio passato tramite automazioni/script + #} + {{ message|default }} diff --git a/packages/centro_notifiche/hub_google.yaml b/packages/centro_notifiche/hub_google.yaml index aa83a1e..0b4b511 100755 --- a/packages/centro_notifiche/hub_google.yaml +++ b/packages/centro_notifiche/hub_google.yaml @@ -1,36 +1,35 @@ homeassistant: - ######################################-####################################### - ## CUSTOMIZE - ######################################-####################################### customize: - ## NODE ANCHORS package.cn: - customize: &customize + extra_attributes: &extra_attributes package: "Centro Notifiche 🔔" - site: "hassiohelp.eu 🌐" - author: "Caio & Gianpi" + authors: "Caio & Gianpi" + + ######################################-###################################### + ## CUSTOMIZE + ######################################-###################################### ## GROUP group.notifier_player_google: - <<: *customize + <<: *extra_attributes friendly_name: "Gruppo Google" icon: mdi:speaker-multiple ## INPUT input_boolean.notifier_google_switch: - <<: *customize + <<: *extra_attributes friendly_name: "Google Off/On" icon: mdi:dots-horizontal-circle-outline input_select.notifier_tts_notify: - <<: *customize + <<: *extra_attributes friendly_name: "Servizio TTS" icon: mdi:form-select ## SELECT select.notifier_player_google: - <<: *customize + <<: *extra_attributes friendly_name: "Sorgente Google" icon: mdi:speaker-wireless ## SENSOR sensor.notifier_player_google: - <<: *customize + <<: *extra_attributes friendly_name: "Player Google Predefinito" #######################################-####################################### diff --git a/packages/centro_notifiche/hub_main.yaml b/packages/centro_notifiche/hub_main.yaml index ca1ba51..6092021 100755 --- a/packages/centro_notifiche/hub_main.yaml +++ b/packages/centro_notifiche/hub_main.yaml @@ -1,243 +1,236 @@ -### INFO -# @site : https://hassiohelp.eu/ -# @author : Caio - https://github.com/caiosweet -# : Gianpi - https://github.com/jumping2000 -# @date : Started 01/11/2019 - Updated 04/06/2023 -# @description : Package for Appdaemon Notifier Center -# https://github.com/jumping2000/notifier -# @package : Notification HUB - Centro Notifiche 🔔 -# @last_release : https://api.github.com/repos/caiosweet/Package-Notification-HUB-AppDaemon/releases/latest -############################################################################ - -#######################################-####################################### -## CUSTOMIZE -#######################################-####################################### homeassistant: customize: - ## NODE ANCHORS package.cn: - version: "5.0.6" - customize: &customize - package: "Centro Notifiche 🔔" - site: "hassiohelp.eu 🌐" - author: "Caio & Gianpi" + version: "5.0.13" + date: 📅 01/11/2019 - Updated 11/06/2023 + info: https://github.com/caiosweet/Package-Notification-HUB-AppDaemon/wiki + links: + notifier: https://github.com/jumping2000/notifier + package: https://github.com/caiosweet/Package-Notification-HUB-AppDaemon + web: https://hassiohelp.eu/ + extra_attributes: &extra_attributes + package: "Centro Notifiche 🔔 5.0.13" + authors: "Caio & Gianpi" - ## AUTOMATION - automation.notifier_startup_configuration: - <<: *customize - friendly_name: "Notifier Startup" + #######################################-####################################### + ## CUSTOMIZE + #######################################-####################################### ## BINARY SENSOR binary_sensor.notifier_dnd: - <<: *customize + <<: *extra_attributes friendly_name: "Modo Silenzioso" binary_sensor.notifier_people_home: - <<: *customize + <<: *extra_attributes friendly_name: "Persone in casa" button.notifier_last_message: - <<: *customize + <<: *extra_attributes friendly_name: "Ultimo Messaggio" icon: mdi:repeat-once ## GROUP group.notifier_automations: - <<: *customize + <<: *extra_attributes friendly_name: "Automazioni Notifier" icon: mdi:home-automation group.notifier_location_tracker: - <<: *customize + <<: *extra_attributes friendly_name: "Dispositivi tracciati" icon: mdi:target-account group.notifier_group_volumes: - <<: *customize + <<: *extra_attributes friendly_name: "Volumi" icon: mdi:knob group.notifier_group_notification: - <<: *customize + <<: *extra_attributes friendly_name: "Gruppo Notifiche" icon: mdi:power ## INPUT BOOLEAN input_boolean.notifier_guest_mode: - <<: *customize + <<: *extra_attributes friendly_name: "Modo Ospite" icon: mdi:account-multiple-plus input_boolean.notifier_holidays: - <<: *customize + <<: *extra_attributes friendly_name: "Modo Vacanza" icon: mdi:beach input_boolean.notifier_html_mode: - <<: *customize + <<: *extra_attributes friendly_name: "Modo Markdown/Html" icon: mdi:language-html5 #language-markdown input_boolean.notifier_phone_notifications: - <<: *customize + <<: *extra_attributes friendly_name: "Notifiche VoIP" icon: mdi:phone-in-talk input_boolean.notifier_priority_message: - <<: *customize + <<: *extra_attributes friendly_name: "Modo Prioritario" icon: mdi:alarm-light input_boolean.notifier_screen_notifications: - <<: *customize + <<: *extra_attributes friendly_name: "Notifiche Persistenti" - icon: mdi:dock-left #mdi:message-bulleted + icon: mdi:dock-left #message-bulleted input_boolean.notifier_speech_notifications: - <<: *customize + <<: *extra_attributes friendly_name: "Notifiche Vocali" icon: mdi:account-tie-voice input_boolean.notifier_text_notifications: - <<: *customize + <<: *extra_attributes friendly_name: "Notifiche Testo" icon: mdi:cellphone-message input_boolean.notifier_tts_clock: - <<: *customize + <<: *extra_attributes friendly_name: "Orario in TTS App" icon: mdi:message-text-clock input_boolean.notifier_wrap_text: - <<: *customize + <<: *extra_attributes friendly_name: "Testo a capo" icon: mdi:wrap ## INPUT BUTTON input_button.notifier_reset_config: - <<: *customize + <<: *extra_attributes friendly_name: "Reset Configurazione" + icon: mdi:gesture-tap-button ## INPUT DATETIME input_datetime.notifier_start_early_morning: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Mattina Presto" icon: mdi:timer-play-outline input_datetime.notifier_start_morning: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Mattina" icon: mdi:timer-play-outline input_datetime.notifier_start_afternoon: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Pomeriggio" icon: mdi:timer-play-outline input_datetime.notifier_start_evening: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Sera" icon: mdi:timer-play-outline input_datetime.notifier_start_night: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Notte" icon: mdi:timer-play-outline input_datetime.notifier_start_late_night: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio Notte Fonda" icon: mdi:timer-play-outline input_datetime.notifier_start_weekdays: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio DND Feriali" input_datetime.notifier_end_weekdays: - <<: *customize + <<: *extra_attributes friendly_name: "Fine DND Feriali" input_datetime.notifier_start_holidays: - <<: *customize + <<: *extra_attributes friendly_name: "Inizio DND Festivi" input_datetime.notifier_end_holidays: - <<: *customize + <<: *extra_attributes friendly_name: "Fine DND Festivi" ## INPUT NUMBER input_number.notifier_early_morning_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Mattina Presto" icon: mdi:volume-medium input_number.notifier_morning_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Mattina" icon: mdi:volume-medium input_number.notifier_afternoon_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Pomeriggio" icon: mdi:volume-high input_number.notifier_evening_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Sera" icon: mdi:volume-medium input_number.notifier_night_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Notte" icon: mdi:volume-low input_number.notifier_late_night_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Vol Notte Fonda" icon: mdi:volume-low input_number.notifier_intercom_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Volume Interfono" icon: mdi:volume-source input_number.notifier_tts_wait_time: - <<: *customize + <<: *extra_attributes friendly_name: "TTS tempo di attesa" icon: mdi:av-timer unit_of_measurement: "sec" ## INPUT SELECT input_select.notifier_language: - <<: *customize + <<: *extra_attributes friendly_name: "Lingua" icon: mdi:flag-variant input_select.notifier_phone_notify: - <<: *customize + <<: *extra_attributes friendly_name: "Notifica Telefonica" icon: mdi:phone-forward select.notifier_text_notify: - <<: *customize + <<: *extra_attributes friendly_name: "Notifica Testo" icon: mdi:message-text-fast ## INPUT TEXT input_text.notifier_called_number: - <<: *customize + <<: *extra_attributes friendly_name: "N. Tel / @user" icon: mdi:phone-classic input_text.notifier_last_message: - <<: *customize + <<: *extra_attributes friendly_name: "Salva Ultimo Messaggio" icon: mdi:repeat input_text.notifier_intercom_message: - <<: *customize + <<: *extra_attributes friendly_name: "Messaggio Interfono" icon: mdi:bullhorn-outline ## SCRIPT script.my_notify: - <<: *customize + <<: *extra_attributes friendly_name: "My Notify" ## SENSOR sensor.notifier_config: - <<: *customize + <<: *extra_attributes friendly_name: "Notifier Config" icon: mdi:account-cog sensor.notifier_debug_error: - <<: *customize + <<: *extra_attributes friendly_name: "Notifier Debug Error" icon: mdi:account-wrench sensor.notifier_day_period: - <<: *customize + <<: *extra_attributes friendly_name: "Periodo del Giorno" sensor.notifier_day_period_volume: - <<: *customize + <<: *extra_attributes friendly_name: "Volume Notifica" sensor.notifier_text_notify: - <<: *customize + <<: *extra_attributes friendly_name: "Notify Predefinito" icon: mdi:send-check - ############################################################################ + ############################################################################# ## CUSTOMIZE GLOB - ############################################################################ + ############################################################################# customize_glob: automation.notifier_*: - <<: *customize + <<: *extra_attributes + icon: mdi:alpha-a-circle-outline + automation.centro_notifiche_*: + <<: *extra_attributes icon: mdi:alpha-a-circle-outline input_datetime.notifier_start_*days: - <<: *customize + <<: *extra_attributes icon: mdi:clock-start input_datetime.notifier_end_*days: - <<: *customize + <<: *extra_attributes icon: mdi:clock-end input_number.notifier_*_volume: - <<: *customize + <<: *extra_attributes unit_of_measurement: "%" sensor.notifier_*_volume: - <<: *customize + <<: *extra_attributes unit_of_measurement: "%" ############################################################################### @@ -250,7 +243,7 @@ homeassistant: media_extractor: #######################################-####################################### -## INPUT +## GROUP #######################################-####################################### group: notifier_group_volumes: @@ -370,6 +363,10 @@ template: alexa_select: "{{ trigger.event.data.alexa_select }}" google_select: "{{ trigger.event.data.google_select }}" notify_select: "{{ trigger.event.data.notify_select }}" + + debug: "{{ trigger.event.data.debug }}" + download: "{{ trigger.event.data.download }}" + beta_version: "{{ trigger.event.data.beta_version }}" - binary_sensor: - name: "notifier_dnd" @@ -401,7 +398,7 @@ template: {{ iif(people in icon, icon[people], 'mdi:account-group') }} attributes: entity: >- - {{ expand('group.notifier_location_tracker')| selectattr('state', 'eq', 'home') + {{ expand('group.notifier_location_tracker') | selectattr('state', 'eq', 'home') | map(attribute='entity_id') | list }} number: >- {{ this.attributes.entity | count diff --git a/secrets.example b/secrets.example deleted file mode 100755 index de51018..0000000 --- a/secrets.example +++ /dev/null @@ -1,41 +0,0 @@ ---- -# HELPER: https://github.com/caiosweet/Package-Notification-HUB-AppDaemon/wiki#secrets - -#----------------------------------------------------------------------------------------------------# -# SECTION 1 - In questa sezione ci sono le entità lette da Home Assistant -#----------------------------------------------------------------------------------------------------# - -# Input Select (input_select.notifier_text_notify nel file hub_main.yaml) -text_notify_hub: - - Telegram - - News - - News Telegram - - Pushover - - Discord - - WhatsApp - - Pushbullet - - Test Nome NOTIFICA - - Mobile App Claudio - - Mobile App Oneplus 5t - - Mobile App Oneplus A5010 - - Pushover, Telegram, Mobile App Claudio - - Mobile App Claudio, Telegram - - Telegram, Discord - - None - -#----------------------------------------------------------------------------------------------------# -# SECTION 2 - In questa sezione ci sono altri servizi letti dall'app Notifier. -# Queste opzioni possono essere commentate, cancellate o impostate con Null se non si usano -# o se il servizio corrisponde a quello di default. -#----------------------------------------------------------------------------------------------------# - -tts_google: google_translate_say # default google_translate_say -tts_google_cloud: google_cloud_say # default google_cloud -reverso_tts: reversotts_say # default reversotts_say -notify_google: google_assistant # default google_assistant -sip_server_name: fritz.box:5060 # default fritz.box:5060 -notifier_alexa_actionable_skill_id: "" # es. amzn1.ask.skill.a12a1a1a-123a-1234-a123-12345678a00a - -#----------------------------------------------------------------------------------------------------# -# END -#----------------------------------------------------------------------------------------------------#