Simon says counting up for testing Alexa

@franz
My flow for counting up "Alexa, Simon says one" etc looks like this

Uses queue-gate, TTS-ultimate, simpletime, counter and play audio contrib nodes

[{"id":"42652991.2d0e78","type":"subflow","name":"+ hh:mm:ss","info":"","category":"","in":[{"x":40,"y":60,"wires":[{"id":"68633fa6.25f2e"}]}],"out":[{"x":380,"y":60,"wires":[{"id":"68633fa6.25f2e","port":0}]}],"env":[],"meta":{},"color":"#C7E9C0","icon":"node-red-contrib-sun-position/clock-white.png","status":{"x":380,"y":120,"wires":[{"id":"421b10be.1db69","port":0},{"id":"68633fa6.25f2e","port":0}]}},{"id":"68633fa6.25f2e","type":"simpletime","z":"42652991.2d0e78","name":"","mydate":false,"myymd":true,"myyear":false,"mymonth":false,"mymonthn":false,"mydom":false,"mydoy":false,"myday":false,"myhourpm":false,"myhour":false,"mytime":false,"mytimes":true,"myminute":false,"myminutes":false,"mysecond":false,"mymillis":false,"myepoch":false,"myrawdate":false,"mypm":false,"x":115,"y":60,"wires":[["a8b5a4ba.c0c178"]],"l":false},{"id":"421b10be.1db69","type":"change","z":"42652991.2d0e78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"mytimes","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":180,"wires":[[]]},{"id":"a8b5a4ba.c0c178","type":"delay","z":"42652991.2d0e78","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":120,"y":180,"wires":[["421b10be.1db69"]]},{"id":"d3388b61edee7b3c","type":"play audio","z":"d7c2e97da54dae65","name":"","voice":"","x":760,"y":1190,"wires":[]},{"id":"19fd58b3872941c7","type":"ttsultimate","z":"d7c2e97da54dae65","name":"","voice":"en-GB","ssml":false,"sonosipaddress":"","sonosvolume":"20","sonoshailing":"0","config":"abf536dfafd7b1dd","property":"payload","propertyType":{},"rules":[],"playertype":"noplayer","speakingrate":"1","speakingpitch":"0","unmuteIfMuted":true,"x":315,"y":1190,"wires":[["3c7903560f04fbf5"],[]],"l":false},{"id":"e25ec1ce0c04bcd7","type":"file in","z":"d7c2e97da54dae65","name":"","filename":"filename","filenameType":"msg","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":550,"y":1190,"wires":[["d3388b61edee7b3c","3b5e8a3c1015dbe6"]]},{"id":"258bce803c6519b5","type":"change","z":"d7c2e97da54dae65","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"filesArray[0]file","tot":"msg"},{"t":"set","p":"speech","pt":"msg","to":"filename","tot":"msg","dc":true},{"t":"change","p":"speech","pt":"msg","from":"/home/pi/.node-red/sonospollyttsstorage/ttsfiles/","fromt":"str","to":"","tot":"str"},{"t":"change","p":"speech","pt":"msg","from":"_en-GB01.mp3","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":435,"y":1190,"wires":[["e25ec1ce0c04bcd7"]],"l":false},{"id":"3c7903560f04fbf5","type":"switch","z":"d7c2e97da54dae65","name":"payload is true","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":375,"y":1190,"wires":[["258bce803c6519b5"]],"l":false},{"id":"2ea09c523dcce898","type":"inject","z":"d7c2e97da54dae65","name":"15 secs trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":1110,"wires":[["e3e63fb259c9df66"]]},{"id":"98f23668c64da557","type":"subflow:42652991.2d0e78","z":"d7c2e97da54dae65","name":"","x":415,"y":1110,"wires":[["dce125e6fdd56c0a"]],"l":false},{"id":"dce125e6fdd56c0a","type":"change","z":"d7c2e97da54dae65","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"mytimes","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":465,"y":1110,"wires":[["30cfbf373ca8ab19"]],"l":false},{"id":"c03482b941e3d14a","type":"template","z":"d7c2e97da54dae65","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Alexa, simon says {{count}}","output":"str","x":565,"y":1110,"wires":[["19fd58b3872941c7"]],"l":false},{"id":"30cfbf373ca8ab19","type":"counter","z":"d7c2e97da54dae65","name":"","init":"0","step":"1","lower":null,"upper":null,"mode":"increment","outputs":"1","x":515,"y":1110,"wires":[["c03482b941e3d14a"]],"l":false},{"id":"cf71a191d7271f16","type":"inject","z":"d7c2e97da54dae65","name":"reset count","props":[{"p":"reset","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":420,"y":1040,"wires":[["30cfbf373ca8ab19"]]},{"id":"513642c8af3bef00","type":"inject","z":"d7c2e97da54dae65","name":"Open","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":190,"y":1020,"wires":[["d46c7b744c39367c"]]},{"id":"e3e63fb259c9df66","type":"q-gate","z":"d7c2e97da54dae65","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"0","keepNewest":false,"qToggle":true,"persist":true,"storeName":"memory","x":365,"y":1110,"wires":[["98f23668c64da557"]],"l":false},{"id":"afe2614b65a51920","type":"inject","z":"d7c2e97da54dae65","name":"Close","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":180,"y":1060,"wires":[["d46c7b744c39367c"]]},{"id":"d46c7b744c39367c","type":"junction","z":"d7c2e97da54dae65","x":330,"y":1060,"wires":[["e3e63fb259c9df66"]]},{"id":"abf536dfafd7b1dd","type":"ttsultimate-config","name":"TTS Service","noderedipaddress":"127.0.0.1","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletranslate","limitTTSFilenameLenght":"220"}]
1 Like