Skip to content

Commit

Permalink
Merge pull request #27 from caiosweet/dev
Browse files Browse the repository at this point in the history
Minor fix
  • Loading branch information
caiosweet authored Dec 21, 2021
2 parents 246ac3b + 9ed88b7 commit 0d3b403
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 193 deletions.
268 changes: 174 additions & 94 deletions examples/hub_automations.yaml

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions extra/binary_sensor.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
binary_sensor:
- platform: workday
country: IT
workdays: [mon,tue,wed,thu,fri]
excludes: [sat,sun,holiday]
workdays: [mon, tue, wed, thu, fri, sat]
excludes: [sun, holiday]
add_holidays:
- '2020-08-31'
- '2021-08-31'
- "2022-08-31"
- "2023-08-31"
- "2024-08-31"
- "2025-08-31"
- "2026-08-31"
28 changes: 14 additions & 14 deletions extra/feed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ feedreader:
- &feed_hassiohelp_commenti https://hassiohelp.eu/comments/feed/
- &feed_news_ansa https://www.ansa.it/sito/notizie/topnews/topnews_rss.xml
- &feed_wikiquote https://it.wikiquote.org/w/api.php?action=featuredfeed&feed=qotd
# - &feed_dpc https://dpc-web-api.protezionecivile.gov.it/rss/dpcPortalGenerateRss?categoria=bollettino_criticita
- &feed_dpc https://dpc-web-api.protezionecivile.gov.it/rss/dpcPortalGenerateRss?categoria=bollettino_criticita
# - &feed_dpc_meteo https://dpc-web-api.protezionecivile.gov.it/rss/dpcPortalGenerateRss?categoria=bollettino_vigilanza #TODO
# - &feed_dpc_news https://dpc-web-api.protezionecivile.gov.it/rss/dpcPortalGenerateRss?categoria=notizia #TODO
- &feed_cb01 http://feeds.feedburner.com/cineblog01/Film-In-Streaming-Gratis
Expand Down Expand Up @@ -87,11 +87,11 @@ sensor:
- title
- summary
- published
# - platform: feedparser
# name: feed_dpc
# feed_url: *feed_dpc
# date_format: *data
# inclusions: *title_link_pub
- platform: feedparser
name: feed_dpc
feed_url: *feed_dpc
date_format: *data
inclusions: *title_link_pub
- platform: feedparser
name: feed_cb01
feed_url: *feed_cb01
Expand Down Expand Up @@ -119,7 +119,7 @@ automation:
feed_hassiohelp_commenti: *feed_hassiohelp_commenti
feed_news_ansa: *feed_news_ansa
feed_wikiquote: *feed_wikiquote
# feed_dpc: *feed_dpc
feed_dpc: *feed_dpc
feed_cb01: *feed_cb01
action:
- variables:
Expand Down Expand Up @@ -164,13 +164,13 @@ automation:
title: "📑 WikiQuote"
message: "Aforisma del giorno. {{trigger.event.data.summary|striptags}}"
link: "[Aforisma]({{feed_link}})"
# - conditions: "{{feed_url == feed_dpc}}"
# sequence:
# - service: *notify
# data:
# title: "⛈️ Protezione Civile"
# message: "{{feed_title}}"
# link: "[Bollettini di criticità]({{feed_link}})"
- conditions: "{{feed_url == feed_dpc}}"
sequence:
- service: *notify
data:
title: "⛈️ Protezione Civile"
message: "{{feed_title}}"
link: "[Bollettini di criticità]({{feed_link}})"
- conditions: "{{ feed_url == feed_cb01 }}"
sequence:
- service: *notify
Expand Down
4 changes: 2 additions & 2 deletions extra/my_lovelace_card.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ cards:
- entity: binary_sensor.dnd
layout: icon
state_icons:
"on": "mdi:do-not-disturb"
"off": "mdi:do-not-disturb-off"
"on": "mdi:minus-circle"
"off": "mdi:minus-circle-off"
- type: divider
style:
background-color: var(--primary-color)
Expand Down
119 changes: 67 additions & 52 deletions extra/my_lovelace_view.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,55 @@ cards:
- !include ../cards/card_menu_centro_notifiche.yaml
# - !include ../cards/card_test_centro_notifiche.yaml
# - !include ../cards/card_test_centro_notifiche_change_me.yaml

