Masz nieodpowiednie wcięcia, tak powinny wyglądać:
shortcuts:
buttons:
- id: http://78.46.170.230:8040/;
type: music
image: https://media2.pl/g/780/1047.jpg
i tak dalej
Edit:
A tak na marginesie, zadałeś Sobie chociaż tyle “trudu” i oglądałeś film @artur - a z tego wątku?
Wklej kod karty a nie jedynie screenshota z edytora, ale skoro jesteś w edytorze yaml karty, to nie masz nawet zdefiniowanego jej typu.
Czy ten kod nie powinien być przypadkiem w configuration.yaml
?
Zobacz poradnik Artura ja zrobiłem jak on pokazywał.
No nie wierzę, ale obejrzę wkrótce.
Oczywiście że oglądałem i skopiowałem z filmu przykład
No to @rafkan już odpowiedział, faktycznie definicja typu karty jest na samym dole (zamiast standardowo na górze), ale to nie ma znaczenia (jakkolwiek z tego powodu przegapiłem deklarację typu, bo staram się mieć uporządkowane konfiguracje kart i dobrym zwyczajem ta deklaracja bywa zwykle na początku).
W YAML’u każda spacja jest na wagę złota
To zobacz jeszcze raz (szczególnie 5 min 33 sek.) i porównaj ze Swoim wpisem.
Tak jak napisał:
A zainstalowałeś mini-media-player? Jeśli tak to odśwież stronę (F5)
Przy okazji pierwszego posta, witam wszystkich serdecznie.
Moja integracja radia poszła trochę w inna stronę, użyłem noda cast i standardowego media playera z home assistant.
Moja funkcja losuje sobie radio (na przykładzie 2 radia) i odtwarza go na google home.
Docelowo chce to połączyć z przyciskiem zigbee.
Mam jednak pytanie, czy jest możliwość nadpisać tytuł w media playerze? Pojawia się adres URL a chciałbym sobie zdefiniować jakieś przyjazne nazwy.
flows radio.json (3,4 KB)
Udało mi sie to tylko korzystając z automatyzacji.
Teraz widzę, że działa też w NR
{
"data":{
"media_content_id": "https://n01a-eu.rcs.revma.com/ypqt40u0x1zuv?rj-ttl=5&rj-tok=AAABdnWwLTwA_AzEj_1ivl-uYw",
"media_content_type":"music",
"extra":{
"title": "Radio Nowy Świat",
}
}
}
return msg;
Konfiguracja Radia dla Packages. Jak korzystać z packages: https://forum.arturhome.pl/t/package-w-home-assistant/707
chromecast_radio.yaml
Kod:
input_select:
radio_station:
name: 'Wybierz Stację Radiową:'
options:
- RMF FM
- RMF MAXX
- RMF Classisc
- AntyRadio
- Absolute Radio Classisc Rock
- Meloradio
- Muzo Radio
- RadioZET
- ChilliZet
- Eska
- Jedynka
- Dwójka
- Trójka
- Złote przeboje
- Spotyfy
- Na Cały Dzień
- DI Disco House
- DI Funky House
- DI Liquid D&B
- Aloha Joe's Relaxation Island
- Spectrum Fit
- Energy FM Australia
- Jazz Relax
- Australian Country
- Rebel FM
initial: RMF FM
icon: mdi:radio
chromecast_radio:
name: 'Wybierz Głośniki:'
options:
- Salon
- Salon Alexa
- Kuchnia
- Lounge and Office
- House
- House except office
- Everywhere
- Everywhere except office
- Back yard
initial: Salon
icon: mdi:speaker-wireless
input_number:
volume_radio:
name: Volume
icon: mdi:volume-high
min: 0
max: 1
step: 0.05
automation:
- alias: 'Listen Radio'
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
- alias: 'Set Chromecast Radio Volume'
trigger:
platform: state
entity_id: input_number.volume_radio
action:
service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Salon") %} media_player.pokoj_dzienny
{% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
{% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
{% elif is_state("input_select.chromecast_radio", "Lounge and Office") %} media_player.lounge_and_office
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house
{% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
{% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
{% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
script:
radio:
alias: Play Radio on Chromecast Audio
sequence:
- service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Salon") %} media_player.pokoj_dzienny
{% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
{% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
{% elif is_state("input_select.chromecast_radio", "Lounge and Office") %} media_player.lounge_and_office
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house
{% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
{% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
{% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Salon") %} media_player.pokoj_dzienny
{% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
{% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
{% elif is_state("input_select.chromecast_radio", "Lounge and Office") %} media_player.lounge_and_office
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house
{% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
{% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
{% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
{% endif %}
media_content_id: >
{% if is_state("input_select.radio_station", "RMF FM") %} http://217.74.72.11/rmf_fm
{% elif is_state("input_select.radio_station", "RMF MAXX") %} http://www.rmfon.pl/n/rmfmaxxx.pls
{% elif is_state("input_select.radio_station", "RMF Classic") %} http://rmfstream1.interia.pl:8000/rmf_classic
{% elif is_state("input_select.radio_station", "AntyRadio") %} http://stream.polandrockfestival.pl:8000/
{% elif is_state("input_select.radio_station", "Absolute Radio Classisc Rock") %} http://icy-e-bab-04-cr.sharp-stream.com/absoluteclassicrock.mp3
{% elif is_state("input_select.radio_station", "Meloradio") %} https://ml.cdn.eurozet.pl/mel-net.mp3
{% elif is_state("input_select.radio_station", "Muzo Radio") %} http://stream4.nadaje.com/muzo
{% elif is_state("input_select.radio_station", "RadioZET") %} https://zt.cdn.eurozet.pl/zet-tun.mp3
{% elif is_state("input_select.radio_station", "ChilliZet") %} http://chi-net.cdn.eurozet.pl:8900/
{% elif is_state("input_select.radio_station", "Eska") %} http://www.pldm.ml/radio.php?id=-1&url=http://www.eskago.pl/radio/eska-malopolska-zakopane
{% elif is_state("input_select.radio_station", "Jedynka") %} http://mp3.polskieradio.pl:8900/
{% elif is_state("input_select.radio_station", "Dwójka") %} http://mp3.polskieradio.pl:8902/
{% elif is_state("input_select.radio_station", "Trójka") %} http://mp3.polskieradio.pl:8904/
{% elif is_state("input_select.radio_station", "Złote przeboje") %} http://mainstream.radioagora.pl/tuba9-1.mp3
{% elif is_state("input_select.radio_station", "Spotify") %} spotify:playlist:37i9dQZF1E33339f3jF222
{% elif is_state("input_select.radio_station", "Na Cały Dzień") %} https://stream.open.fm/69
{% elif is_state("input_select.radio_station", "DI Disco House") %} http://pub1.diforfree.org:8000/di_discohouse_hi
{% elif is_state("input_select.radio_station", "DI Funky House") %} http://pub1.diforfree.org:8000/di_funkyhouse_hi
{% elif is_state("input_select.radio_station", "DI Liquid D&B") %} http://pub1.diforfree.org:8000/di_liquiddnb_hi
{% elif is_state("input_select.radio_station", "Aloha Joe's Relaxation Island") %} http://s2.voscast.com:7932/
{% elif is_state("input_select.radio_station", "Spectrum Fit") %} http://51.255.235.165:5292/
{% elif is_state("input_select.radio_station", "Energy FM Australia") %} http://s3.viastreaming.net:8502/
{% elif is_state("input_select.radio_station", "Jazz Relax") %} http://199.195.194.94:8036/stream
{% elif is_state("input_select.radio_station", "Australian Country") %} https://streaming.radio.co/s5ea3fdd1c/listen
{% elif is_state("input_select.radio_station", "Rebel FM") %} https://au1.fastcast4u.com/proxy/rblgc?mp=/stream
{% endif %}
media_content_type: 'audio/mp4'
radiostop:
alias: Radio Stop
sequence:
- service: media_player.turn_off
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Salon") %} media_player.pokoj_dzienny
{% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
{% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
{% elif is_state("input_select.chromecast_radio", "Salon + Salon Alexa") %} media_player.group
{% elif is_state("input_select.chromecast_radio", "Wszystkie") %} media_player.all
{% endif %}
Karta HA :
entities:
- entity: input_select.radio_station
- entity: input_select.chromecast_radio
- entity: script.radio
- entity: input_number.volume_radio
- entity: script.radio_stop
header:
image: /local/images/internet_radio.jpg
type: picture
show_header_toggle: false
type: entities
Obrazek:
Ma ktoś pomysł?
I drugie pytanie, gdy w trakcie grania radia właczy się kukułka wywołana z Node-Red, to jak przywrócić kontynuację radia (radio tradycyjnie zrobione wg filmu Artura).
Temat wznawiania odtwarzania po komunikacie był już wielokrotnie poruszany. Ja korzystam z SmartTTS i jestem bardzo zadowolony. Dodatkowo twórca bardzo pomocny. Wznawia radio, Spotify i Youtube Music. Polecam.
Na razie poradziłem sobie z tym w Node-red modyfikując workflow “kukułki”. Bez zgłębiania tematu SmartTTS dla mnie pod podanym linkiem jest za mało informacji jak to skonfigurować. Być może kiedyś to zgłębię
Witam!
czy komuś udało się z tą grafiką bez Node-red?
ja kombinuje i nic, grafika pojawia się tylko jak uruchomię radio przez asystenta google tz. powiem ok google i np włącz radio zet
W jaki sposób można nadać odpowiednie wartości Pomocnikowi w zależności od wybranej stacji lub playlisty mp3, aby przekazać to do NodeRed?