Ostatnio zrobiłem bardzo dużo automatyzacji i teraz sobie pomyślałem że jeszcze prościej to można zrobić, a w zasadzie juz prościej i lepiej sie nie da nodem wait until, radio gra natychmiast po komunikacie
[{"id":"5798032a.fc88ac","type":"tab","label":"test","disabled":false,"info":""},{"id":"1d8d0d37.9b9403","type":"api-call-service","z":"5798032a.fc88ac","name":"Ustawienie głośności","server":"","version":1,"debugenabled":true,"service_domain":"media_player","service":"volume_set","entityId":"media_player.biuro","data":"{\"volume_level\":\"0.5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":330,"y":510,"wires":[["4f7d7e7a.e97f6"]]},{"id":"34f1138c.fdf04c","type":"delay","z":"5798032a.fc88ac","name":"100 milisekund","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":140,"y":510,"wires":[["1d8d0d37.9b9403"]]},{"id":"3c9b8a2c.9264b6","type":"api-call-service","z":"5798032a.fc88ac","name":"Głośnik STOP","server":"","version":1,"debugenabled":true,"service_domain":"media_player","service":"media_stop","entityId":"media_player.biuro","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":370,"wires":[["34f1138c.fdf04c"]]},{"id":"9c317b29.1b9be8","type":"change","z":"5798032a.fc88ac","name":"Zapisuję na boku 3","rules":[{"t":"set","p":"glosnosc","pt":"flow","to":"data.attributes.volume_level","tot":"msg"},{"t":"set","p":"playing","pt":"flow","to":"music","tot":"str"},{"t":"set","p":"stacja","pt":"flow","to":"data.attributes.media_content_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":370,"wires":[["3c9b8a2c.9264b6"]]},{"id":"c59974ca.a211f8","type":"change","z":"5798032a.fc88ac","name":"Zapisuję na boku 1","rules":[{"t":"set","p":"glosnosc","pt":"flow","to":"data.attributes.volume_level","tot":"msg"},{"t":"set","p":"playing","pt":"flow","to":"off","tot":"str"},{"t":"set","p":"stacja","pt":"flow","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":330,"wires":[["3c9b8a2c.9264b6"]]},{"id":"e51a7f79.7f9e7","type":"switch","z":"5798032a.fc88ac","name":"Gra?","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"playing","vt":"str"},{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":640,"y":370,"wires":[["c59974ca.a211f8"],["9c317b29.1b9be8"]]},{"id":"a93c2f13.d52d8","type":"api-current-state","z":"5798032a.fc88ac","name":"Pobieram dane głośnika","server":"","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.biuro","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":370,"wires":[["e51a7f79.7f9e7"]]},{"id":"aa420fcd.1eb12","type":"api-call-service","z":"5798032a.fc88ac","name":"Ustawiam głośność","server":"","version":1,"debugenabled":true,"service_domain":"media_player","service":"volume_set","entityId":"media_player.biuro","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1090,"y":660,"wires":[[]]},{"id":"bff67f79.50c5e","type":"function","z":"5798032a.fc88ac","name":"Ustawiam zapisaną głosność","func":"var glosnosc = flow.get(\"glosnosc\");\nmsg.payload =\n{\n \"data\":\n {\n \"volume_level\":glosnosc,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":660,"wires":[["aa420fcd.1eb12"]]},{"id":"17770206.6f797e","type":"function","z":"5798032a.fc88ac","name":"Ustawiam zapisaną stację","func":"var stacja = flow.get(\"stacja\");\nvar playing = flow.get(\"playing\");\nmsg.payload =\n{\n \"data\":\n {\n \"media_content_id\":stacja,\n \"media_content_type\":playing,\n }\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":850,"y":620,"wires":[["1488e178.ff079f"]]},{"id":"1488e178.ff079f","type":"api-call-service","z":"5798032a.fc88ac","name":"Ustawiam stację","server":"","version":1,"debugenabled":true,"service_domain":"media_player","service":"play_media","entityId":"media_player.biuro","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1060,"y":620,"wires":[[]]},{"id":"bd37ef7d.d2e4","type":"api-call-service","z":"5798032a.fc88ac","name":"Głosnik Łazienka","server":"","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.biuro","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":820,"y":510,"wires":[["4f128c65.e10e64"]]},{"id":"553bdff9.b3ce3","type":"switch","z":"5798032a.fc88ac","name":"Grało?","property":"playing","propertyType":"flow","rules":[{"t":"eq","v":"music","vt":"str"},{"t":"neq","v":"music","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":620,"wires":[["bff67f79.50c5e","17770206.6f797e"],["bff67f79.50c5e"]]},{"id":"4f128c65.e10e64","type":"delay","z":"5798032a.fc88ac","name":"2 sekundy","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":990,"y":510,"wires":[["47e89a0f.6c9d34"]]},{"id":"4f7d7e7a.e97f6","type":"function","z":"5798032a.fc88ac","name":"msg.payload= msg.komunikat","func":"msg.payload= msg.komunikat\n \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":510,"wires":[["bd37ef7d.d2e4"]]},{"id":"9a70bd34.a42d5","type":"change","z":"5798032a.fc88ac","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":370,"wires":[["a93c2f13.d52d8"]]},{"id":"851734a0.b02358","type":"delay","z":"5798032a.fc88ac","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":240,"y":330,"wires":[["9a70bd34.a42d5"]]},{"id":"5744d43e.abd5ac","type":"function","z":"5798032a.fc88ac","name":"KOMUNIKAT","func":"msg.komunikat=\n{\n \"data\":\n {\n \"message\": \" To jest wiadomość testowa!\",\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":100,"wires":[["851734a0.b02358"]]},{"id":"670dd82c.4d1998","type":"inject","z":"5798032a.fc88ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":90,"wires":[["5744d43e.abd5ac"]]},{"id":"47e89a0f.6c9d34","type":"ha-wait-until","z":"5798032a.fc88ac","name":"","server":"","outputs":1,"entityId":"media_player.lazienka","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":0,"timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1150,"y":510,"wires":[["553bdff9.b3ce3"]]}]