# CARD Impostazioni Assistente
- type: entities
title: Impostazioni Assistente
show_header_toggle: false
state_color: true
entities:
- entity: sensor.centro_notifiche
name: Centro Notifiche
- entity: input_text.personal_assistant_name
- entity: input_select.language
- entity: input_select.text_notify
- entity: input_boolean.html_mode
- entity: input_boolean.tts_clock
- entity: input_boolean.wrap_text
- entity: input_number.tts_wait_time
- type: custom:fold-entity-row
head:
type: section
label: FERIALI - Orario modo silenzioso
entities:
- entity: input_datetime.dnd_start_weekdays
- entity: input_datetime.dnd_end_weekdays
- type: custom:fold-entity-row
head:
type: section
label: FESTIVI - Orario modo silenzioso
entities:
- entity: input_datetime.dnd_start_holidays
- entity: input_datetime.dnd_end_holidays
- type: custom:fold-entity-row
head:
type: section
label: VOLUME di default durante il griorno
entities:
- entity: input_datetime.start_morning
- entity: input_number.morning_volume
- type: divider
- entity: input_datetime.start_afternoon
- entity: input_number.afternoon_volume
- type: divider
- entity: input_datetime.start_evening
- entity: input_number.evening_volume
- type: divider
- entity: input_datetime.start_night
- entity: input_number.night_volume
- type: divider
- entity: input_number.default_restore_volume

# CARD Centro Notifiche
- type: entities
title: Centro Notifiche
Expand Down Expand Up @@ -65,54 +114,6 @@ cards:
- entity: input_number.intercom_message_volume
- entity: input_text.intercom_message_hub

# CARD Impostazioni Assistente
- type: entities
title: Impostazioni Assistente
show_header_toggle: false
state_color: true
entities:
- entity: sensor.centro_notifiche
name: Centro Notifiche
- entity: input_text.personal_assistant_name
- entity: input_select.language
- entity: input_select.text_notify
- entity: input_boolean.html_mode
- entity: input_boolean.tts_clock
- entity: input_boolean.wrap_text
- entity: input_number.tts_wait_time
- type: custom:fold-entity-row
head:
type: section
label: FERIALI - Orario modo silenzioso
entities:
- entity: input_datetime.dnd_start_weekdays
- entity: input_datetime.dnd_end_weekdays
- type: custom:fold-entity-row
head:
type: section
label: FESTIVI - Orario modo silenzioso
entities:
- entity: input_datetime.dnd_start_holidays
- entity: input_datetime.dnd_end_holidays
- type: custom:fold-entity-row
head:
type: section
label: VOLUME di default durante il griorno
entities:
- entity: input_datetime.start_morning
- entity: input_number.morning_volume
- type: divider
- entity: input_datetime.start_afternoon
- entity: input_number.afternoon_volume
- type: divider
- entity: input_datetime.start_evening
- entity: input_number.evening_volume
- type: divider
- entity: input_datetime.start_night
- entity: input_number.night_volume
- type: divider
- entity: input_number.default_restore_volume

# CARD Alexa
- type: entities
title: Alexa
Expand All @@ -138,8 +139,15 @@ cards:
- entity: input_select.notification_media_player_alexa
- entity: input_select.default_alexa_type
- entity: input_select.default_alexa_method
- entity: group.media_player_alexa
- entity: sensor.media_player_alexa
- type: custom:fold-entity-row
# padding: 0
head: sensor.media_player_alexa
entities:
- entity: group.media_player_alexa
- type: attribute
entity: group.media_player_alexa
attribute: entity_id
name: Players

# CARD Google
- type: entities
Expand All @@ -152,8 +160,15 @@ cards:
- entity: input_boolean.google_switch
- entity: input_select.tts_notify
- entity: input_select.notification_media_player_google
- entity: group.media_player_google
- entity: sensor.media_player_google
- type: custom:fold-entity-row
# padding: 0
head: sensor.media_player_google
entities:
- entity: group.media_player_google
- type: attribute
entity: group.media_player_google
attribute: entity_id
name: Players

