diff --git a/home_assistant_automation.yaml b/home_assistant_automation.yaml index ef9c48a..271c021 100644 --- a/home_assistant_automation.yaml +++ b/home_assistant_automation.yaml @@ -3,8 +3,8 @@ description: "" trigger: - platform: state entity_id: - - sensor.floppy_player_current_disc - id: play song + - sensor.floppy_player_current_disc_id + id: disc_changed - platform: state entity_id: - sensor.floppy_player_device_status @@ -15,22 +15,24 @@ trigger: - sensor.floppy_player_device_status id: PLAY to: PLAY + enabled: true - platform: state entity_id: - sensor.floppy_player_device_status id: PAUSE to: PAUSE + enabled: true condition: [] action: - if: - condition: trigger id: - - play song + - disc_changed then: - service: media_player.play_media data: - media_content_id: "{{ states('sensor.floppy_player_current_disc_id') }}" - media_content_type: "{{ states('sensor.floppy_player_current_disc_type') }}" + media_content_id: "{{ states('sensor.floppy_player_current_disc_id') | string }}" + media_content_type: "{{ states('sensor.floppy_player_current_disc_type') | string }}" target: entity_id: media_player.ytube_music_player - if: