2024-09-20 14:13:04 +01:00
|
|
|
alias: Floppy Player
|
|
|
|
description: ""
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id:
|
2024-09-20 14:37:47 +01:00
|
|
|
- sensor.floppy_player_current_disc_id
|
|
|
|
id: disc_changed
|
2024-09-20 14:13:04 +01:00
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- sensor.floppy_player_device_status
|
|
|
|
id: EJECT
|
|
|
|
to: EJECT
|
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- sensor.floppy_player_device_status
|
|
|
|
id: PLAY
|
|
|
|
to: PLAY
|
2024-09-20 14:37:47 +01:00
|
|
|
enabled: true
|
2024-09-20 14:13:04 +01:00
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- sensor.floppy_player_device_status
|
|
|
|
id: PAUSE
|
|
|
|
to: PAUSE
|
2024-09-20 14:37:47 +01:00
|
|
|
enabled: true
|
2024-09-20 14:13:04 +01:00
|
|
|
condition: []
|
|
|
|
action:
|
|
|
|
- if:
|
|
|
|
- condition: trigger
|
|
|
|
id:
|
2024-09-20 14:37:47 +01:00
|
|
|
- disc_changed
|
2024-09-20 14:13:04 +01:00
|
|
|
then:
|
|
|
|
- service: media_player.play_media
|
|
|
|
data:
|
2024-09-20 14:37:47 +01:00
|
|
|
media_content_id: "{{ states('sensor.floppy_player_current_disc_id') | string }}"
|
|
|
|
media_content_type: "{{ states('sensor.floppy_player_current_disc_type') | string }}"
|
2024-09-20 14:13:04 +01:00
|
|
|
target:
|
|
|
|
entity_id: media_player.ytube_music_player
|
|
|
|
- if:
|
|
|
|
- condition: trigger
|
|
|
|
id:
|
|
|
|
- EJECT
|
|
|
|
then:
|
|
|
|
- service: media_player.media_stop
|
|
|
|
target:
|
|
|
|
entity_id: media_player.ytube_music_player
|
|
|
|
data: {}
|
|
|
|
- if:
|
|
|
|
- condition: trigger
|
|
|
|
id:
|
|
|
|
- PLAY
|
|
|
|
- PAUSE
|
|
|
|
then:
|
|
|
|
- service: media_player.media_play_pause
|
|
|
|
target:
|
|
|
|
entity_id:
|
|
|
|
- media_player.ytube_music_player
|
|
|
|
data: {}
|
|
|
|
mode: single
|