MrBartusek / MeteoalarmCard

Meteoalarm, Météo-France and DWD severe weather warnings card for Home Assistant Lovelace UI ⛈️
MIT License
134 stars 49 forks source link

Entities from Burze.dzis.net sensor v2.0.0 incompatible with MeteoalarmCard #201

Open nepozs opened 1 year ago

nepozs commented 1 year ago

Describe the bug

There are new entities generated after update (with breaking changes) https://github.com/PiotrMachowski/Home-Assistant-custom-components-Burze.dzis.net/releases/tag/v2.0.0

error:

Error: Selected integration doesn't match selected entities: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_burza, binary_sensor.burze_dzis_net_ostrzezenie_aktywne_opad, binary_sensor.burze_dzis_net_ostrzezenie_aktywne_traba, binary_sensor.burze_dzis_net_ostrzezenie_aktywne_wiatr, binary_sensor.burze_dzis_net_ostrzezenie_aktywne_upal, binary_sensor.burze_dzis_net_ostrzezenie_aktywne_mroz.

Integration state attributes

Examples of active state (state on ) New entities have new names

Example of new format entity, alert active new entity name binary_sensor.burze_dzis_net_ostrzezenie_upal attributes:

attribution: Information provided by Burze.dzis.net.
level: 1
description: od 30 do 34°C
from: 2023-07-15 06:00:00+00:00
to: 2023-07-15 18:00:00+00:00
device_class: safety
icon: mdi:weather-sunny
friendly_name: Burze.dzis.net Ostrzeżenie - Upał

example of new format secondary entity, alert active new entity name binary_sensor.burze_dzis_net_ostrzezenie_aktywne_upal attributes:

attribution: Information provided by Burze.dzis.net.
level: 1
description: od 30 do 34°C
from: 2023-07-15 06:00:00+00:00
to: 2023-07-15 18:00:00+00:00
device_class: safety
icon: mdi:weather-sunny
friendly_name: Burze.dzis.net Ostrzeżenie Aktywne - Upał

old version entity (from different installation)

entity name binary_sensor.burze_dzis_net_heat_warning attributes:

attribution: Information provided by Burze.dzis.net.
level: 1
description: od 30 do 34°C
from: '2023-07-15 06:00:00+00:00'
to: '2023-07-15 18:00:00+00:00'
device_class: safety
icon: mdi:weather-sunny
friendly_name: Burze.dzis.net - Ostrzeżenie - Upał

Example of inactive (state off)`

binary_sensor.burze_dzis_net_ostrzezenie_mroz state off, attributes

attribution: Information provided by Burze.dzis.net.
device_class: safety
icon: mdi:weather-snowy
friendly_name: Burze.dzis.net Ostrzeżenie - Mróz

secondary entity binary_sensor.burze_dzis_net_ostrzezenie_aktywne_mroz state off, attributes

attribution: Information provided by Burze.dzis.net.
device_class: safety
icon: mdi:weather-snowy
friendly_name: Burze.dzis.net Ostrzeżenie Aktywne - Mróz

old version burze_dzis_net binary_sensor.burze_dzis_net_frost_warning state off, attributes

attribution: Information provided by Burze.dzis.net.
device_class: safety
icon: mdi:weather-snowy
friendly_name: Burze.dzis.net - Ostrzeżenie - Mróz

Screenshots

meteoalarm_card_2023-07-15_16-22 meteoalarm_card_console_2023-07-15_16-22

Card version

v2.5.3

Installation type

Home Assistant Community Store (HACS)

Card Configuration

type: custom:meteoalarm-card
override_headline: true
hide_when_no_warning: true
integration: burze_dzis_net
entities:
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_burza
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_opad
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_traba
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_wiatr
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_upal
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_aktywne_mroz
disable_swiper: false
scaling_mode: headline_and_scale

Integration type

Burze.dzis.net

Integration configuration

GUI

Integration Configuration

new version has only GUI config

error exist also with primary entities

type: custom:meteoalarm-card
override_headline: true
hide_when_no_warning: true
integration: burze_dzis_net
entities:
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_burza
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_opad
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_traba
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_wiatr
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_upal
  - entity: binary_sensor.burze_dzis_net_ostrzezenie_mroz
disable_swiper: false
scaling_mode: headline_and_scale
PiotrMachowski commented 1 year ago

The real problem is that since v2.0.0 it's possible for users to change entity names to anything they want. You can check out my solution for this problem here. This code allows me to retrieve all entities from the same device as the entity passed in the argument. Then I recognize every entity by comparing its unique id. I believe a similar approach might be possible to be used for this card as well.

nepozs commented 2 months ago

Quick and dirty workaround for users (2024.07.14 - still works, MeteoalarmCard v2.7.1 + Burze.dzis.net sensor v2.0.1) - entity names should be changed to compatible with burze_dzis_net versions prior to 2.0.0 https://forum.arturhome.pl/t/integracja-burze-dzis-net-jak-wyswietlic-tylko-ostrzezenia-wlaczone/5189/10