DIR sensor
configuration.yaml
- platform: folder
folder: '/media/MyMusic/evolved'
filter: '*.mp3'
automation:
–>> webhook | boolean sensor on/off Shuffle | reload nach idle Mediaplayer.
alias: mp3_Evolved_with_path
description: mp3_Evolved_with_path
trigger:
- platform: webhook
local_only: true
webhook_id: mp3-evolved-with-path-p7yE65Tx2Kxrfrgrwgrwg
- platform: device
device_id: 9d247bbe9a537ece8d6ec2590ba17881
domain: media_player
entity_id: 2e407bba8626598a80bfcde6e100aa0e
type: idle
for:
hours: 0
minutes: 0
seconds: 2
condition:
- condition: state
entity_id: input_boolean.media_player_qas_400_1308_shuffle
state: "on"
action:
- service: media_player.play_media
target:
entity_id: media_player.qas_400_1308
data:
media_content_id: >-
{{ state_attr('sensor.evolved', 'file_list')|random |
replace('/media/','media-source://media_source/local/') }}
media_content_type: audio/mp3
metadata:
title: >-
{{ state_attr('sensor.evolved', 'file_list')|random |
replace('/media/MyMusic/evolved/','') | replace('.mp3','')}}
thumbnail: http://192.168.0.50/audio/evolved.png
media_class: music
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
- media_content_type: ""
media_content_id: media-source://media_source/local/MyMusic
- media_content_type: ""
media_content_id: media-source://media_source/local/MyMusic/evolved
mode: single
howto load pictures and title???