Any guidance to play an Apple Music/Radio Station on an Alexa Media Player through Node-RED?
Are you already able to do what you want from within HomeAssistant?
If so, then its pretty easy to translate the service calls from yaml to json for NodeRed.
If you can post what you have already tried and where you failed then this helps us to help you.
That is my issue. I have not been successful as I can’t seem to find an example. I never did HA service calls from yaml using automations or scenes. I started off using HA with NodeRED. I see here you would do something like:
{
"entity_id": "media_player.dining_room",
"media_content_id": "7 rings",
"media_content_type": "APPLE_MUSIC"
}
Here is the node I am using along with the debug error. I have the above JSON in the Data section of the Node.
That is because you didnt select the service.
Try play_media in the service field.
The entitiy ID you can also simply put in the entity ID field and leave it out of the data if you prefer.
I have tried that. I am using the media_player.dining_room that was created by the Alexa Media Player add-on. I am not going directly to Alexa through NodeRED.
Here is the flow:
[{“id”:“73d9b6ff.216bb8”,“type”:“api-call-service”,“z”:“541b2941.20dae8”,“name”:“Play Music”,“server”:“f4c3f22d.c5133”,“version”:1,“debugenabled”:false,“service_domain”:“media_player”,“service”:“media_play”,“entityId”:“media_player.dining_room”,“data”:"{“media_content_id”:“7 rings”,“media_content_type”:“APPLE_MUSIC”}",“dataType”:“json”,“mergecontext”:"",“output_location”:"",“output_location_type”:“none”,“mustacheAltTags”:false,“x”:390,“y”:100,“wires”:[[]]},{“id”:“f4c3f22d.c5133”,“type”:“server”,“name”:“Home Assistant”,“legacy”:false,“addon”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:true,“cacheJson”:true}]
Thoughts?
Yes, please use the play_media not the media_play.
I would recommend you to make yourself familiar with the service calls in HomeAssistant.
If you go to developer tools you can select all of them and check them out. There are several helpers in there as well that will give you pointers.
Apparently I am dyslexic. Ugh I didn’t see play_media. And I have over 100 flows running my home. So fairly proficient on how to write node JSON. Appreciate your help on this!
Did you managed to get it working at the end?
I tried many thing included
{
"entity_id": "play_media.kevin_s_echo",
"media_content_id": "7 rings",
"media_content_type": "APPLE_MUSIC"
}
but I can’t make it work.
“Call-service API error. Error Message: extra keys not allowed @ data[‘entity_id’]”
when I check media_player.kevin_s_echo_dot on developer tools I’m can see this (called directly from Alexa not home assistant)
source_list:
- Local Speaker
volume_level: 0.6
is_volume_muted: false
media_content_type: standby
media_duration: 256
media_position: 256
media_position_updated_at: '2021-04-06T10:23:50.036911+00:00'
media_title: Back In Black
media_artist: AC/DC
media_album_name: Apple Music
source: Local Speaker
entity_picture_local: >-
/api/media_player_proxy/media_player.kevin_s_echo_dot?token=EDITED&cache=EDITED
available: true
last_called: false
last_called_timestamp: 1617703408288
last_called_summary: alexa stop
connected_bluetooth: null
bluetooth_list: []
friendly_name: Kitchen
entity_picture: >-
https://is1-ssl.mzstatic.com/image/thumb/Music/v4/18/c1/a4/18c1a4f8-3f50-9ba4-bdf9-b4148efa0564/886443673441.jpg/500x500bb.jpeg
supported_features: 56253
I’m new to home assistant so sorry if what I’'m saying make no sense but I don’t think I have the service
saying that it’s working using home assistant so it’s much be an issue with my node red code
on home assistant sometime is not playing the media asked but the previous media but when you execute again it’s usually work.
also any idea how to play an album instead or how to queue music?
Yes I have it working without any issues. Here is a flow I use for one of my notifications:
[{"id":"75d49e54.2bd1b","type":"server-state-changed","z":"2a3bef8.2446d1","name":"Mailbox","server":"f4c3f22d.c5133","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.mailbox","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":50,"y":1240,"wires":[["8c13a438.1c4578"]]},{"id":"8c13a438.1c4578","type":"switch","z":"2a3bef8.2446d1","name":"open/closed","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":1240,"wires":[["58ff5006.1c61","f3873a37.ab0c78"],["29e5976e.2f5658"]]},{"id":"58ff5006.1c61","type":"stoptimer","z":"2a3bef8.2446d1","duration":"5","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":400,"y":1040,"wires":[["a1c24d69.caf8"],[]]},{"id":"f3873a37.ab0c78","type":"time-range-switch","z":"2a3bef8.2446d1","name":"","lat":"","lon":"","startTime":"10:00","endTime":"15:00","startOffset":0,"endOffset":0,"x":430,"y":1220,"wires":[["d78da23d.455bb"],["e05d59e5.9fdc98"]]},{"id":"29e5976e.2f5658","type":"change","z":"2a3bef8.2446d1","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":1040,"wires":[["58ff5006.1c61"]]},{"id":"a1c24d69.caf8","type":"api-current-state","z":"2a3bef8.2446d1","name":"Mailbox","server":"f4c3f22d.c5133","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.mailbox","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":540,"y":920,"wires":[["940488d8.41b058"],[]]},{"id":"d78da23d.455bb","type":"random","z":"2a3bef8.2446d1","name":"","low":"1","high":"5","inte":"true","property":"payload","x":580,"y":1140,"wires":[["c52d0ecf.239a1","8732832b.6e3a5"]]},{"id":"e05d59e5.9fdc98","type":"change","z":"2a3bef8.2446d1","name":"Someone has opened your mailbox.","rules":[{"t":"set","p":"payload","pt":"msg","to":"Someone has opened your mailbox.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":980,"wires":[["7fcc1c48.023894"]]},{"id":"c32ad2b5.8297a","type":"stoptimer","z":"2a3bef8.2446d1","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":290,"y":960,"wires":[["29e5976e.2f5658"],[]]},{"id":"940488d8.41b058","type":"change","z":"2a3bef8.2446d1","name":"Mailbox has been left open.","rules":[{"t":"set","p":"payload","pt":"msg","to":"Mailbox has been left open.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":920,"wires":[["7fcc1c48.023894"]]},{"id":"c52d0ecf.239a1","type":"switch","z":"2a3bef8.2446d1","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":720,"y":1140,"wires":[["97841b90.a3e208"],["74bf2d89.190b84"],["8a3e3c77.ce518"],["9410acd5.8f73e"],["cb892bab.83df48"]]},{"id":"8732832b.6e3a5","type":"switch","z":"2a3bef8.2446d1","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":710,"y":1420,"wires":[["dcd20aac.e31fc8"],["75ad1cb.2b236e4"],["369a3d0d.b07d12"],["8d03d260.d24f4"],["71a648a1.8c3648"]]},{"id":"7fcc1c48.023894","type":"pushover","z":"2a3bef8.2446d1","name":"PushOver All Devices","device":"","title":"Mailbox","priority":0,"sound":"","url":"","url_title":"","html":false,"x":1500,"y":1140,"wires":[]},{"id":"5255c04e.f3644","type":"inject","z":"2a3bef8.2446d1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.1","topic":"","payload":"Started!","payloadType":"str","x":80,"y":960,"wires":[["c32ad2b5.8297a"]]},{"id":"97841b90.a3e208","type":"change","z":"2a3bef8.2446d1","name":"Mail has arrived. You've got mail!","rules":[{"t":"set","p":"payload","pt":"msg","to":"Mail has arrived. You've got mail!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1060,"wires":[["7fcc1c48.023894"]]},{"id":"74bf2d89.190b84","type":"change","z":"2a3bef8.2446d1","name":"Look what was just delivered. Your mail!","rules":[{"t":"set","p":"payload","pt":"msg","to":"Look what was just delivered. Your mail!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1100,"wires":[["7fcc1c48.023894"]]},{"id":"8a3e3c77.ce518","type":"change","z":"2a3bef8.2446d1","name":"Tally ho! Mail has arrived!","rules":[{"t":"set","p":"payload","pt":"msg","to":"Tally ho! Mail has arrived!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1140,"wires":[["7fcc1c48.023894"]]},{"id":"9410acd5.8f73e","type":"change","z":"2a3bef8.2446d1","name":"To write is human, to receive a letter: Devine! You got Mail!","rules":[{"t":"set","p":"payload","pt":"msg","to":"To write is human, to receive a letter: Devine! You got Mail!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1180,"wires":[["7fcc1c48.023894"]]},{"id":"cb892bab.83df48","type":"change","z":"2a3bef8.2446d1","name":"What? Could it be? It is! Mail has arrived!","rules":[{"t":"set","p":"payload","pt":"msg","to":"What? Could it be? It is! Mail has arrived!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1220,"wires":[["7fcc1c48.023894"]]},{"id":"dcd20aac.e31fc8","type":"change","z":"2a3bef8.2446d1","name":"Set Voice","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1300,"wires":[["f29d87f1.22f768"]]},{"id":"75ad1cb.2b236e4","type":"change","z":"2a3bef8.2446d1","name":"Set Voice","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1360,"wires":[["53202aed.fe6f84"]]},{"id":"369a3d0d.b07d12","type":"change","z":"2a3bef8.2446d1","name":"Set Voice","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1420,"wires":[["f7233ff8.94dbf"]]},{"id":"8d03d260.d24f4","type":"change","z":"2a3bef8.2446d1","name":"Set Voice","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1480,"wires":[["9eaac84c.81dc48"]]},{"id":"71a648a1.8c3648","type":"change","z":"2a3bef8.2446d1","name":"Set Voice","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1540,"wires":[["393f2f8e.e8175"]]},{"id":"f29d87f1.22f768","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"value\": payload}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.alexa_voice_number_box","data":"{\"value\": payload}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1090,"y":1300,"wires":[["5979ca70.e45bc4"]]},{"id":"53202aed.fe6f84","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"value\": payload}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.alexa_voice_number_box","data":"{\"value\": payload}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1090,"y":1360,"wires":[["ff012fbf.d7325"]]},{"id":"f7233ff8.94dbf","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"value\": payload}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.alexa_voice_number_box","data":"{\"value\": payload}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1090,"y":1420,"wires":[["da75af1c.44867"]]},{"id":"9eaac84c.81dc48","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"value\": payload}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.alexa_voice_number_box","data":"{\"value\": payload}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1090,"y":1480,"wires":[["5362a852.82daf8"]]},{"id":"393f2f8e.e8175","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"value\": payload}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.alexa_voice_number_box","data":"{\"value\": payload}","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1090,"y":1540,"wires":[["90b21706.a55798"]]},{"id":"5979ca70.e45bc4","type":"api-render-template","z":"2a3bef8.2446d1","name":"Template from HA","server":"f4c3f22d.c5133","template":"{{states.input_select.alexa_voice_tag.attributes['options'][states.input_number.alexa_voice_number_box.state | int]}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1310,"y":1300,"wires":[["62d0b675.c25338"]]},{"id":"ff012fbf.d7325","type":"api-render-template","z":"2a3bef8.2446d1","name":"Template from HA","server":"f4c3f22d.c5133","template":"{{states.input_select.alexa_voice_tag.attributes['options'][states.input_number.alexa_voice_number_box.state | int]}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1310,"y":1360,"wires":[["c091b1fe.5a4a7"]]},{"id":"da75af1c.44867","type":"api-render-template","z":"2a3bef8.2446d1","name":"Template from HA","server":"f4c3f22d.c5133","template":"{{states.input_select.alexa_voice_tag.attributes['options'][states.input_number.alexa_voice_number_box.state | int]}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1310,"y":1420,"wires":[["8d151608.f499a8"]]},{"id":"5362a852.82daf8","type":"api-render-template","z":"2a3bef8.2446d1","name":"Template from HA","server":"f4c3f22d.c5133","template":"{{states.input_select.alexa_voice_tag.attributes['options'][states.input_number.alexa_voice_number_box.state | int]}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1310,"y":1480,"wires":[["889520af.3212"]]},{"id":"90b21706.a55798","type":"api-render-template","z":"2a3bef8.2446d1","name":"Template from HA","server":"f4c3f22d.c5133","template":"{{states.input_select.alexa_voice_tag.attributes['options'][states.input_number.alexa_voice_number_box.state | int]}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":1310,"y":1540,"wires":[["ae510540.e56938"]]},{"id":"62d0b675.c25338","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"option\" : \"{{payload}}\"}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.alexa_voice_tag","data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1530,"y":1300,"wires":[["16fe78.7f287189"]]},{"id":"c091b1fe.5a4a7","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"option\" : \"{{payload}}\"}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.alexa_voice_tag","data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1530,"y":1360,"wires":[["22d22e3b.628cd2"]]},{"id":"8d151608.f499a8","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"option\" : \"{{payload}}\"}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.alexa_voice_tag","data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1530,"y":1420,"wires":[["3dfcf8d5.fad7a8"]]},{"id":"889520af.3212","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"option\" : \"{{payload}}\"}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.alexa_voice_tag","data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1530,"y":1480,"wires":[["35b905dd.6808ea"]]},{"id":"ae510540.e56938","type":"api-call-service","z":"2a3bef8.2446d1","name":"{\"option\" : \"{{payload}}\"}","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.alexa_voice_tag","data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1530,"y":1540,"wires":[["8f89b363.45f34"]]},{"id":"16fe78.7f287189","type":"api-call-service","z":"2a3bef8.2446d1","name":"Nofity the House Hold","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"message\":\"<voice name='{{states.input_select.alexa_voice_tag}}'>Mail has arrived. You've got mail!</voice>\",\"target\":[\"media_player.kitchen_echo_show\",\"media_player.office\",\"media_player.upstairs_office\",\"media_player.master_bathroom\"]}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1760,"y":1300,"wires":[[]]},{"id":"22d22e3b.628cd2","type":"api-call-service","z":"2a3bef8.2446d1","name":"Nofity the House Hold","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"message\":\"<voice name='{{states.input_select.alexa_voice_tag}}'>Look what was just delivered, your mail!</voice>\",\"target\":[\"media_player.kitchen_echo_show\",\"media_player.office\",\"media_player.upstairs_office\",\"media_player.master_bathroom\"]}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1760,"y":1360,"wires":[[]]},{"id":"3dfcf8d5.fad7a8","type":"api-call-service","z":"2a3bef8.2446d1","name":"Nofity the House Hold","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"message\":\"<voice name='{{states.input_select.alexa_voice_tag}}'>Tally ho! Mail has arrived!</voice>\",\"target\":[\"media_player.kitchen_echo_show\",\"media_player.office\",\"media_player.upstairs_office\",\"media_player.master_bathroom\"]}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1760,"y":1420,"wires":[[]]},{"id":"35b905dd.6808ea","type":"api-call-service","z":"2a3bef8.2446d1","name":"Nofity the House Hold","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"message\":\"<voice name='{{states.input_select.alexa_voice_tag}}'>To write is human, to receive a letter, Devine! You've got Mail!</voice>\",\"target\":[\"media_player.kitchen_echo_show\",\"media_player.office\",\"media_player.upstairs_office\",\"media_player.master_bathroom\"]}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1760,"y":1480,"wires":[[]]},{"id":"8f89b363.45f34","type":"api-call-service","z":"2a3bef8.2446d1","name":"Nofity the House Hold","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"message\":\"<voice name='{{states.input_select.alexa_voice_tag}}'>What could it be? Is it? It is! Mail has arrived!</voice>\",\"target\":[\"media_player.kitchen_echo_show\",\"media_player.office\",\"media_player.upstairs_office\",\"media_player.master_bathroom\"]}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1760,"y":1540,"wires":[[]]},{"id":"f4c3f22d.c5133","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
sorry to bother you again but do you have a flow for Apple Music?
I managed to have it working with home assistant script but my flow always have an error I’m pretty sure this is from my data filed
{
"data": {
"entity_id": "play_media.kevin_s_echo",
"media_content_id": "7 rings",
"media_content_type": "APPLE_MUSIC"
}
}
[{"id":"50d45e02.2180b8","type":"inject","z":"55172b20.04a614","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":260,"wires":[["1a9481c4.ac4116"]]},{"id":"1a9481c4.ac4116","type":"api-call-service","z":"55172b20.04a614","name":"Alexa Office","server":"39792d62.f71ed2","version":1,"debugenabled":false,"service_domain":"","service":"media_player.play_media","entityId":"","data":"{\"data\":{\"entity_id\":\"play_media.kevin_s_echo\",\"media_content_id\":\"7 rings\",\"media_content_type\":\"APPLE_MUSIC\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":490,"y":220,"wires":[[]]},{"id":"39792d62.f71ed2","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Here ya go:
[{"id":"192f73a1.849c5c","type":"server-state-changed","z":"9f81ca8e.927948","name":"Doggy Bed Time Toggle","server":"f4c3f22d.c5133","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.doggy_bed_time","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":120,"y":500,"wires":[["3d62a9e0.6d7dd6"]]},{"id":"3d62a9e0.6d7dd6","type":"switch","z":"9f81ca8e.927948","name":"on/off?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":500,"wires":[["63ed9986.5f0c98","4432d562.093fec","2aee629b.37f16e"],["f94914a6.518c88","c54e88ed.0cfbf8"]]},{"id":"c54e88ed.0cfbf8","type":"api-call-service","z":"9f81ca8e.927948","name":"Stop Music","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_stop","entityId":"media_player.dining_room","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":510,"y":580,"wires":[[]]},{"id":"2aee629b.37f16e","type":"api-call-service","z":"9f81ca8e.927948","name":"Set volume","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.dining_room","data":"{\"volume_level\":\"0.5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":510,"y":500,"wires":[["7217b89d.223898"]]},{"id":"63ed9986.5f0c98","type":"api-call-service","z":"9f81ca8e.927948","name":"Turn off Lights","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.zooz_dining_room_light","data":"{\"transition\":\"2\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":520,"y":440,"wires":[[]]},{"id":"4432d562.093fec","type":"api-call-service","z":"9f81ca8e.927948","name":"Turn off Foyer","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.front_entry_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":520,"y":380,"wires":[[]]},{"id":"7217b89d.223898","type":"api-call-service","z":"9f81ca8e.927948","name":"Play Music","server":"f4c3f22d.c5133","version":1,"debugenabled":true,"service_domain":"media_player","service":"play_media","entityId":"media_player.dining_room","data":"{\"media_content_id\":\"classical music\",\"media_content_type\":\"APPLE_MUSIC\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":710,"y":500,"wires":[[]]},{"id":"f94914a6.518c88","type":"switch","z":"9f81ca8e.927948","name":"lux","property":"lux","propertyType":"global","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":60,"wires":[["5d1e46f0.2a5a28","3f39cb12.bd0084"],[]]},{"id":"3f39cb12.bd0084","type":"time-range-switch","z":"9f81ca8e.927948","name":"Sleep","lat":"41.540583","lon":"-88.276465","startTime":"22:00","endTime":"06:30","startOffset":0,"endOffset":0,"x":970,"y":60,"wires":[["e8a1205f.b3245"],["afe5b5d6.4b06b8"]]},{"id":"e8a1205f.b3245","type":"api-call-service","z":"9f81ca8e.927948","name":"Turn on Lights 30%","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zooz_dining_room_light","data":"{\"transition\":\"2\",\"brightness_pct\":\"30\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":40,"wires":[[]]},{"id":"afe5b5d6.4b06b8","type":"api-call-service","z":"9f81ca8e.927948","name":"Turn on Lights 100%","server":"f4c3f22d.c5133","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.zooz_dining_room_light","data":"{\"transition\":\"2\",\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1160,"y":100,"wires":[[]]},{"id":"f4c3f22d.c5133","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Thank a million that’s perfect, some how I had “no connection” I rebooted 10 times and now is working… ! anyway thanks again that’s brilliant !
Hey folks, many thanks for all the details you shared. I got everything except that I can’t play music on multiroom Alexa music groups. Any idea to accomplish this?
Best!
/slackstar
I believe you should have new media.<alexa_group> that you send the feed to. I tend to do that with the media.everywhere entity.