Mam zbudowane powiadomienia głosowe dla bardzo ważnych alarmów tyle że jak na przykład odtwarzam wcześniej radio bardzo cicho to powiadomienia później też są ciche jak ustawić daną głośność i jak zrobić żeby powiadomienie działało w pętli na przykład do czasu wyzwolenia jakiegoś przycisku
A jak są zbudowane te powiadomienia ?
Takie proste powiadomienie z funkcją
[{"id":"57166874c4734dc0","type":"function","z":"e46dc1de25c47772","name":"","func":"msg.payload = \n{\n \"data\":\n {\n \"message\": \"Uwaga, uwaga, Alarm Zalaniowy, odcinam wodę \",\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":160,"wires":[["c91d0822269ffeb7"]]},{"id":"c91d0822269ffeb7","type":"api-call-service","z":"e46dc1de25c47772","name":"Powiadomienie Głosowe","server":"6e70a1f7.0b757","version":5,"debugenabled":false,"domain":"tts","service":"google_say","areaId":[],"deviceId":[],"entityId":["media_player.vlc_telnet"],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"str"}],"queue":"all","x":910,"y":160,"wires":[[]]},{"id":"6e70a1f7.0b757","type":"server","name":"Wojtek - Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":false}]
tyle że chciał bym ustawić daną głośność i może jakieś powtórzenia albo do odwołania przez przyciśnięcie przycisku "pomocnika" albo 3 powiadomienia w odstępach co 10 sekund
@wojtek_gtx na początek przetestuj sobie taki prosty licznik powiadomień
Tak jak na foto, na wstępie trzeba dodać początkową wartość zmiennej "licznik" , stanie się to po jednokrotnym użyciu noda zaznaczonego na zółto. Potem jak zadziała wyzwalacz powinieneś dostać trzy powiadomienia w odstępach ustalonych w nodzie trigger.
Po ostatnim powiadomieniu licznik jest resetowany i bajka zaczyna się od początku.
Ustawienia głośnosci nie będę dodawał, bo jest to zbyt proste, przed nodem "Powiadomienie Głosowe" wystrczy dodać call service z ustawieniem początkowej głośności powiadomień, a za nodem licznik reset dodać call service z ustawieniem głośności jaka była do radia.
[{"id":"59012c6c72216262","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"a6530f05a0b28193","type":"inject","z":"59012c6c72216262","name":"wyzwalacz","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":200,"wires":[["e272256f6b061320"]]},{"id":"e272256f6b061320","type":"change","z":"59012c6c72216262","name":"licznik+1","rules":[{"t":"set","p":"licznik","pt":"flow","to":"$flowContext(\"licznik\") + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":240,"wires":[["dda8748bd71f41a1"]]},{"id":"dc50e587918b4beb","type":"debug","z":"59012c6c72216262","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":940,"y":40,"wires":[]},{"id":"3f65564674f9f9e0","type":"change","z":"59012c6c72216262","name":"licznik reset","rules":[{"t":"set","p":"licznik","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":280,"wires":[[]]},{"id":"7da27195154e7281","type":"inject","z":"59012c6c72216262","name":"Dodaj zmienną licznik","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":600,"y":280,"wires":[["3f65564674f9f9e0"]]},{"id":"e55de8aa8d872df0","type":"debug","z":"59012c6c72216262","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":960,"y":200,"wires":[]},{"id":"dda8748bd71f41a1","type":"function","z":"59012c6c72216262","name":"Ilość powiadomień ","func":"var licznik = flow.get ('licznik');\nif (licznik != 4){\n msg.payload =\n {\n \"data\":\n {\n \"message\": \"Uwaga, uwaga, Alarm Zalaniowy, odcinam wodę \",\n }\n } \n return [msg, null]\n}\nelse {\n return [null, msg]\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":80,"wires":[["dc50e587918b4beb","3e00fa04c9c3e527"],["e55de8aa8d872df0","3f65564674f9f9e0"]]},{"id":"3e00fa04c9c3e527","type":"api-call-service","z":"59012c6c72216262","name":"Powiadomienie Głosowe","server":"","version":5,"debugenabled":false,"domain":"tts","service":"google_say","areaId":[],"deviceId":[],"entityId":["media_player.vlc_telnet"],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"str"}],"queue":"all","x":710,"y":100,"wires":[["01fd91468f633877"]]},{"id":"01fd91468f633877","type":"trigger","z":"59012c6c72216262","name":"10 sek","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":970,"y":100,"wires":[["e272256f6b061320"]]}]
Ostatnia rzecz to automatyzacja ustawienia zmiennej "licznik" przy restarcie NR, może brzmieć mocno skomplikowanie, ale tak naprawdę wystarczy w nodzie zaznaczonym na zółto zaznaczyć malutkie okienko, dzięki któremu zawsze przy restarcie zostanie wyzwolony reset licznika, a co za tym idzie zmienna przyjmie wartość 0. Gdybyś nie skąpił i wstawił swój wyzwalacz, można by to zapewne zrobić w nim, ale jak widać z jakichś powodów boicie się pochwalić całoscią, a oczekujecie pomocy.
Oj tam nie chcą podać - myślałem że tyle wystarczy 😉
Już podaję całość :
[{"id":"d9ffd407dc641d8c","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Ubukacja","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.ubikacja_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":80,"wires":[["b95f8a51d36c2dd2"]]},{"id":"c009a13e8afb073b","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Kotłownia","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.kotlownia_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":140,"wires":[["b95f8a51d36c2dd2"]]},{"id":"c9896cc218c89ed9","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Kuchnia","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.kuchnia_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":200,"wires":[["b95f8a51d36c2dd2"]]},{"id":"72ecc964c0f7f9a9","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Umywalka ","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.umywalka_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":260,"wires":[["b95f8a51d36c2dd2"]]},{"id":"b34d5bde3f862190","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Wanna","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.wanna_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":320,"wires":[["b95f8a51d36c2dd2"]]},{"id":"0da17b0c33e8cce9","type":"server-state-changed","z":"e46dc1de25c47772","name":"Zalaniówka Pralnia","server":"6e70a1f7.0b757","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.pralnia_zalaniowka","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":380,"wires":[["b95f8a51d36c2dd2"]]},{"id":"b95f8a51d36c2dd2","type":"switch","z":"e46dc1de25c47772","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":240,"wires":[["b641d05e4a0901ea","2bdf7f1793c03ef2","57166874c4734dc0"],["6d318e166eaa106b"]]},{"id":"6d318e166eaa106b","type":"api-call-service","z":"e46dc1de25c47772","name":"Zawór zalaniowy ON","server":"6e70a1f7.0b757","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":["8ac1739471b26c0ce0437032bc5e4497"],"entityId":["switch.zawor_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":260,"wires":[[]]},{"id":"2bdf7f1793c03ef2","type":"api-call-service","z":"e46dc1de25c47772","name":"Zawór zalaniowy OFF","server":"6e70a1f7.0b757","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":["8ac1739471b26c0ce0437032bc5e4497"],"entityId":["switch.zawor_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":220,"wires":[[]]},{"id":"b641d05e4a0901ea","type":"function","z":"e46dc1de25c47772","name":"","func":"msg.payload = \n{\n \"data\":\n {\n \"message\": \" !! Wykryto wyciek - ALARM ZALANIOWY !! \",\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":100,"wires":[["06e0bec625276b34"]]},{"id":"06e0bec625276b34","type":"api-call-service","z":"e46dc1de25c47772","name":"Powiadomienie tekstowe","server":"6e70a1f7.0b757","version":5,"debugenabled":false,"domain":"notify","service":"hadebian_bot","areaId":[],"deviceId":[],"entityId":[],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"str"}],"queue":"none","x":610,"y":100,"wires":[[]]},{"id":"57166874c4734dc0","type":"function","z":"e46dc1de25c47772","name":"","func":"msg.payload = \n{\n \"data\":\n {\n \"message\": \"Uwaga, uwaga, Alarm Zalaniowy, odcinam wodę \",\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":160,"wires":[["c91d0822269ffeb7"]]},{"id":"c91d0822269ffeb7","type":"api-call-service","z":"e46dc1de25c47772","name":"Powiadomienie Głosowe","server":"6e70a1f7.0b757","version":5,"debugenabled":false,"domain":"tts","service":"google_say","areaId":[],"deviceId":[],"entityId":["media_player.vlc_telnet"],"data":"{}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"str"}],"queue":"all","x":910,"y":160,"wires":[[]]},{"id":"6e70a1f7.0b757","type":"server","name":"Wojtek - Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":false}]
Działa dziękuję, testowałem na powiadomieniach tekstowych, przychodzą 3 i koniec.
Wrócę do domu, dostosuję to do samego powiadomienia głosowego i powalczę z głośnością.
Znalazłem takie coś {“volume_level”: 0.2} zadziała ?
Znalazłem takie coś {“volume_level”: 0.2} zadziała ?
Byłem bardziej niż pewny, że skoro słuchasz radia, to masz to już opanowane. Nie wyobrażam sobie sensownego korzystania z radia bez ustawień głośności, np wcześnie rano ma być cicho żeby nie pobudzić rodziny, a w sobotę jak otworzę barek z trunkami, to radio ma się włączać tak żeby muza pomagała w rozkołysaniu 🙂
Masz tu przykład