Skip to content

Commit

Permalink
added utility sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosweet committed Jun 17, 2023
1 parent baf3fe8 commit 7df5ec6
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/example_automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#----------------------------------------------------------------------------------------------------#
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"
Expand Down
37 changes: 37 additions & 0 deletions extra/utility.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions lovelace/card_menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ card:
cards:
- type: markdown
content: >
<font size=5><center>🤵
{{ states('sensor.notifier_config') }}</center></font>
<font size=5><center>🤵 {{ states('sensor.notifier_config')
}}</center></font>
{% if states('sensor.notifier_debug_error') not in ['on','OK'] %}
Expand Down
2 changes: 1 addition & 1 deletion lovelace/card_menu_custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cards:
<font size=5><center>🤵
{{states('sensor.notifier_config')}}</center></font>
{% if not states('sensor.notifier_debug_error') in ['on','OK']%}
{% if states('sensor.notifier_debug_error') not in ['on','OK']%}
<ha-alert title="Centro Notifiche" alert-type="error">
Expand Down
9 changes: 4 additions & 5 deletions lovelace/card_menu_hui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ card:
show_header_toggle: false
entities:
- type: custom:hui-markdown-card
content: |
<font size=5><center>🤵 {{ states('sensor.notifier_config') }}</center></font>
{% if states('sensor.notifier_debug_error') not in ['on','OK'] %}
<ha-alert title="Centro Notifiche" alert-type="error">
content: >
<font size=5><center>🤵 {{ states('sensor.notifier_config') }}
</center></font> {% if states('sensor.notifier_debug_error') not in
['on','OK'] %} <ha-alert title="Centro Notifiche" alert-type="error">
{{states('sensor.notifier_debug_error')}} </ha-alert> {% endif %}
- type: divider
style:
Expand Down Expand Up @@ -90,7 +90,6 @@ card:
show_icon: true
show_name: false
show_state: false
action_name: Reset
tap_action:
action: toggle
confirmation:
Expand Down
1 change: 0 additions & 1 deletion lovelace/card_my_menu_custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ cards:
- input_number.notifier_night_volume
- input_number.notifier_late_night_volume
- input_number.notifier_intercom_volume

- entity: binary_sensor.notifier_dnd
layout: name|state
name: DND
Expand Down
4 changes: 2 additions & 2 deletions packages/centro_notifiche/hub_main.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
homeassistant:
customize:
package.cn:
version: "5.0.9"
version: "5.0.10"
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.9"
package: "Centro Notifiche 🔔 5.0.10"
authors: "Caio & Gianpi"

#######################################-#######################################
Expand Down

0 comments on commit 7df5ec6

Please sign in to comment.