# CARD Gruppo Automazioni
- type: entities
Expand Down
2 changes: 1 addition & 1 deletion extra/sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sensor:
## In order to use sensor.ha_start, set the info logs in this way
############################################################################
# logger:
# default: warn
# default: warn # or whatever you want (info, error...)
# logs:
# homeassistant.bootstrap: info

Expand Down
1 change: 1 addition & 0 deletions lovelace/lovelace_view_stardard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ cards:
entity_id: input_boolean.speech_notifications
- entity: binary_sensor.dnd
- type: call-service
entity: input_boolean.last_message
name: Ultimo Messaggio
action_name: Ascolta
service: input_boolean.turn_on
Expand Down
6 changes: 4 additions & 2 deletions packages/centro_notifiche/hub_alexa.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# package_hub_alexa:
# For the Alexa icon https://github.com/vigonotion/hass-simpleicons
homeassistant:
#######################################-#######################################
## CUSTOMIZE
Expand All @@ -10,7 +11,7 @@ homeassistant:
package: Centro Notifiche 🔔
site: hassiohelp.eu 🌐
author: Caio & Gianpi
version: Alexa 3.3.0
version: Alexa 3.3.1

expose: &expose
<<: *customize
Expand All @@ -21,7 +22,8 @@ homeassistant:
input_boolean.alexa_switch:
<<: *customize
friendly_name: Alexa
icon: mdi:amazon-alexa
icon: si:amazonalexa
# icon: mdi:alpha-a-circle
input_boolean.alexa_ssml:
<<: *customize
friendly_name: Auto SSML
Expand Down
2 changes: 1 addition & 1 deletion packages/centro_notifiche/hub_google.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homeassistant:
package: Centro Notifiche 🔔
site: hassiohelp.eu 🌐
author: Caio & Gianpi
version: Google 3.3.0
version: Google 3.3.1

expose: &expose
<<: *customize
Expand Down
42 changes: 19 additions & 23 deletions packages/centro_notifiche/hub_main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# package_hub_main:
### INFO
# @author : Caio & Gianpi - hassiohelp.eu 🌐
# @date : Started 01/11/2019 - Updated 21/08/2021
# @date : Started 01/11/2019 - Updated 20/12/2021
# @package : Notification HUB - Centro Notifiche 🔔
# @description : Package Appdaemon Notifier Center for Home Assistant
# @repo : https://api.github.com/repos/caiosweet/Package-Notification-HUB-AppDaemon/releases
Expand All @@ -18,7 +18,7 @@ homeassistant:
package: Centro Notifiche 🔔
site: hassiohelp.eu 🌐
author: Caio & Gianpi
version: Main 3.3.0
version: Main 3.3.1

