Cześć
Używam węzła powiadomień od Artura i mam pytanie o powiadomienia ze śmieci. Jeżeli ma być wywożony jeden rodzaj odpadu to nie ma problemu, komunikat idzie na głośnik. Natomiast jeżeli są do wywiezienia dwa rodzaje odpadu to idzie komunikat na temat pierwszego znalezionego odpadu w węźle, a ja bym chciał żeby wychwyciło ,że są dwa rodzaje odpadu do wywiezienia i ,żeby podało komunikaty jeden po drugim. Jak to zrobić?
Trudno ci coś pomóc jak nie wiadomo jak wygląda twój flow.
PS @artpc ma rację, nie czytam ale też nieprezyzyjnie poprosiłem o kod procesu.
Oczywiście, proszę.
[{"id":"4a6c325d781bfd53","type":"subflow","name":"powiadomienia","info":"","category":"","in":[{"x":20,"y":400,"wires":[{"id":"142b0693b19b7438"}]}],"out":[],"env":[],"meta":{},"color":"#DDAA99"},{"id":"142b0693b19b7438","type":"switch","z":"4a6c325d781bfd53","name":"Typ wiadomości","property":"wiadomosc.typ","propertyType":"msg","rules":[{"t":"eq","v":"info","vt":"str"},{"t":"eq","v":"warning","vt":"str"},{"t":"eq","v":"alarm","vt":"str"},{"t":"eq","v":"technical","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":160,"y":400,"wires":[["2c4df43aa68190b8"],["183bf3aa0d7af873"],[],["e3f3f4ba2fd88145"]]},{"id":"e3f3f4ba2fd88145","type":"function","z":"4a6c325d781bfd53","name":"wiadomość","func":"msg.payload=\n{\n \"data\":\n {\n \"message\":msg.wiadomosc.tresc,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":620,"wires":[["7378cda6e7e6ed14"]]},{"id":"7378cda6e7e6ed14","type":"api-call-service","z":"4a6c325d781bfd53","name":"Telefon Mariusza","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_telefon_mariusz","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":620,"wires":[[]]},{"id":"183bf3aa0d7af873","type":"api-current-state","z":"4a6c325d781bfd53","name":"stan pioneera","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.pioneer_avr","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":460,"y":400,"wires":[["e2cbd728350841fb"],["f605c2234449a6ca"]]},{"id":"e2cbd728350841fb","type":"api-call-service","z":"4a6c325d781bfd53","name":"wycisz pioneer","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"media_player","service":"volume_mute","areaId":[],"deviceId":[],"entityId":["media_player.pioneer"],"data":"{\"is_volume_muted\":true}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":340,"wires":[["e8fafecf29e9bf5e"]]},{"id":"3cb1b914dc4b366f","type":"function","z":"4a6c325d781bfd53","name":"wiadomość","func":"msg.payload=\n{\n \"data\":\n {\n \"message\":msg.wiadomosc.tresc,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":340,"wires":[["4fd1056832d48139","c1239defcb3fe993"]]},{"id":"4fd1056832d48139","type":"api-call-service","z":"4a6c325d781bfd53","name":"wiadomość głośnik salon","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"tts","service":"cloud_say","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1350,"y":340,"wires":[["c21254e92eefc352"]]},{"id":"50e404b363ee18f7","type":"debug","z":"4a6c325d781bfd53","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"wiadomosc","targetType":"msg","statusVal":"","statusType":"auto","x":1160,"y":680,"wires":[]},{"id":"c21254e92eefc352","type":"stoptimer","z":"4a6c325d781bfd53","duration":"8","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":1560,"y":340,"wires":[["4ced4db80f012a3a"],[]]},{"id":"6ae77382bd310d25","type":"function","z":"4a6c325d781bfd53","name":"wiadomość","func":"msg.payload=\n{\n \"data\":\n {\n \"message\":msg.wiadomosc.tresc,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":400,"wires":[["2d647e2044eaaffc"]]},{"id":"2d647e2044eaaffc","type":"api-call-service","z":"4a6c325d781bfd53","name":"wiadomość głośnik salon","server":"cf49fe14.90676","version":5,"debugenabled":true,"domain":"tts","service":"cloud_say","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1350,"y":400,"wires":[[]]},{"id":"c1239defcb3fe993","type":"api-call-service","z":"4a6c325d781bfd53","name":"Telefon Mariusza","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_telefon_mariusz","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1330,"y":280,"wires":[[]]},{"id":"190b7c4f34fb6244","type":"api-call-service","z":"4a6c325d781bfd53","name":"zgłośnij pioneer","server":"cf49fe14.90676","version":5,"debugenabled":true,"domain":"media_player","service":"volume_mute","areaId":[],"deviceId":[],"entityId":["media_player.pioneer"],"data":"{\"is_volume_muted\":false}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1560,"y":220,"wires":[[]]},{"id":"4ced4db80f012a3a","type":"api-current-state","z":"4a6c325d781bfd53","name":"stan pioneera","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.pioneer_avr","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1560,"y":280,"wires":[["190b7c4f34fb6244"],[]]},{"id":"02379753f8a941b2","type":"api-call-service","z":"4a6c325d781bfd53","name":"głośność głośnika","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"{\"volume_level\":\"0.8\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":340,"wires":[["3cb1b914dc4b366f"]]},{"id":"3b4f1efab8aeed27","type":"api-call-service","z":"4a6c325d781bfd53","name":"głośność głośnika","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"{\"volume_level\":\"0.8\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":400,"wires":[["6ae77382bd310d25"]]},{"id":"f605c2234449a6ca","type":"api-current-state","z":"4a6c325d781bfd53","name":"stan głośnika","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.salon_speaker","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":670,"y":400,"wires":[["3b4f1efab8aeed27"],["3b4f1efab8aeed27"]]},{"id":"e8fafecf29e9bf5e","type":"api-current-state","z":"4a6c325d781bfd53","name":"stan głośnika","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.salon_speaker","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":670,"y":340,"wires":[["02379753f8a941b2"],["02379753f8a941b2"]]},{"id":"2a13f81452b0e8f2","type":"function","z":"4a6c325d781bfd53","name":"wiadomość","func":"msg.payload=\n{\n \"data\":\n {\n \"message\":msg.wiadomosc.tresc,\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":120,"wires":[["7422072f226b7e11"]]},{"id":"7422072f226b7e11","type":"api-call-service","z":"4a6c325d781bfd53","name":"wiadomość głośnik salon","server":"cf49fe14.90676","version":5,"debugenabled":true,"domain":"tts","service":"cloud_say","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":120,"wires":[[]]},{"id":"f86848fc8635b1e6","type":"api-call-service","z":"4a6c325d781bfd53","name":"głośność głośnika","server":"cf49fe14.90676","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.salon_speaker"],"data":"{\"volume_level\":\"0.8\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":610,"y":120,"wires":[["2a13f81452b0e8f2"]]},{"id":"2c4df43aa68190b8","type":"api-current-state","z":"4a6c325d781bfd53","name":"stan głośnika","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.salon_speaker","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":120,"wires":[["f86848fc8635b1e6"],["f86848fc8635b1e6"]]},{"id":"0e548553ea488437","type":"tab","label":"kalendarze","disabled":false,"info":"","env":[]},{"id":"a83b8ad6f227ba53","type":"inject","z":"0e548553ea488437","name":"co 5 min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":760,"wires":[["dc364bf0481788f9","04c271a47746c590","ac0fd312292f4962","1996c659cc3f0e64","f9d505c9698c21ad","be79ff08e2203548"]]},{"id":"f9d505c9698c21ad","type":"api-current-state","z":"0e548553ea488437","name":"odpady bio","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"1","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.bio","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":600,"wires":[["7f9ba3e4fcfcfeb2"],[]]},{"id":"1996c659cc3f0e64","type":"api-current-state","z":"0e548553ea488437","name":"odpady zmieszane","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"1","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.zmieszane","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":680,"wires":[["24ee74ea03402858"],[]]},{"id":"dc364bf0481788f9","type":"api-current-state","z":"0e548553ea488437","name":"odpady szkło","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"1","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.szklo","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":760,"wires":[["0839a3c1d946d59f"],[]]},{"id":"04c271a47746c590","type":"api-current-state","z":"0e548553ea488437","name":"odpady plastik","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"1","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.plastik","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":840,"wires":[["c6868a8d1a9a58ed"],[]]},{"id":"ac0fd312292f4962","type":"api-current-state","z":"0e548553ea488437","name":"odpady papier","server":"cf49fe14.90676","version":3,"outputs":2,"halt_if":"1","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.papier","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":920,"wires":[["4bfb7a0866bd25df"],[]]},{"id":"7f9ba3e4fcfcfeb2","type":"change","z":"0e548553ea488437","name":"jakie śmieci","rules":[{"t":"set","p":"smieci","pt":"msg","to":"odpady bio","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":600,"wires":[["0694ccb975010c2a"]]},{"id":"24ee74ea03402858","type":"change","z":"0e548553ea488437","name":"jakie śmieci","rules":[{"t":"set","p":"smieci","pt":"msg","to":"odpady zmieszane","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":680,"wires":[["0694ccb975010c2a"]]},{"id":"0839a3c1d946d59f","type":"change","z":"0e548553ea488437","name":"jakie śmieci","rules":[{"t":"set","p":"smieci","pt":"msg","to":"odpady szkło","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":760,"wires":[["0694ccb975010c2a"]]},{"id":"c6868a8d1a9a58ed","type":"change","z":"0e548553ea488437","name":"jakie śmieci","rules":[{"t":"set","p":"smieci","pt":"msg","to":"odpady plastik","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":840,"wires":[["0694ccb975010c2a"]]},{"id":"4bfb7a0866bd25df","type":"change","z":"0e548553ea488437","name":"jakie śmieci","rules":[{"t":"set","p":"smieci","pt":"msg","to":"odpady papier","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":920,"wires":[["0694ccb975010c2a"]]},{"id":"0694ccb975010c2a","type":"delay","z":"0e548553ea488437","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":940,"y":760,"wires":[["de7c8f9380b9ffe8"]]},{"id":"de7c8f9380b9ffe8","type":"time-range-switch","z":"0e548553ea488437","name":"","lat":"","lon":"","startTime":"19:00","endTime":"21:00","startOffset":0,"endOffset":0,"x":1130,"y":760,"wires":[["d2a0a22e3d2bf184"],[]]},{"id":"d2a0a22e3d2bf184","type":"function","z":"0e548553ea488437","name":"śmieci","func":"msg.wiadomosc=\n{\n \"temat\":\"śmieci\",\n \"tresc\":\"Jutro zabierają \"+msg.smieci+\". To ostatnia chwila aby wystawić kubeł.\",\n \"typ\":\"info\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1370,"y":760,"wires":[["8b9ecb578806ab1f"]]},{"id":"8b9ecb578806ab1f","type":"subflow:4a6c325d781bfd53","z":"0e548553ea488437","name":"powiadomienia","x":1560,"y":760,"wires":[]},{"id":"be79ff08e2203548","type":"api-current-state","z":"0e548553ea488437","name":"kalendarz familijny","server":"cf49fe14.90676","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"calendar.familijne","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":100,"wires":[["c0f127e950d62992"]]},{"id":"c0f127e950d62992","type":"function","z":"0e548553ea488437","name":"Ile minut do wydarzenia","func":"var czas_wydarzenia = new Date(msg.data.attributes.start_time);\nvar czas_aktualny = new Date();\nmsg.czas_do_wydarzenia = czas_wydarzenia - czas_aktualny;\nmsg.czas_do_wydarzenia = msg.czas_do_wydarzenia / 1000; //zamiana na sekundy\nmsg.czas_do_wydarzenia = msg.czas_do_wydarzenia / 60; //zamiana na minuty\nmsg.czas_do_wydarzenia = Math.round(msg.czas_do_wydarzenia);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":100,"wires":[["af0f04d233392887"]]},{"id":"3bc112bbb99c39fc","type":"switch","z":"0e548553ea488437","name":"Czy poniżej 15 minut","property":"czas_do_wydarzenia","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"120","v2t":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":1080,"y":100,"wires":[["95c7f036db201b66"],["1987de433f14a818"]]},{"id":"95c7f036db201b66","type":"function","z":"0e548553ea488437","name":"Zadania","func":"msg.wiadomosc =\n{\n \"temat\":\"kalendarz rodzinny\",\n \"tresc\":\"Za \"+msg.czas_do_wydarzenia+\" minut rozpocznie się wydarzenie \"+msg.data.attributes.message,\n \"typ\":\"info\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1380,"y":80,"wires":[["89a35cb4549d0693"]]},{"id":"1987de433f14a818","type":"function","z":"0e548553ea488437","name":"Zadanie","func":"msg.wiadomosc =\n{\n \"temat\":\"kalendarz rodzinny\",\n \"tresc\":\"Właśnie rozpoczyna się wydarzenie \"+msg.data.attributes.message,\n \"typ\":\"info\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1380,"y":120,"wires":[["8d5f6cc351986eba"]]},{"id":"89a35cb4549d0693","type":"subflow:4a6c325d781bfd53","z":"0e548553ea488437","name":"","x":1600,"y":80,"wires":[]},{"id":"8d5f6cc351986eba","type":"subflow:4a6c325d781bfd53","z":"0e548553ea488437","name":"","x":1600,"y":120,"wires":[]},{"id":"af0f04d233392887","type":"delay","z":"0e548553ea488437","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":880,"y":100,"wires":[["3bc112bbb99c39fc"]]},{"id":"cf49fe14.90676","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Nie masz czasem dropa w delay node
?
No jest, a jak to działa?
1msg/15 min 1 msg. i drop czyli kolejne odrzuca przez 15 min daj kolejkę msg.
Hej
Dzięki ,ale to działa ale w ten sposób, że ustawia następne powiadomienie w kolejce , a następny komunikat poleci za 15 min, czyli będą komunikaty leciały ma zmianę co 15 min ,a ja chcę od razu jeden po drugim. Wydaje mi się że udało mi się rozwiązać ten problem, jak potrzeba to podeślę kod.