Initial version of Notification module

This commit is contained in:
2020-04-20 16:34:56 +03:00
parent c13e91b1d6
commit 11f93fd9ef
5 changed files with 76 additions and 8 deletions

9
.vscode/tasks.json vendored
View File

@@ -30,6 +30,15 @@
"focus": true
}
},
{
"label": "upload",
"type": "shell",
"command": "./bin/upload",
"problemMatcher": [],
"presentation": {
"focus": true
}
},
{
"label": "logs",
"type": "shell",

View File

@@ -22,6 +22,7 @@ cards:
title: Automations
show_header_toggle: false
entities:
# Presence
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
@@ -37,12 +38,14 @@ cards:
- type: divider
# Lighting
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
name: Lighting
icon: mdi:lightbulb
tap_action: none
entities:
- automation.lighting_turn_on_ceiling_lights_after_sunset
- automation.lighting_turn_off_all_lights_after_sunrise
@@ -58,12 +61,14 @@ cards:
- type: divider
# Music
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
name: Music
icon: mdi:music-note
tap_action: none
entities:
- automation.music_play_pause_on_magic_cube_knock
- automation.music_volume_down_on_magic_cube_rotate_left
@@ -71,12 +76,14 @@ cards:
- type: divider
# Media
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
name: Media
icon: mdi:play-box-outline
tap_action: none
entities:
- automation.tv_join_beam_to_sonos_group_when_off
- automation.tv_plex_setup_house_for_plex
@@ -87,6 +94,20 @@ cards:
- type: divider
# Notifications
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
name: Notifications
icon: mdi:play-box-outline
tap_action: none
entities:
- automation.notification_phone_battery_low
- type: divider
# Sleep Mode
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
@@ -101,6 +122,7 @@ cards:
- type: divider
# Guest Mode
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
@@ -113,6 +135,7 @@ cards:
- type: divider
# Domestina
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
@@ -125,24 +148,28 @@ cards:
- type: divider
# Security
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
name: Security
icon: mdi:shield-home
tap_action: none
entities:
- automation.security_door_opened_while_away
- automation.camera_startup
- type: divider
# System
- type: custom:fold-entity-row
head:
type: custom:dummy-entity-row
entity: sun.sun
icon: mdi:cogs
name: System
tap_action: none
entities:
- automation.system_announce_start
- automation.system_telegram_announce_status

View File

@@ -1,11 +1,23 @@
title: test
path: test
cards:
- type: custom:button-card
name: Reload themes
tap_action:
action: call-service
service: frontend.reload_themes
- type: horizontal-stack
cards:
- type: custom:button-card
name: Reload themes
tap_action:
action: call-service
service: frontend.reload_themes
- type: custom:button-card
name: Reload automations
tap_action:
action: call-service
service: automation.reload
- type: custom:button-card
name: Reload scripts
tap_action:
action: call-service
service: script.reload
- type: entities
entities:

View File

@@ -0,0 +1,21 @@
automation:
- alias: Notification · Phone battery low
trigger:
platform: template
value_template: "{{ states('sensor.carbon_battery_level') | int < 10 }}"
condition:
condition: state
entity_id: sensor.carbon_battery_state
state: "Not Charging"
action:
service: script.say
data_template:
title: "❕*Notification Module*"
message: >-
{{
[
"Hey, just wanted to let you know your phone needs charging!",
"Hey, your phone is running low on battery, put it on the charger!"
] | random
}}

View File

@@ -36,7 +36,7 @@ script:
# Combine partials for speech message.
- service: script.say_discretely
data_template:
volume_level: "{{ volume_level }}" # For sonos only
title: "{{ title | default('💬 *Speech Module*') }}"
message: >-
{%- if partials is defined -%}
{%- for partial in partials -%}
@@ -65,9 +65,8 @@ script:
{% endif %}
{% endif %}
data_template:
title: "💬 *Speech Module*" # For telegram only
title: "{{ title | default('💬 *Speech Module*') }}" # For telegram only
message: "{{ message }}"
volume_level: "{{ volume_level }}" # For sonos only
sonos_blast:
alias: Speech · Sonos blast