## AUTOMATION
automation.auto_volume_hub:
Expand Down Expand Up @@ -354,7 +354,7 @@ template:
{{(start<t<stop) if start<stop else ((t>start or t<stop) and start != stop)}}
{%elif speech=='off' and priority=='off'%}True{%else%}False{%endif%}
icon: >
{%if is_state('binary_sensor.dnd','off')%}mdi:do-not-disturb-off{%else%}mdi:do-not-disturb{%endif%}
{%if is_state('binary_sensor.dnd','off')%}mdi:minus-circle-off{%else%}mdi:minus-circle{%endif%}
- name: People Home
unique_id: people_home
device_class: presence
Expand Down Expand Up @@ -394,25 +394,21 @@ template:
- name: Period of Day Volume
unique_id: period_of_day_volume
state: >
{%if is_state('sensor.period_of_day','Mattino') %}{{states('input_number.morning_volume')|int}}
{%elif is_state('sensor.period_of_day','Pomeriggio')%}{{states('input_number.afternoon_volume')|int}}
{%elif is_state('sensor.period_of_day','Sera') %}{{states('input_number.evening_volume')|int}}
{%else%}{{states('input_number.night_volume')|int}}{%endif%}
{%if is_state('sensor.period_of_day','Mattino') %}{{states('input_number.morning_volume')|int(0)}}
{%elif is_state('sensor.period_of_day','Pomeriggio')%}{{states('input_number.afternoon_volume')|int(0)}}
{%elif is_state('sensor.period_of_day','Sera') %}{{states('input_number.evening_volume')|int(0)}}
{%else%}{{states('input_number.night_volume')|int(0)}}{%endif%}
icon: >
{%if is_state('sensor.period_of_day_volume','0')%}mdi:volume-off
{%elif is_state('sensor.period_of_day_volume','10')%}mdi:volume-low
{%elif is_state('sensor.period_of_day_volume','20')%}mdi:volume-low
{%elif is_state('sensor.period_of_day_volume','30')%}mdi:volume-low
{%elif is_state('sensor.period_of_day_volume','40')%}mdi:volume-medium
{%elif is_state('sensor.period_of_day_volume','50')%}mdi:volume-medium
{%elif is_state('sensor.period_of_day_volume','60')%}mdi:volume-medium
{%elif (0 < states('sensor.period_of_day_volume')|int(0) <= 30) %}mdi:volume-low
{%elif (40 <= states('sensor.period_of_day_volume')|int(0) <= 60) %}mdi:volume-medium
{%else%}mdi:volume-high{%endif%}
attributes:
vol: >
{%if is_state('sensor.period_of_day','Mattino') %}{{(states('input_number.morning_volume')|float)/100}}
{%elif is_state('sensor.period_of_day','Pomeriggio')%}{{(states('input_number.afternoon_volume')|float)/100}}
{%elif is_state('sensor.period_of_day','Sera') %}{{(states('input_number.evening_volume')|float)/100}}
{%else%}{{(states('input_number.night_volume')|float)/100}}{%endif%}
{%if is_state('sensor.period_of_day','Mattino') %}{{(states('input_number.morning_volume')|float(10))/100}}
{%elif is_state('sensor.period_of_day','Pomeriggio')%}{{(states('input_number.afternoon_volume')|float(10))/100}}
{%elif is_state('sensor.period_of_day','Sera') %}{{(states('input_number.evening_volume')|float(10))/100}}
{%else%}{{(states('input_number.night_volume')|float(10))/100}}{%endif%}
#######################################-#######################################
## SCRIPT
#######################################-#######################################
Expand Down Expand Up @@ -502,10 +498,10 @@ automation:
data:
object_id: media_player_alexa
entities: >-
{% set lista_alexa = expand('input_select.notification_media_player_alexa')|join(',','attributes.options') %}
{{ states.media_player
{% set lista_alexa = state_attr('input_select.notification_media_player_alexa','options') %}
{{ states.media_player
| selectattr('attributes.friendly_name', 'defined')
| selectattr('attributes.friendly_name', 'in', lista_alexa)
| selectattr('attributes.friendly_name', 'in', lista_alexa|default([],true))
| map(attribute='entity_id')|list
}}
Expand All @@ -518,10 +514,10 @@ automation:
data:
object_id: media_player_google
entities: >-
{% set lista_google = expand('input_select.notification_media_player_google')|join(',','attributes.options') %}
{% set lista_google = state_attr('input_select.notification_media_player_google','options') %}
{{ states.media_player
| selectattr('attributes.friendly_name', 'defined')
| selectattr('attributes.friendly_name', 'in', lista_google)
| selectattr('attributes.friendly_name', 'in', lista_google|default([],true))
| map(attribute='entity_id')|list
}}
Expand Down Expand Up @@ -562,7 +558,7 @@ automation:
list_alexa: "{{expand('group.media_player_alexa')|map(attribute='entity_id')|list}}"
list_google: "{{expand('group.media_player_google')|map(attribute='entity_id')|list}}"
all_entity: "{{list_alexa + list_google}}"
volume: "{{states('sensor.period_of_day_volume')|float}}"
volume: "{{states('sensor.period_of_day_volume')|float(10)}}"
- choose:
- conditions: "{{list_alexa|length > 0}}"
sequence:
Expand Down

0 comments on commit 0d3b403

Please sign in to comment.