Fix the long nagging MQTT issues in the system. All fixed now.

This commit is contained in:
ccostan
2023-01-16 18:57:38 -05:00
parent 8b3c53ba3e
commit 792f9423b5
9 changed files with 35 additions and 130 deletions

View File

@@ -83,44 +83,6 @@ sensor:
duration:
days: 7
# - platform: version
# name: HA Installed Version
# scan_interval: 86400
- platform: command_line
name: "HA Uptime"
command: echo "$(($(date +%s) - $(date -d "$(head -n1 /config/home-assistant.log | cut -d' ' -f-2)" +%s)))"
scan_interval: 720
value_template: >-
{% set uptime = value | int %}
{% set seconds = uptime % 60 %}
{% set minutes = ((uptime % 3600) / 60) | int %}
{% set hours = ((uptime % 86400) / 3600) | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{{ ', ' }}
{%- endif -%}
{%- if hours > 0 -%}
{%- if hours == 1 -%}
1 hour
{%- else -%}
{{ hours }} hours
{%- endif -%}
{{ ', ' }}
{%- endif -%}
{%- if minutes > 0 -%}
{%- if minutes == 1 -%}
1 minute
{%- else -%}
{{ minutes }} minutes
{%- endif -%}
{%- endif -%}
### Building some interesting stats for tweeting. ###
- platform: template
sensors: