Update devices.yaml and state.json with new device configurations and states
- Refactored friendly names in devices.yaml for consistency and clarity. - Added new devices and updated existing ones in devices.yaml. - Populated state.json with detailed state information for various devices, including brightness, power, and link quality. - Included update information for devices where applicable.
This commit is contained in:
@@ -1,112 +1,11 @@
|
||||
---
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: "/4"
|
||||
action:
|
||||
- service: weather.get_forecasts
|
||||
data:
|
||||
type: daily
|
||||
target:
|
||||
entity_id: weather.forecast_home
|
||||
response_variable: daily
|
||||
sensor:
|
||||
- sensor:
|
||||
- name: e-ink Display Data
|
||||
unique_id: e_ink_display_data
|
||||
icon: ios:display-2
|
||||
icon: mdi:display-2
|
||||
state: "OK"
|
||||
attributes:
|
||||
greeting: >
|
||||
{%- if now() > today_at('18:00') %}
|
||||
Good evening
|
||||
{%- elif now() > today_at('12:00') %}
|
||||
Good afternoon
|
||||
{%- elif now() > today_at('5:00') %}
|
||||
Good morning
|
||||
{%- else %}
|
||||
Good night
|
||||
{%- endif %}
|
||||
|
||||
weather_condition_now: >
|
||||
{% set cond_now = states('weather.forecast_home') %}
|
||||
{% if states('sun.sun') == 'below_horizon' %}
|
||||
{% if cond_now == 'sunny' %} night {% elif cond_now == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond_now }} {% endif %}
|
||||
{% else %}
|
||||
{{ cond_now }}
|
||||
{% endif %}
|
||||
|
||||
weather_condition_0: >
|
||||
{% set cond0 = daily["weather.forecast_home"].forecast[0].condition %}
|
||||
# {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
|
||||
# {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
|
||||
{% set cond0_time = as_timestamp(daily["weather.forecast_home"].forecast[0].datetime) %}
|
||||
{% if cond0_time > next_setting and cond0_time < next_rising %}
|
||||
{% if cond0 == 'sunny' %} night {% elif cond0 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond0 }} {% endif %}
|
||||
{% else %}
|
||||
{{ cond0 }}
|
||||
{% endif %}
|
||||
weather_temperature_0: >
|
||||
{{ daily["weather.forecast_home"].forecast[0].temperature | round }}
|
||||
weather_timestamp_0: >
|
||||
{{ as_timestamp(daily["weather.forecast_home"].forecast[0].datetime) | timestamp_custom('%a') }}
|
||||
weather_condition_1: >
|
||||
{% set cond1 = daily["weather.forecast_home"].forecast[1].condition %}
|
||||
# {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
|
||||
# {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
|
||||
{% set cond1_time = as_timestamp(daily["weather.forecast_home"].forecast[1].datetime) %}
|
||||
{% if cond1_time > next_setting and cond1_time < next_rising %}
|
||||
{% if cond1 == 'sunny' %} night {% elif cond1 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond1 }} {% endif %}
|
||||
{% else %}
|
||||
{{ cond1 }}
|
||||
{% endif %}
|
||||
weather_temperature_1: >
|
||||
{{ daily["weather.forecast_home"].forecast[1].temperature | round }}
|
||||
weather_timestamp_1: >
|
||||
{{ as_timestamp(daily["weather.forecast_home"].forecast[1].datetime) | timestamp_custom('%a') }}
|
||||
weather_condition_2: >
|
||||
{% set cond2 = daily["weather.forecast_home"].forecast[2].condition %}
|
||||
# {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
|
||||
# {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
|
||||
{% set cond2_time = as_timestamp(daily["weather.forecast_home"].forecast[2].datetime) %}
|
||||
{% if cond2_time > next_setting and cond2_time < next_rising %}
|
||||
{% if cond2 == 'sunny' %} night {% elif cond2 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond2 }} {% endif %}
|
||||
{% else %}
|
||||
{{ cond2 }}
|
||||
{% endif %}
|
||||
weather_temperature_2: >
|
||||
{{ daily["weather.forecast_home"].forecast[2].temperature | round }}
|
||||
weather_timestamp_2: >
|
||||
{{ as_timestamp(daily["weather.forecast_home"].forecast[2].datetime) | timestamp_custom('%a') }}
|
||||
weather_condition_3: >
|
||||
{% set cond3 = daily["weather.forecast_home"].forecast[3].condition %}
|
||||
# {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
|
||||
# {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
|
||||
{% set cond3_time = as_timestamp(daily["weather.forecast_home"].forecast[3].datetime) %}
|
||||
{% if cond3_time > next_setting and cond3_time < next_rising %}
|
||||
{% if cond3 == 'sunny' %} night {% elif cond3 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond3 }} {% endif %}
|
||||
{% else %}
|
||||
{{ cond3 }}
|
||||
{% endif %}
|
||||
weather_temperature_3: >
|
||||
{{ daily["weather.forecast_home"].forecast[3].temperature | round }}
|
||||
weather_timestamp_3: >
|
||||
{{ as_timestamp(daily["weather.forecast_home"].forecast[3].datetime) | timestamp_custom('%a') }}
|
||||
# afval_today: >
|
||||
# {{ states('sensor.afvalinfo_thuis_trash_type_today') }}
|
||||
# afval_tomorrow: >
|
||||
# {{ states('sensor.afvalinfo_thuis_trash_type_tomorrow') }}
|
||||
# sun_next_rising: >
|
||||
# {{ state_attr('Sun.sun', 'next_rising') }}
|
||||
# sun_next_setting: >
|
||||
# {{ state_attr('Sun.sun', 'next_setting') }}
|
||||
moon_phase_icon: >
|
||||
{{ state_attr('sensor.moon_phase', 'icon') }}
|
||||
|
||||
media_playing_status: >
|
||||
{{ states('media_player.keuken') }}
|
||||
media_playing_title: >
|
||||
{{ state_attr('media_player.keuken', 'media_title') | title }}
|
||||
media_playing_artist: >
|
||||
{{ state_attr('media_player.keuken', 'media_artist') | title }} (on {{ state_attr('media_player.office_sonos', 'media_channel') | title }})
|
||||
{%- if now() > today_at('18:00') %}Good evening{%- elif now() > today_at('12:00') %}Good afternoon{%- elif now() > today_at('5:00') %}Good morning{%- else %}Good night{%- endif %}
|
||||
|
||||
day_full: >
|
||||
{% set days = ['Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag'] %}
|
||||
@@ -115,3 +14,21 @@ sensor:
|
||||
datum: >
|
||||
{% set months = ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'] %}
|
||||
{{ now().day }} {{ months[now().month-1] }} {{ now().year }}
|
||||
|
||||
weather_condition_now: >
|
||||
{% set cond_now = states('weather.forecast_home') %}
|
||||
{% if states('sun.sun') == 'below_horizon' %}
|
||||
{% if cond_now == 'sunny' %}night{% elif cond_now == 'partlycloudy' %}night-partly-cloudy{% else %}{{ cond_now }}{% endif %}
|
||||
{% else %}
|
||||
{{ cond_now }}
|
||||
{% endif %}
|
||||
|
||||
moon_phase_icon: >
|
||||
{{ state_attr('sensor.moon_phase', 'icon') | default('🌙') }}
|
||||
|
||||
media_playing_status: >
|
||||
{{ states('media_player.keuken') }}
|
||||
media_playing_title: >
|
||||
{{ state_attr('media_player.keuken', 'media_title') | title }}
|
||||
media_playing_artist: >
|
||||
{{ state_attr('media_player.keuken', 'media_artist') | title }}
|
||||
|
||||
87
entities/templates/homeassistant_status.yaml
Normal file
87
entities/templates/homeassistant_status.yaml
Normal file
@@ -0,0 +1,87 @@
|
||||
# SMOKE DETECTOR STATUS - Returns "OK" or error
|
||||
- sensor:
|
||||
- name: "Smoke Detector Status Summary"
|
||||
unique_id: smoke_detector_status_summary
|
||||
icon: mdi:fire
|
||||
state: >
|
||||
{% set overloop_battery = states('sensor.rookmelder_overloop_batterij') | float(100) %}
|
||||
{% set overloop_life = states('binary_sensor.rookmelder_overloop_is_life_end') %}
|
||||
{% set overloop_smoke = states('binary_sensor.rookmelder_overloop_rook') %}
|
||||
{% set hall_battery = states('sensor.rookmelder_hal_batterij') | float(100) %}
|
||||
|
||||
{% if overloop_battery < 10 or overloop_life == 'on' or overloop_smoke == 'on' or hall_battery < 10 %}
|
||||
ERROR
|
||||
{% else %}
|
||||
OK
|
||||
{% endif %}
|
||||
attributes:
|
||||
overloop_battery: "{{ states('sensor.rookmelder_overloop_batterij') }}"
|
||||
hall_battery: "{{ states('sensor.rookmelder_hal_batterij') }}"
|
||||
|
||||
# CAR DIAGNOSTICS STATUS - Returns "OK" or error
|
||||
- sensor:
|
||||
- name: "Car Diagnostics Summary"
|
||||
unique_id: car_diagnostics_summary
|
||||
icon: mdi:car-alert
|
||||
state: >
|
||||
{% set doors_open = states('binary_sensor.skoda_enyaq_deuren') %}
|
||||
{% set windows_open = states('binary_sensor.skoda_enyaq_ramen') %}
|
||||
{% set charge_pct = states('sensor.skoda_enyaq_accupercentage') | float(50) %}
|
||||
|
||||
{% if doors_open == 'on' or windows_open == 'on' or charge_pct < 15 %}
|
||||
ERROR
|
||||
{% else %}
|
||||
OK
|
||||
{% endif %}
|
||||
attributes:
|
||||
doors: "{{ states('binary_sensor.skoda_enyaq_deuren') }}"
|
||||
windows: "{{ states('binary_sensor.skoda_enyaq_ramen') }}"
|
||||
charge_pct: "{{ states('sensor.skoda_enyaq_accupercentage') }}"
|
||||
|
||||
# HOMELAB SERVICES STATUS - Returns "OK" or error if any service is down
|
||||
- sensor:
|
||||
- name: "Homelab Services Summary"
|
||||
unique_id: homelab_services_summary
|
||||
icon: mdi:server-network
|
||||
state: >
|
||||
{% set adguard = states('sensor.pi_hole_status_2') %}
|
||||
{% set gitea = states('sensor.gitea_status_2') %}
|
||||
{% set immich = states('sensor.immich_status_2') %}
|
||||
{% set ha = states('sensor.homeassistant_status_2') %}
|
||||
{% set jellyfin = states('sensor.jellyfin_status_2') %}
|
||||
{% set nginx = states('sensor.nginix_proxymananger_status_2') %}
|
||||
{% set mqtt = states('sensor.mqtt_broker_status_2') %}
|
||||
{% set truenas = states('sensor.truenas_status_2') %}
|
||||
{% set zigbee = states('sensor.zigbee_thread_status_2') %}
|
||||
{% set zwave = states('sensor.zwave_status_2') %}
|
||||
{% set last_backup = as_timestamp(states('sensor.backup_last_successful_automatic_backup')) %}
|
||||
{% set backup_hours_ago = ((now().timestamp() - last_backup) / 3600) | int %}
|
||||
|
||||
{% if adguard == 'off' or gitea == 'off' or immich == 'off' or ha == 'off' or jellyfin == 'off' or nginx == 'off' or mqtt == 'off' or truenas == 'off' or zigbee == 'off' or zwave == 'off' or backup_hours_ago > 48 %}
|
||||
ERROR
|
||||
{% else %}
|
||||
OK
|
||||
{% endif %}
|
||||
attributes:
|
||||
adguard: "{{ states('sensor.pi_hole_status_2') }}"
|
||||
jellyfin: "{{ states('sensor.jellyfin_status_2') }}"
|
||||
mqtt: "{{ states('sensor.mqtt_broker_status_2') }}"
|
||||
last_backup: "{{ states('sensor.backup_last_successful_automatic_backup') }}"
|
||||
|
||||
# BATTERY STATUS - Returns "OK" or error if any battery is critically low
|
||||
- sensor:
|
||||
- name: "Battery Status Summary"
|
||||
unique_id: battery_status_summary
|
||||
icon: mdi:battery-alert
|
||||
state: >
|
||||
{% set doorlock_battery = states('sensor.voordeur_batterij') | float(100) %}
|
||||
{% set car_battery = states('sensor.skoda_enyaq_accupercentage') | float(100) %}
|
||||
|
||||
{% if doorlock_battery < 10 or car_battery < 15 %}
|
||||
ERROR
|
||||
{% else %}
|
||||
OK
|
||||
{% endif %}
|
||||
attributes:
|
||||
doorlock: "{{ states('sensor.voordeur_batterij') }}"
|
||||
car: "{{ states('sensor.skoda_enyaq_accupercentage') }}"
|
||||
Reference in New Issue
Block a user