The receiver appears as media_player.vusolo4k. After some time or restarts (I haven’t figured it out, what
causes the issue). The old entity is no longer valid and another entity e.g. media_player.vusolo4k_2
apperars. Last time even a media_player.vusolo4k_local appears.
That’s annoying because my automations wont work any longer
Does anyone have the same issue? Any idea what causes this?
I changed my automation. Now the automation searches all media_players and checks the entity_id.
If it finds one with the (sub)string ‘vusolo4k’ and it is available. It uses that media_player.
alias: MISC_ausschalten
description: ""
trigger:
- platform: state
to: "off"
entity_id:
- switch.fernseher
from: "on"
condition:
- condition: template
value_template: |-
{% for mp in states.media_player %}
{% if not 'unavailable' in mp.state and 'vusolo4k' in mp.entity_id %}
{{ is_state(mp.entity_id, 'on') }}
{% endif %}
{% endfor %}
action:
- service: switch.turn_off
target:
entity_id:
- switch.lichterkette
- switch.heizdecke_switch
data: {}
- service: media_player.turn_off
data: {}
target:
entity_id: |
{% for mp in states.media_player %}
{% if not 'unavailable' in mp.state and 'vusolo4k' in mp.name %}
{{ mp.entity_id }}
{% endif %}
{% endfor %}
mode: single