- 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.
88 lines
3.9 KiB
YAML
88 lines
3.9 KiB
YAML
# 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') }}"
|