├── .gitignore
├── 3Dprint
└── TobyJnrHead.stl
├── LICENSE
├── README.md
├── conversation
└── TobyJnr_conversation_workspace.json
└── flows
├── Test.flow
└── TobyJnr.flow
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .vscode
3 |
--------------------------------------------------------------------------------
/3Dprint/TobyJnrHead.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binnes/tobyjnr/e87cf75b76e94732edac83caeaad44d5f1a2f151/3Dprint/TobyJnrHead.stl
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # tobyjnr
2 |
3 | Resources for the TobyJnr bot based on TJBot
4 |
5 | Documentation and instructions for TobyJnr can be found on [the wiki](https://github.com/binnes/tobyjnr/wiki)
6 |
--------------------------------------------------------------------------------
/conversation/TobyJnr_conversation_workspace.json:
--------------------------------------------------------------------------------
1 | {"name":"TobyJnr","intents":[{"intent":"information","examples":[{"text":"I need information about"},{"text":"What is the weather like"},{"text":"What is the current temperature"},{"text":"What's it like outside"},{"text":"Can you tell me the temperature"},{"text":"I need to know the temperature"},{"text":"What is the temperature"},{"text":"What is a"}],"description":null},{"intent":"changeColour","examples":[{"text":"Change the colour"},{"text":"Please change the colour"},{"text":"make the colour"},{"text":"set the colour"},{"text":"I want the colour to be"},{"text":"turn the light"}],"description":null},{"intent":"bye","examples":[{"text":"good bye"},{"text":"see you later"},{"text":"googbye"},{"text":"bye"},{"text":"laters"},{"text":"later"}],"description":null},{"intent":"greeting","examples":[{"text":"good morning"},{"text":"good afternoon"},{"text":"good evening"},{"text":"hello"},{"text":"hi"},{"text":"Hey"}],"description":null}],"entities":[{"entity":"weather","values":[{"type":"synonyms","value":"weather","metadata":null,"synonyms":["windy","raining","sunny","weather","outside"]}],"metadata":null,"description":null},{"entity":"Degrees","values":[{"type":"synonyms","value":"Fahrenheit","metadata":null,"synonyms":["farenheit","degrees in f","degrees F","in F"]},{"type":"synonyms","value":"Centigrade","metadata":null,"synonyms":["celsius","degrees in c","centigrade","degrees C","in C"]}],"metadata":null,"description":null},{"entity":"Temperature","values":[{"type":"synonyms","value":"Temperature","metadata":null,"synonyms":["current temp","current temperature","temp","temperature","inside"]}],"metadata":null,"description":null},{"entity":"Colours","values":[{"type":"synonyms","value":"Yellow","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Pink","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Black","metadata":null,"synonyms":["off"]},{"type":"synonyms","value":"Red","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Blue","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Purple","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Green","metadata":null,"synonyms":[]},{"type":"synonyms","value":"Orange","metadata":null,"synonyms":[]}],"metadata":null,"description":null}],"language":"en","metadata":{"api_version":{"major_version":"v1","minor_version":"2017-05-26"}},"description":"Chat service to drive TobyJnr bot","dialog_nodes":[{"type":"response_condition","title":null,"output":{"text":{"values":["Hey, how can I help you today","Hello, what can I help you with today","Hi, can I help you with something"],"selection_policy":"random"}},"parent":"node_1_1499711908118","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"node_2_1499711969008","previous_sibling":null},{"type":"response_condition","title":null,"output":{"text":{"values":["is there anything I can help you with?"],"selection_policy":"sequential"}},"parent":"What else","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"node_10_1499712705272","previous_sibling":null},{"type":"response_condition","title":null,"output":{"text":{"action":"CurrentTempCentigrade","values":["The current temperature in Celsius is"],"selection_policy":"sequential"},"action":"CurrentTempCentigrade"},"parent":"Temperature","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"node_1_1528097940246","previous_sibling":"node_14_1499713028462"},{"type":"response_condition","title":null,"output":{"text":{"values":["The current temperature in fahrenheit is"],"selection_policy":"sequential"},"action":"CurrentTempFahrenheit"},"parent":"Temperature","context":null,"metadata":null,"next_step":null,"conditions":" @Degrees:Fahrenheit","description":null,"dialog_node":"node_14_1499713028462","previous_sibling":"node_13_1499712998204"},{"type":"response_condition","title":null,"output":{"text":{"values":["The current temperature in celsius is"],"selection_policy":"sequential"},"action":"CurrentTempCentigrade"},"parent":"Temperature","context":null,"metadata":{},"next_step":null,"conditions":" @Degrees:Centigrade","description":null,"dialog_node":"node_13_1499712998204","previous_sibling":null},{"type":"response_condition","title":null,"output":{"text":{"values":["Great to talk, come back soon","Good talking with you today, bye for now","Thanks for talking, see you soon"],"selection_policy":"random"},"action":"quit"},"parent":"node_3_1499712027993","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"node_4_1499712039483","previous_sibling":null},{"type":"response_condition","title":null,"output":{"text":{"values":["I don't know that colour, please try again"],"selection_policy":"sequential"}},"parent":"node_5_1499712101853","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"node_7_1499712207837","previous_sibling":"node_6_1499712116234"},{"type":"response_condition","title":null,"output":{"text":{"values":["I just changed the colour to entities.Colours.literal ?>"],"selection_policy":"sequential"},"action":"changeColour"},"parent":"node_5_1499712101853","context":null,"metadata":null,"next_step":null,"conditions":"@Colours","description":null,"dialog_node":"node_6_1499712116234","previous_sibling":null},{"type":"standard","title":"Weather","output":{"text":{"values":["The current weather is"],"selection_policy":"sequential"},"action":"CurrentWeather"},"parent":"Information","context":null,"metadata":null,"next_step":{"behavior":"jump_to","selector":"body","dialog_node":"What else"},"conditions":"@weather:weather","description":null,"dialog_node":"Weather","previous_sibling":"Temperature"},{"type":"standard","title":"Unknown","output":{"text":{"values":["Sorry I don't know what you are looking for. Please try again","Sorry, I don't understand, please try again"],"selection_policy":"random"}},"parent":"Information","context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"Unknown","previous_sibling":"Weather"},{"type":"standard","title":"Temperature","output":{},"parent":"Information","context":null,"metadata":null,"next_step":{"behavior":"jump_to","selector":"body","dialog_node":"What else"},"conditions":"@Temperature:Temperature","description":null,"dialog_node":"Temperature","previous_sibling":null},{"type":"standard","title":null,"output":{},"parent":null,"context":null,"metadata":null,"next_step":null,"conditions":"#bye","description":null,"dialog_node":"node_3_1499712027993","previous_sibling":"node_1_1499711908118"},{"type":"standard","title":"Anything else","output":{"text":{"values":["I didn't understand. You can try rephrasing.","Can you reword your statement? I'm not understanding.","I didn't get your meaning."],"selection_policy":"sequential"}},"parent":null,"context":null,"metadata":null,"next_step":null,"conditions":"anything_else","description":null,"dialog_node":"Anything else","previous_sibling":"What else"},{"type":"standard","title":"Information","output":{},"parent":null,"context":null,"metadata":null,"next_step":{"behavior":"jump_to","selector":"condition","dialog_node":"Temperature"},"conditions":"#information","description":null,"dialog_node":"Information","previous_sibling":"node_3_1499712027993"},{"type":"standard","title":"What else","output":{},"parent":null,"context":null,"metadata":{},"next_step":null,"conditions":"true","description":null,"dialog_node":"What else","previous_sibling":"node_5_1499712101853"},{"type":"standard","title":null,"output":{},"parent":null,"context":null,"metadata":null,"next_step":null,"conditions":"#greeting","description":null,"dialog_node":"node_1_1499711908118","previous_sibling":"Welcome"},{"type":"standard","title":null,"output":{},"parent":null,"context":null,"metadata":null,"next_step":{"behavior":"jump_to","selector":"body","dialog_node":"What else"},"conditions":"#changeColour","description":null,"dialog_node":"node_5_1499712101853","previous_sibling":"Information"},{"type":"standard","title":"Welcome","output":{"text":{"values":["Hello. How can I help you?"],"selection_policy":"sequential"}},"parent":null,"context":null,"metadata":{},"next_step":null,"conditions":"welcome","description":null,"dialog_node":"Welcome","previous_sibling":null}],"workspace_id":"7b70d9c9-a84d-489d-bc01-421333d4cc71","counterexamples":[],"system_settings":null,"learning_opt_out":false}
--------------------------------------------------------------------------------
/flows/Test.flow:
--------------------------------------------------------------------------------
1 | [{"id":"8112e224.81c9c8","type":"tab","label":"Test TobyJnr","disabled":false,"info":""},{"id":"84d4c603.049e7","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":100,"wires":[["320db274.6b7d4e"]]},{"id":"b70e9b37.4a2668","type":"speakerpi-output","z":"8112e224.81c9c8","choose":"filebased","filename":"/usr/lib/libreoffice/share/gallery/sounds/cow.wav","channels":"1","bitdepth":"16","samplerate":"11025","name":"Bluetooth headset/speaker","x":880,"y":160,"wires":[]},{"id":"320db274.6b7d4e","type":"file in","z":"8112e224.81c9c8","name":"","filename":"/usr/lib/libreoffice/share/gallery/sounds/cow.wav","format":"","x":360,"y":100,"wires":[["808b81ca.42f0b"]]},{"id":"808b81ca.42f0b","type":"change","z":"8112e224.81c9c8","name":"","rules":[{"t":"set","p":"speech","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"filename","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":160,"wires":[["b70e9b37.4a2668","b2ead0eb.a03ad8"]]},{"id":"a3e026fc.3ea7f8","type":"rpi-neopixels","z":"8112e224.81c9c8","name":"RGB LED","pixels":"1","bgnd":"","fgnd":"","wipe":"40","mode":"pcent","rgb":"rgb","x":740,"y":320,"wires":[]},{"id":"182caeb6.5eb9e9","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"red","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":240,"wires":[["a3e026fc.3ea7f8"]]},{"id":"1f09e0f1.8b783f","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"green","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":280,"wires":[["a3e026fc.3ea7f8"]]},{"id":"6b3f4f33.5e102","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"blue","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":320,"wires":[["a3e026fc.3ea7f8"]]},{"id":"c2791da3.79bba","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"black","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":360,"wires":[["a3e026fc.3ea7f8"]]},{"id":"1a02f5a2.6bc21a","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"white","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":400,"wires":[["a3e026fc.3ea7f8"]]},{"id":"5a8ca1e.06295e","type":"inject","z":"8112e224.81c9c8","name":"back","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":110,"y":480,"wires":[["55ff85bd.fd2f3c"]]},{"id":"f8080d64.05b1e","type":"inject","z":"8112e224.81c9c8","name":"up","topic":"","payload":"50","payloadType":"num","repeat":"","crontab":"","once":false,"x":110,"y":520,"wires":[["55ff85bd.fd2f3c"]]},{"id":"1f10fa9.c797605","type":"inject","z":"8112e224.81c9c8","name":"forward","topic":"","payload":"95","payloadType":"num","repeat":"","crontab":"","once":false,"x":110,"y":560,"wires":[["55ff85bd.fd2f3c"]]},{"id":"53d2b859.5a8ea","type":"rpi-sensehat out","z":"8112e224.81c9c8","name":"","x":750,"y":660,"wires":[]},{"id":"9a6dd5d6.38c7f","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"Hello","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":620,"wires":[["53d2b859.5a8ea"]]},{"id":"e899a913.444c38","type":"rpi-sensehat in","z":"8112e224.81c9c8","name":"","motion":false,"env":true,"stick":true,"x":100,"y":740,"wires":[["2e048478.34b0d4"]]},{"id":"2e048478.34b0d4","type":"debug","z":"8112e224.81c9c8","name":"","active":false,"console":"false","complete":"true","x":730,"y":740,"wires":[]},{"id":"c3b0c34d.ceb0d8","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"*,*,red","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":660,"wires":[["53d2b859.5a8ea"]]},{"id":"e0c2145b.5d9d38","type":"inject","z":"8112e224.81c9c8","name":"","topic":"","payload":"*,*,blue","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":700,"wires":[["53d2b859.5a8ea"]]},{"id":"55ff85bd.fd2f3c","type":"pi-gpiod out","z":"8112e224.81c9c8","name":"","host":"localhost","port":8888,"pin":"7","set":"","level":"0","out":"ser","sermin":"600","sermax":"2400","x":740,"y":520,"wires":[]},{"id":"44bfc31c.e1f544","type":"camerapi-takephoto","z":"8112e224.81c9c8","filemode":"2","filename":"test.png","filedefpath":"1","filepath":"/home/pi","fileformat":"png","resolution":"2","rotation":"180","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","imageeffect":"none","name":"","x":430,"y":820,"wires":[["67afa33d.3d88cc"]]},{"id":"67607230.e4e144","type":"inject","z":"8112e224.81c9c8","name":"Take pic","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":100,"y":820,"wires":[["44bfc31c.e1f544"]]},{"id":"67afa33d.3d88cc","type":"debug","z":"8112e224.81c9c8","name":"","active":false,"console":"false","complete":"true","x":730,"y":820,"wires":[]},{"id":"b2ead0eb.a03ad8","type":"debug","z":"8112e224.81c9c8","name":"","active":false,"console":"false","complete":"true","x":810,"y":120,"wires":[]},{"id":"5589150e.cd530c","type":"inject","z":"8112e224.81c9c8","name":"record","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":110,"y":140,"wires":[["f9bba2c3.ec92a"]]},{"id":"bc0aeaeb.26ea78","type":"inject","z":"8112e224.81c9c8","name":"stop","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"x":110,"y":180,"wires":[["f9bba2c3.ec92a"]]},{"id":"f9bba2c3.ec92a","type":"microPi","z":"8112e224.81c9c8","name":"microPi","filename":"/home/pi/audio/mic.wav","domain":"http://localhost:1880/getAudio","rate":"11025","bitwidth":"16","endian":"little","encoding":"signed-integer","channels":"1","silence":"5","debug":"false","mode":"","x":300,"y":160,"wires":[[],["808b81ca.42f0b"],[]]}]
2 |
--------------------------------------------------------------------------------
/flows/TobyJnr.flow:
--------------------------------------------------------------------------------
1 | [{"id":"97685053.566a9","type":"tab","label":"TobyJnr","disabled":false,"info":""},{"id":"1a93ffcb.f3c03","type":"switch","z":"97685053.566a9","name":"Click","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"error","vt":"str","case":true},{"t":"else"}],"checkall":"true","outputs":2,"x":670,"y":600,"wires":[[],["89ec308d.4ea5a8","79a24b29.6fffb4"]]},{"id":"ea3f22.d5c058e","type":"link out","z":"97685053.566a9","name":"","links":["7f1f35c6.9ab4c4","7aeab724.2f52"],"x":995,"y":940,"wires":[]},{"id":"f94eb368.8d915","type":"comment","z":"97685053.566a9","name":"Did the text include a color?","info":"This flow requires the \nnode-red-node-pi-neopixel \nnpm package.","x":1140,"y":940,"wires":[]},{"id":"89ec308d.4ea5a8","type":"file","z":"97685053.566a9","name":"Save photo.jpg","filename":"/tmp/photo.jpg","appendNewline":false,"createDir":false,"overwriteFile":"true","x":840,"y":620,"wires":[]},{"id":"d582ac5b.deac88","type":"ui_template","z":"97685053.566a9","group":"30d44502.554382","name":"Photo","order":2,"width":"12","height":"9","format":"
\n
","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":1170,"y":660,"wires":[[]]},{"id":"e26460d5.379698","type":"comment","z":"97685053.566a9","name":"Remember to keep the .jpg < 2MB","info":"","x":480,"y":680,"wires":[]},{"id":"3781a07e.ef2e28","type":"comment","z":"97685053.566a9","name":"Reload picture into Node-RED Dashboard","info":"","x":1140,"y":700,"wires":[]},{"id":"fa5fd586.a414c8","type":"camerapi-takephoto","z":"97685053.566a9","filemode":"0","filename":"","filedefpath":"1","filepath":"","fileformat":"jpeg","resolution":"2","rotation":"180","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","imageeffect":"none","name":"Take Pi Camera Photo","x":480,"y":600,"wires":[["1a93ffcb.f3c03","602266ff.4b881"]]},{"id":"da944c2c.92ec7","type":"inject","z":"97685053.566a9","name":"Test TJBot RaspPi Photo","topic":"","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"x":270,"y":340,"wires":[["314eaeae.e810d2"]]},{"id":"3cba01ad.418166","type":"ui_button","z":"97685053.566a9","name":"","group":"30d44502.554382","order":1,"width":"0","height":"0","passthru":false,"label":"Take a TJBot Raspberry Pi Camera Photo","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":220,"y":300,"wires":[["314eaeae.e810d2"]]},{"id":"8b027633.9cac68","type":"comment","z":"97685053.566a9","name":"Find and summarise People","info":"Can be triggered from the Dashboard button or pushing the SenseHAT joystick left","x":140,"y":780,"wires":[]},{"id":"edd3dc00.e7b8c8","type":"comment","z":"97685053.566a9","name":"Image Classification","info":"Can be triggered from the Dashboard button or pushing the SenseHAT joystick right","x":110,"y":880,"wires":[]},{"id":"79a24b29.6fffb4","type":"base64","z":"97685053.566a9","name":"Encode","x":820,"y":660,"wires":[["5b063170.35c2d"]]},{"id":"8b52e6a7.aa81c8","type":"debug","z":"97685053.566a9","name":"What did Watson find?","active":true,"console":"false","complete":"template","x":1080,"y":900,"wires":[]},{"id":"b6a68a08.0e5b78","type":"ui_template","z":"97685053.566a9","group":"fa798db3.ee78e8","name":"","order":5,"width":"10","height":"12","format":"","storeOutMessages":true,"fwdInMessages":true,"x":1040,"y":860,"wires":[[]]},{"id":"c04b0f84.1a86f","type":"visual-recognition-v3","z":"97685053.566a9","name":"","apikey":"__PWRD__","image-feature":"detectFaces","lang":"en","x":650,"y":880,"wires":[["723e8c59.3efb24"]]},{"id":"4ef2ac4.05a99d4","type":"function","z":"97685053.566a9","name":"Process Results","func":"if (typeof msg.result == 'undefined') {\n return null;\n}\n\nvar bestcolor = -1;\nvar colorscore = 0;\nvar c_id = 0;\nvar say = \"\";\nvar item;\n\nfor ( c_id=0; c_id < (msg.result.images[0].classifiers.length); c_id++ ){\n // find the best color, if any\n for( i =0; i<(msg.result.images[0].classifiers[c_id].classes.length); i++ ){\n var object = msg.result.images[0].classifiers[c_id].classes[i].class;\n if ( object.includes(\"color\") ) {\n if( msg.result.images[0].classifiers[c_id].classes[i].score > colorscore){\n bestcolor = i;\n colorscore = msg.result.images[0].classifiers[c_id].classes[i].score;\n }\n }\n }\n \n var bestItem = 0;\n var itemScore = 0;\n for( i =0; i<(msg.result.images[0].classifiers[c_id].classes.length); i++ ){\n var object = msg.result.images[0].classifiers[c_id].classes[i].class;\n if ( !object.includes(\"color\") ) {\n if( msg.result.images[0].classifiers[c_id].classes[i].score > itemScore){\n bestItem = i;\n itemScore = msg.result.images[0].classifiers[c_id].classes[i].score;\n }\n }\n }\n \n if( bestcolor != \"-1\") {\n // found a color\n item = msg.result.images[0].classifiers[c_id].classes[bestcolor].class + \" \" + msg.result.images[0].classifiers[c_id].classes[bestItem].class;\n bestcolor = -1;\n } else {\n item = msg.result.images[0].classifiers[c_id].classes[bestItem].class;\n }\n// say = say + \" Watson's \" + msg.result.images[0].classifiers[c_id].name + \" classifier thinks this picture contains a \" + item +\".\";\n say = say + \" Watson thinks this picture contains a \" + item +\".\";\n}\nmsg.payload = say;\n\nvar picInfo = msg.result.images[0].classifiers[0].classes;\nvar arrayLength = picInfo.length;\n\nmsg.template=\"\";\n\nmsg.template=msg.template+\"\"+say+\"
Class | Confidence |
\";\nfor (var i = 0; i < arrayLength; i++) {\n msg.template = msg.template + \"\" + picInfo[i].class + \" | \" + picInfo[i].score + \" |
\";\n}\nmsg.template = msg.template + \"
\"\n\n\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":920,"wires":[["b6a68a08.0e5b78","8b52e6a7.aa81c8","ea3f22.d5c058e"]]},{"id":"2d9c867.abe0cfa","type":"ui_button","z":"97685053.566a9","name":"","group":"30d44502.554382","order":4,"width":0,"height":0,"passthru":false,"label":"Ask Watson to Summarize this Photo","color":"","bgcolor":"","icon":"","payload":"{\"params\":{\"detect_mode\":\"classify\"}}","payloadType":"json","topic":"","x":170,"y":920,"wires":[["8d2750fd.6086d"]]},{"id":"9b0467d2.e00ca8","type":"file in","z":"97685053.566a9","name":"photo.jpg","filename":"/tmp/photo.jpg","format":"","x":480,"y":880,"wires":[["c04b0f84.1a86f"]]},{"id":"c356ec27.1d52e","type":"comment","z":"97685053.566a9","name":"Countdown to take Photos from a Raspberry Pi Camera","info":"If you add a Raspberry Pi Camera to your TJBot,\nhe can \"see\" and take Photos through his \n\"eye\" cutout.\n\nThis Node-RED flow requires the\nnode-red-contrib-camerapi npm package.\n\nDon't forget to enable the Camera in the \nRaspberry Pi Configuration utility.\n\nThe camera can be controlled in 3 ways:\n- Moving the SenseHAT joystick up \n- From the botton on the dashboard\n- From the inject node in the flow\n\nA 5 second count down is started when a picture is requested - the countdown is shown on the SenseHAT LED","x":220,"y":220,"wires":[]},{"id":"d2dc1bd6.6b6f1","type":"comment","z":"97685053.566a9","name":"node-red-contrib-camerapi dependency","info":"This flow requires\n node-red-contrib-camerapi\n\nYou can either \n $ sudo npm -g install node-red-contrib-camerapi\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":500,"y":640,"wires":[]},{"id":"6535e2cd.4a5dd4","type":"comment","z":"97685053.566a9","name":"node-red-node-watson dependency","info":"This flow requires the\n node-red-node-watson@0.5.10 or higher\nfor the following Watson nodes:\n Visual Recognition\n\nYou can either \n $ sudo npm -g install node-red-node-watson\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":640,"y":800,"wires":[]},{"id":"a0ea37d0.939a","type":"comment","z":"97685053.566a9","name":"Paste API keys for Visual Recognition","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Visual Recognition service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":650,"y":840,"wires":[]},{"id":"d723ec08.4dd32","type":"comment","z":"97685053.566a9","name":"node-red-node-base64 dependency","info":"This flow requires\n node-red-node-base64\n \nYou can either \n $ sudo npm -g install node-red-node-base64\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":820,"y":700,"wires":[]},{"id":"97f07088.107c2","type":"rpi-sensehat out","z":"97685053.566a9","name":"","x":330,"y":540,"wires":[]},{"id":"f6179e3d.4d26f","type":"change","z":"97685053.566a9","name":"white","rules":[{"t":"set","p":"payload","pt":"msg","to":"*,*,white","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":540,"wires":[["97f07088.107c2","61727925.0985c8"]]},{"id":"602266ff.4b881","type":"change","z":"97685053.566a9","name":"black","rules":[{"t":"set","p":"payload","pt":"msg","to":"*,*,black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":560,"wires":[["8b4e7336.9042d8"]]},{"id":"8b4e7336.9042d8","type":"rpi-sensehat out","z":"97685053.566a9","name":"","x":830,"y":560,"wires":[]},{"id":"a5f4a8cf.15b528","type":"rpi-sensehat in","z":"97685053.566a9","name":"","motion":false,"env":false,"stick":true,"x":80,"y":140,"wires":[["8dd5bb9c.742798"]]},{"id":"8dd5bb9c.742798","type":"rbe","z":"97685053.566a9","name":"","func":"rbe","gap":"","start":"","inout":"out","x":250,"y":140,"wires":[["1052c3f5.b25cc4"]]},{"id":"1052c3f5.b25cc4","type":"switch","z":"97685053.566a9","name":"","property":"payload.key","propertyType":"msg","rules":[{"t":"eq","v":"LEFT","vt":"str"},{"t":"eq","v":"RIGHT","vt":"str"},{"t":"eq","v":"UP","vt":"str"},{"t":"eq","v":"ENTER","vt":"str"}],"checkall":"true","outputs":4,"x":370,"y":140,"wires":[["51fddfa7.892ad"],["4019f9b2.e6e6f8"],["c7f5d46e.5f5e7"],["4060d8de.8438e8"]]},{"id":"51fddfa7.892ad","type":"switch","z":"97685053.566a9","name":"LEFT joystick","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":540,"y":60,"wires":[["d38773b6.ba1c58"]]},{"id":"4019f9b2.e6e6f8","type":"switch","z":"97685053.566a9","name":"RIGHT joystick","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":540,"y":100,"wires":[["2d175369.8e768c"]]},{"id":"c7f5d46e.5f5e7","type":"switch","z":"97685053.566a9","name":"DOWN joystick","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":540,"y":140,"wires":[["19241fad.c4d2a8"]]},{"id":"6f87298c.90c5d","type":"link in","z":"97685053.566a9","name":"process photo","links":["34ee1d03.04284a"],"x":75,"y":540,"wires":[["f6179e3d.4d26f"]]},{"id":"d38773b6.ba1c58","type":"link out","z":"97685053.566a9","name":"","links":["db758700.fa57b8"],"x":655,"y":60,"wires":[]},{"id":"2d175369.8e768c","type":"link out","z":"97685053.566a9","name":"","links":["8d0d8869.4daf48"],"x":655,"y":100,"wires":[]},{"id":"34ee1d03.04284a","type":"link out","z":"97685053.566a9","name":"","links":["6f87298c.90c5d"],"x":975,"y":480,"wires":[]},{"id":"db758700.fa57b8","type":"link in","z":"97685053.566a9","name":"Read_photo","links":["d38773b6.ba1c58"],"x":355,"y":860,"wires":[["9b0467d2.e00ca8"]]},{"id":"8d0d8869.4daf48","type":"link in","z":"97685053.566a9","name":"Summarise_photo","links":["2d175369.8e768c"],"x":355,"y":940,"wires":[["8d2750fd.6086d"]]},{"id":"314eaeae.e810d2","type":"change","z":"97685053.566a9","name":"camera icon","rules":[{"t":"set","p":"payload","pt":"msg","to":"*,*,black,2-4,2,silver,0-6,3,silver,0-1,4,silver,5-6,4,silver,0-1,5,silver,3,5,white,5-6,5,silver,0-1,6,silver,5-6,6,silver,0-6,7,silver","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":280,"wires":[["1e0d228.040c1de","91b0817f.91cc7"]]},{"id":"1e0d228.040c1de","type":"rpi-sensehat out","z":"97685053.566a9","name":"","x":1070,"y":280,"wires":[]},{"id":"91b0817f.91cc7","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":320,"wires":[["9ca9cc97.2faa8","2c378ace.0380d6"]]},{"id":"9ca9cc97.2faa8","type":"change","z":"97685053.566a9","name":"3","rules":[{"t":"set","p":"payload","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":320,"wires":[["1e0d228.040c1de","a22008cd.66bd48"]]},{"id":"5b14db74.11315c","type":"change","z":"97685053.566a9","name":"2","rules":[{"t":"set","p":"payload","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":360,"wires":[["1e0d228.040c1de","8ebf5740.85d9b8"]]},{"id":"a22008cd.66bd48","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":360,"wires":[["5b14db74.11315c","8fbe4d.0a7461b"]]},{"id":"113f26f6.fb3f71","type":"change","z":"97685053.566a9","name":"1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":400,"wires":[["1e0d228.040c1de","a7a43dfc.b9b09"]]},{"id":"8ebf5740.85d9b8","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":700,"y":400,"wires":[["113f26f6.fb3f71","dba3ec73.5ebd"]]},{"id":"a7a43dfc.b9b09","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":800,"y":440,"wires":[["34ee1d03.04284a","93af6a65.425c38"]]},{"id":"ef74bd42.488508","type":"comment","z":"97685053.566a9","name":"Capture the picture from the camera and save to local file","info":"The SenseHAT LED is lit white to provide additional light for the camera whilst the picture is being captured","x":230,"y":500,"wires":[]},{"id":"4a7f9436.7e0954","type":"watson-speech-to-text","z":"97685053.566a9","name":"","speakerlabels":false,"lang":"en-GB","langhidden":"en-GB","langcustom":"NoCustomisationSetting","langcustomhidden":"","band":"BroadbandModel","bandhidden":"BroadbandModel","password":"n4WHUB4cSZK0","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1120,"y":1220,"wires":[["722c8da9.1e9d6c","1ea97d.dd625683","a07455fa.6674"]]},{"id":"722c8da9.1e9d6c","type":"debug","z":"97685053.566a9","name":"","active":true,"console":"false","complete":"transcription","x":1330,"y":1220,"wires":[]},{"id":"42bc7d51.624984","type":"switch","z":"97685053.566a9","name":"SelectColor","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"wave","vt":"str"},{"t":"cont","v":"white","vt":"str"},{"t":"cont","v":"yellow","vt":"str"},{"t":"cont","v":"grey","vt":"str"},{"t":"cont","v":"gray","vt":"str"},{"t":"cont","v":"red","vt":"str"},{"t":"cont","v":"blue","vt":"str"},{"t":"cont","v":"green","vt":"str"},{"t":"cont","v":"purple","vt":"str"},{"t":"cont","v":"pink","vt":"str"},{"t":"cont","v":"orange","vt":"str"},{"t":"cont","v":"party","vt":"str"},{"t":"cont","v":"weather","vt":"str"},{"t":"cont","v":"off","vt":"str"},{"t":"cont","v":"black","vt":"str"},{"t":"else"}],"checkall":"false","outputs":16,"x":190,"y":1700,"wires":[["3a74f9b7.02a936"],["50044c9.8cdd3b4"],["41d48ca4.397a44"],["b4572ff6.b613f"],["b4572ff6.b613f"],["38ed285a.5789f8"],["cc32ba93.3f4a6"],["3954e108.a334ce"],["6166fe90.577a1"],["d4e02f53.47c4a8"],["267b2cdf.2f7c6c"],["1ae7cc16.f9bce4"],["75c51f3d.466f5"],["4ccd7397.af0624"],["4ccd7397.af0624"],["cd7d2d36.593c2","9a65979b.103218"]]},{"id":"2143cd7.3ddb7b2","type":"comment","z":"97685053.566a9","name":"Wave arm, set LED Color or get the forecast","info":"","x":550,"y":1360,"wires":[]},{"id":"9dc0b6d1.07eb18","type":"rpi-neopixels","z":"97685053.566a9","name":"Set LED Color","pixels":"1","bgnd":"","fgnd":"","wipe":"40","mode":"pcent","rgb":"grb","x":1420,"y":1540,"wires":[]},{"id":"38ed285a.5789f8","type":"change","z":"97685053.566a9","name":"Red Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1520,"wires":[["26640361.bd6cfc"]]},{"id":"3954e108.a334ce","type":"change","z":"97685053.566a9","name":"Green Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,255,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1640,"wires":[["26640361.bd6cfc"]]},{"id":"cc32ba93.3f4a6","type":"change","z":"97685053.566a9","name":"Blue Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,0,255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1600,"wires":[["26640361.bd6cfc"]]},{"id":"41d48ca4.397a44","type":"change","z":"97685053.566a9","name":"Yellow Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"255,255,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1480,"wires":[["26640361.bd6cfc"]]},{"id":"6166fe90.577a1","type":"change","z":"97685053.566a9","name":"Purple Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"238,130,238","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1680,"wires":[["26640361.bd6cfc"]]},{"id":"cd7d2d36.593c2","type":"change","z":"97685053.566a9","name":"Off - Other","rules":[{"t":"set","p":"payload","pt":"msg","to":"0,0,0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1940,"wires":[["26640361.bd6cfc"]]},{"id":"d4e02f53.47c4a8","type":"change","z":"97685053.566a9","name":"Pink Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"pink","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1720,"wires":[["26640361.bd6cfc"]]},{"id":"1ae7cc16.f9bce4","type":"function","z":"97685053.566a9","name":"Party!","func":"var count = flow.get('count') || 0;\n\nif( count < 20 ) {\n // Generate a random color and set the NeoPixel LED\n msg.payload = '#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6); \n count += 1;\n flow.set('count',count);\n msg.count = count;\n return [msg,msg];\n} else {\n count = 0;\n flow.set('count',count);\n return [msg,null];\n}\n","outputs":"2","noerr":0,"x":430,"y":1840,"wires":[["26640361.bd6cfc"],["c96bbc22.e93a38"]]},{"id":"c96bbc22.e93a38","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"0.3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":1900,"wires":[["1ae7cc16.f9bce4"]]},{"id":"b8db8a91.1060d","type":"comment","z":"97685053.566a9","name":"node-red-node-pi-neopixel dependency","info":"This flow requires the\n node-red-node-pi-neopixel\nfor the Raspberry Pi NeoPixel GPIO node.\nYou can either \n $ sudo npm -g install node-red-node-pi-neopixel\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":1380,"y":1500,"wires":[]},{"id":"df48a76b.3737f","type":"comment","z":"97685053.566a9","name":"Paste API keys for Speech to Text","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Speech to Text service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":1200,"y":1180,"wires":[]},{"id":"5d639389.ee2ad4","type":"comment","z":"97685053.566a9","name":"node-red-node-watson dependency","info":"This flow requires the\n node-red-node-watson\nfor the following Watson nodes:\n Speech to Text\n\nYou can either \n $ sudo npm -g install node-red-node-watson\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":1200,"y":1140,"wires":[]},{"id":"b13c25f8.9ba1f8","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak English","lang":"en-GB","langhidden":"en-GB","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"en-GB_KateVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"BsTJHhqviKTL","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1420,"y":1700,"wires":[["fe60b6a9.014da"]]},{"id":"ec600831.a9df28","type":"debug","z":"97685053.566a9","name":"","active":true,"console":"false","complete":"payload.forecast","x":700,"y":1940,"wires":[]},{"id":"667c10a7.28a358","type":"comment","z":"97685053.566a9","name":"Paste API keys for Text to Speech","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Text to Speech service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":1500,"y":1980,"wires":[]},{"id":"b872c129.172ba","type":"comment","z":"97685053.566a9","name":"node-red-node-watson dependency","info":"This flow requires the\n node-red-node-watson@0.5.10 or higher\nfor the following Watson nodes:\n Text to Speech\n Speech to Text\n Tone Analyzer\n Visual Recognition\n\nYou can either \n $ sudo npm -g install node-red-node-watson\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":1280,"y":1940,"wires":[]},{"id":"19baa6c4.d67229","type":"comment","z":"97685053.566a9","name":"Weather Data Service","info":"","x":480,"y":2060,"wires":[]},{"id":"fda061e9.bd384","type":"microPi","z":"97685053.566a9","name":"microPi","filename":"/home/pi/audio/mic.wav","domain":"http://localhost:1880/getAudio","rate":"16000","bitwidth":"16","endian":"little","encoding":"signed-integer","channels":"1","silence":"5","debug":"false","mode":"","x":940,"y":1220,"wires":[[],["4a7f9436.7e0954"],[]]},{"id":"c259fa8.cd77b08","type":"inject","z":"97685053.566a9","name":"record","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"x":130,"y":1240,"wires":[["66474ac3.c6f164"]]},{"id":"1a71d098.b3d177","type":"inject","z":"97685053.566a9","name":"stop","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"x":130,"y":1280,"wires":[["66474ac3.c6f164"]]},{"id":"20e8a4fb.dfdedc","type":"change","z":"97685053.566a9","name":"Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1160,"wires":[["872b608.245a72"]]},{"id":"a1de14c.2c44ae8","type":"change","z":"97685053.566a9","name":"Black","rules":[{"t":"set","p":"payload","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1280,"wires":[["5f6c8773.b9c988"]]},{"id":"5f6c8773.b9c988","type":"link out","z":"97685053.566a9","name":"","links":["4bae24ba.9c06dc"],"x":875,"y":1280,"wires":[]},{"id":"4bae24ba.9c06dc","type":"link in","z":"97685053.566a9","name":"LED-output","links":["5f6c8773.b9c988","872b608.245a72","26640361.bd6cfc","e79b6407.421d9","5eb8e938.88bcc8"],"x":1055,"y":1540,"wires":[["9dc0b6d1.07eb18"]]},{"id":"872b608.245a72","type":"link out","z":"97685053.566a9","name":"","links":["4bae24ba.9c06dc"],"x":875,"y":1160,"wires":[]},{"id":"26640361.bd6cfc","type":"link out","z":"97685053.566a9","name":"","links":["4bae24ba.9c06dc"],"x":635,"y":1680,"wires":[]},{"id":"7aeab724.2f52","type":"link in","z":"97685053.566a9","name":"Analyse-input","links":["c62e998d.98642","ea3f22.d5c058e"],"x":55,"y":1700,"wires":[["42bc7d51.624984","50d342df.acfb94"]]},{"id":"c62e998d.98642","type":"link out","z":"97685053.566a9","name":"","links":["7aeab724.2f52"],"x":1475,"y":1320,"wires":[]},{"id":"baa302f3.72cdc","type":"comment","z":"97685053.566a9","name":"Analyse input on keyword identification","info":"","x":170,"y":1400,"wires":[]},{"id":"169dc2b0.8f7945","type":"comment","z":"97685053.566a9","name":"Analyse input","info":"","x":1570,"y":1320,"wires":[]},{"id":"ced7b5de.630c78","type":"rpi-sensehat in","z":"97685053.566a9","name":"","motion":false,"env":false,"stick":true,"x":120,"y":1180,"wires":[["a35d8110.d1fd9"]]},{"id":"a35d8110.d1fd9","type":"rbe","z":"97685053.566a9","name":"","func":"rbe","gap":"","start":"","inout":"out","x":250,"y":1180,"wires":[["cc286aa8.886928"]]},{"id":"249c32de.575916","type":"switch","z":"97685053.566a9","name":"Joystick Down?","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","outputs":2,"x":640,"y":1220,"wires":[["20e8a4fb.dfdedc","cbefdda8.7a706"],["a1de14c.2c44ae8","c02b2b45.199f5"]]},{"id":"cbefdda8.7a706","type":"change","z":"97685053.566a9","name":"True","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1200,"wires":[["fda061e9.bd384"]]},{"id":"c02b2b45.199f5","type":"change","z":"97685053.566a9","name":"False","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1240,"wires":[["fda061e9.bd384"]]},{"id":"66474ac3.c6f164","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"num","to":"{\"state\":2}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"{\"state\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":1260,"wires":[["249c32de.575916"]]},{"id":"377d89a2.a28cfe","type":"ui_switch","z":"97685053.566a9","name":"","label":"Microphone","group":"492ef91b.15913","order":1,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"","style":"","onvalue":"{\"state\":2}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"state\":0}","offvalueType":"json","officon":"","offcolor":"","x":390,"y":1220,"wires":[["249c32de.575916"]]},{"id":"1ea97d.dd625683","type":"ui_text","z":"97685053.566a9","group":"492ef91b.15913","order":0,"width":0,"height":0,"name":"","label":"Microphone input : ","format":"{{msg.payload}}","layout":"row-spread","x":1330,"y":1260,"wires":[]},{"id":"b957a41f.272f5","type":"comment","z":"97685053.566a9","name":"Controlling the mic","info":"The microphone can be controlled 3 different ways:\n- Hold down the joysick on the senseHAT\n- Slide the Dashboard switch to on\n- Use the record input nodes\n\nWhen the mic is recording the LED shows RED.\n\nThe mic needs to be stopped when finished speaking:\n- Release the joystick on the SenseHAT\n- Slide the Dashboard switch to off\n- Use the stop input node\n\nThe LED will turn off when recording stops","x":110,"y":1140,"wires":[]},{"id":"cc286aa8.886928","type":"switch","z":"97685053.566a9","name":"Joystick DOWN event?","property":"payload.key","propertyType":"msg","rules":[{"t":"eq","v":"DOWN","vt":"str"}],"checkall":"true","outputs":1,"x":430,"y":1180,"wires":[["249c32de.575916"]]},{"id":"267b2cdf.2f7c6c","type":"change","z":"97685053.566a9","name":"Orange Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"orange","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":1760,"wires":[["26640361.bd6cfc"]]},{"id":"2e3bb6af.a12e72","type":"ui_text","z":"97685053.566a9","group":"492ef91b.15913","order":0,"width":"8","height":"4","name":"","label":"Audio output","format":"{{msg.payload}}","layout":"row-spread","x":1410,"y":1660,"wires":[]},{"id":"6dd50cad.a00314","type":"link in","z":"97685053.566a9","name":"English Output","links":["351d2bda.d4621c","cf186ae9.2ac7e8","9a65979b.103218","1040368a.3eec09"],"x":1055,"y":1700,"wires":[["b13c25f8.9ba1f8","2e3bb6af.a12e72"]]},{"id":"fe60b6a9.014da","type":"speakerpi-output","z":"97685053.566a9","choose":"filebased","filename":"","channels":"1","bitdepth":"8","samplerate":"11025","name":"","x":1640,"y":1800,"wires":[]},{"id":"351d2bda.d4621c","type":"link out","z":"97685053.566a9","name":"","links":["6dd50cad.a00314"],"x":795,"y":1980,"wires":[]},{"id":"78feef0f.d08988","type":"comment","z":"97685053.566a9","name":"Pick a #hashtag to follow","info":"","x":170,"y":2180,"wires":[]},{"id":"34fc2d49.1512d2","type":"comment","z":"97685053.566a9","name":"Wave arm when there are Joyful tweets","info":"","x":1290,"y":2400,"wires":[]},{"id":"7a240a0a.703d6c","type":"comment","z":"97685053.566a9","name":"Extract highest emotion","info":"","x":720,"y":2440,"wires":[]},{"id":"a6b9cc54.67bdf8","type":"comment","z":"97685053.566a9","name":"Blink the TJBot LED based on Twitter sentiment and wave his arm on Joyful tweets ","info":"","x":590,"y":2180,"wires":[]},{"id":"50b5d8c.de6de28","type":"link out","z":"97685053.566a9","name":"","links":["f3f52149.9280f8","6dd50cad.a00314"],"x":515,"y":2340,"wires":[]},{"id":"3e4dfe08.e5f1ba","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"tweet.text","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":2340,"wires":[["384087f7.b0e51","2a0eee38.2eab12","50b5d8c.de6de28"]]},{"id":"b55c33fd.a2d65","type":"inject","z":"97685053.566a9","name":"Happy test","topic":"","payload":"every one is awesome","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":2340,"wires":[["3e4dfe08.e5f1ba"]]},{"id":"384087f7.b0e51","type":"watson-tone-analyzer-v3","z":"97685053.566a9","name":"Analyze Tone","tones":"emotion","sentences":"true","contentType":"false","tone-method":"generalTone","default-endpoint":true,"service-endpoint":"","x":570,"y":2380,"wires":[["1b192f49.0114f1","1dce0ca.28e98f3","934c56a0.88461"]]},{"id":"2a0eee38.2eab12","type":"debug","z":"97685053.566a9","name":"","active":false,"console":"false","complete":"false","x":570,"y":2300,"wires":[]},{"id":"ee86658a.c6737","type":"inject","z":"97685053.566a9","name":"Sadness test","topic":"","payload":"This is miserable and sad","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":2380,"wires":[["3e4dfe08.e5f1ba"]]},{"id":"8eb70f39.2676c","type":"inject","z":"97685053.566a9","name":"Angry test","topic":"","payload":"I hate boring demos","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":2420,"wires":[["3e4dfe08.e5f1ba"]]},{"id":"1152445a.b7f08c","type":"delay","z":"97685053.566a9","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":220,"y":2280,"wires":[["3e4dfe08.e5f1ba"]]},{"id":"1b192f49.0114f1","type":"function","z":"97685053.566a9","name":"HighScore","func":"var emotions = [];\nemotions = msg.response.document_tone.tone_categories\n .filter(function(c){\n if (c.category_id == \"emotion_tone\")\n {return c; }\n })[0].tones;\n \n//rename tone_id to topic\nvar myscore = 0; \nvar mynewmsg ={};\n//msg.payload = emotions;\nfor (var i=0; i myscore)\n {\n msg.payload = emotions[i].score;\n msg.topic = emotions[i].tone_name;\n myscore = emotions[i].score;\n }\n // node.send(msg);\n}\nmynewmsg = msg;\nreturn mynewmsg;","outputs":1,"noerr":0,"x":750,"y":2400,"wires":[["5854d7ec.7a7938","eb8efe79.9a838"]]},{"id":"1dce0ca.28e98f3","type":"debug","z":"97685053.566a9","name":"Print msg.response","active":false,"console":"false","complete":"response","x":770,"y":2320,"wires":[]},{"id":"934c56a0.88461","type":"change","z":"97685053.566a9","name":"tone_categories","rules":[{"t":"set","p":"payload","pt":"msg","to":"response.document_tone.tone_categories","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":2360,"wires":[["70757f11.4cc3d8"]]},{"id":"3c96b65f.eae51a","type":"twitter in","z":"97685053.566a9","twitter":"","tags":"#xxxWatsonIoTHack","user":"false","name":"","topic":"tweets","inputs":1,"x":110,"y":2220,"wires":[["1152445a.b7f08c","9e8b15a3.fd64b8"]]},{"id":"5854d7ec.7a7938","type":"debug","z":"97685053.566a9","name":"Score","active":true,"console":"false","complete":"topic","x":930,"y":2400,"wires":[]},{"id":"eb8efe79.9a838","type":"switch","z":"97685053.566a9","name":"SelectColor","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Joy","vt":"str"},{"t":"eq","v":"Fear","vt":"str"},{"t":"eq","v":"Sadness","vt":"str"},{"t":"eq","v":"Anger","vt":"str"},{"t":"eq","v":"Disgust","vt":"str"},{"t":"else"}],"checkall":"true","outputs":6,"x":950,"y":2520,"wires":[["36d17460.94b0bc","2fe0bfa3.5c7618"],["e44ee39e.0064f8"],["de209346.c9a0c8"],["f75fbb2f.9ca12"],["e7512820.19c238"],["a2560e6.156387"]]},{"id":"70757f11.4cc3d8","type":"debug","z":"97685053.566a9","name":"Tone categories","active":false,"console":"false","complete":"payload","x":960,"y":2360,"wires":[]},{"id":"9e8b15a3.fd64b8","type":"debug","z":"97685053.566a9","name":"","active":true,"console":"false","complete":"payload","x":350,"y":2220,"wires":[]},{"id":"36d17460.94b0bc","type":"change","z":"97685053.566a9","name":"Yellow Color - Joy","rules":[{"t":"set","p":"payload","pt":"msg","to":"yellow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":2440,"wires":[["e79b6407.421d9"]]},{"id":"e44ee39e.0064f8","type":"change","z":"97685053.566a9","name":"Red Color - Fear","rules":[{"t":"set","p":"payload","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":2480,"wires":[["e79b6407.421d9"]]},{"id":"de209346.c9a0c8","type":"change","z":"97685053.566a9","name":"Blue Color - Sadness","rules":[{"t":"set","p":"payload","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":2520,"wires":[["e79b6407.421d9"]]},{"id":"f75fbb2f.9ca12","type":"change","z":"97685053.566a9","name":"Green Color - Anger","rules":[{"t":"set","p":"payload","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":2560,"wires":[["e79b6407.421d9"]]},{"id":"e7512820.19c238","type":"change","z":"97685053.566a9","name":"Purple Color - Disgust","rules":[{"t":"set","p":"payload","pt":"msg","to":"purple","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":2600,"wires":[["e79b6407.421d9"]]},{"id":"a2560e6.156387","type":"change","z":"97685053.566a9","name":"Off - Other","rules":[{"t":"set","p":"payload","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":2640,"wires":[["e79b6407.421d9"]]},{"id":"7fb12462.7f3ba4","type":"comment","z":"97685053.566a9","name":"Twitter Analysis","info":"","x":140,"y":2140,"wires":[]},{"id":"e79b6407.421d9","type":"link out","z":"97685053.566a9","name":"","links":["4bae24ba.9c06dc"],"x":1395,"y":2600,"wires":[]},{"id":"c9097fdf.a150c","type":"pi-gpiod out","z":"97685053.566a9","name":"","host":"localhost","port":8888,"pin":"7","set":"","level":"0","out":"ser","sermin":"650","sermax":"2350","x":1560,"y":2080,"wires":[]},{"id":"e426afa1.d29c98","type":"trigger","z":"97685053.566a9","op1":"95","op2":"5","op1type":"str","op2type":"str","duration":"500","extend":false,"units":"ms","reset":"","name":"","x":1220,"y":2080,"wires":[["c9097fdf.a150c"]]},{"id":"e4c71863.4891d","type":"link in","z":"97685053.566a9","name":"Wave_arm","links":["3a74f9b7.02a936","2fe0bfa3.5c7618"],"x":1055,"y":2080,"wires":[["e426afa1.d29c98","dee6875a.823b28"]]},{"id":"2fe0bfa3.5c7618","type":"link out","z":"97685053.566a9","name":"Wave Arm","links":["e4c71863.4891d"],"x":1115,"y":2400,"wires":[]},{"id":"3a74f9b7.02a936","type":"link out","z":"97685053.566a9","name":"Wave Arm","links":["e4c71863.4891d"],"x":395,"y":1400,"wires":[]},{"id":"725ae051.f322","type":"comment","z":"97685053.566a9","name":"READ THIS BEFORE RUNNING THE DEMO","info":"Before you can run the demo, you to need to deploy, \nthen import Blumeix service credentials for the \nfollowing services in the appropriate nodes in this flow:\n- Text to Speech\n- Speech to Text\n- Visual Recognition\n- Tone Analysis\n- Conversation\n- Weather\n\nYou can also add a twitter API key and a Weather \nUnderground API key to add twitter and weather components to the demo.\n\nThe Demo also allows use of SenseHAT or DHT11/22 to provide temperature data. \nIf not using a DHT sensor then edit the inject node to prevent it generation \nevents every 5 seconds.","x":190,"y":40,"wires":[]},{"id":"54baea01.85b52c","type":"comment","z":"97685053.566a9","name":"Wave arm","info":"W","x":1100,"y":2040,"wires":[]},{"id":"3df5d38c.362ab4","type":"comment","z":"97685053.566a9","name":"Speak text and output to dashboard","info":"","x":1180,"y":1620,"wires":[]},{"id":"a61120fb.090288","type":"comment","z":"97685053.566a9","name":"Set LED colour","info":"","x":1120,"y":1500,"wires":[]},{"id":"ab48e0d3.095228","type":"comment","z":"97685053.566a9","name":"This area of the flow controls some of TobyJnr's outputs","info":"","x":1250,"y":1460,"wires":[]},{"id":"1177da6b.c129f6","type":"trigger","z":"97685053.566a9","op1":"95","op2":"50","op1type":"str","op2type":"str","duration":"500","extend":false,"units":"ms","reset":"","name":"","x":1400,"y":2120,"wires":[["c9097fdf.a150c"]]},{"id":"dee6875a.823b28","type":"delay","z":"97685053.566a9","name":"","pauseType":"delay","timeout":"1250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1220,"y":2120,"wires":[["1177da6b.c129f6"]]},{"id":"9a65979b.103218","type":"link out","z":"97685053.566a9","name":"","links":["6dd50cad.a00314"],"x":295,"y":1900,"wires":[]},{"id":"ef920a28.1e3f6","type":"inject","z":"97685053.566a9","name":"","topic":"Weather","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":1980,"wires":[["75c51f3d.466f5"]]},{"id":"4060d8de.8438e8","type":"link out","z":"97685053.566a9","name":"","links":["4b511a14.fa6e2c"],"x":655,"y":180,"wires":[]},{"id":"e35f6d4f.5b6778","type":"rpi-sensehat in","z":"97685053.566a9","name":"","motion":false,"env":true,"stick":false,"x":80,"y":2780,"wires":[["f2e35b45.786bf"]]},{"id":"f2e35b45.786bf","type":"change","z":"97685053.566a9","name":"Set temp variables","rules":[{"t":"set","p":"tempC","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"tempF","pt":"flow","to":"$number(msg.payload) * 9/5 + 32","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":2780,"wires":[["aa010c63.7127b"]]},{"id":"995dde3e.8ce1a","type":"comment","z":"97685053.566a9","name":"Store current temperature in flow context","info":"","x":180,"y":2740,"wires":[]},{"id":"2a48add4.ff9f52","type":"watson-conversation-v1","z":"97685053.566a9","name":"TobyJnr Conversation","workspaceid":"7b70d9c9-a84d-489d-bc01-421333d4cc71","multiuser":false,"context":true,"default-endpoint":false,"service-endpoint":"","x":400,"y":2980,"wires":[["3f0e9e12.ebbd22","5b2ab7f4.381f58"]]},{"id":"3f0e9e12.ebbd22","type":"switch","z":"97685053.566a9","name":"Conversation Actions","property":"payload.output.action","propertyType":"msg","rules":[{"t":"eq","v":"CurrentTempCentigrade","vt":"str"},{"t":"eq","v":"CurrentTempFahrenheit","vt":"str"},{"t":"eq","v":"CurrentWeather","vt":"str"},{"t":"eq","v":"changeColour","vt":"str"},{"t":"eq","v":"quit","vt":"str"},{"t":"else"}],"checkall":"false","outputs":6,"x":640,"y":2980,"wires":[["d3d8949.1486368"],["e6c4bb4.6502bc8"],["b5277fda.a03cd8"],["6caed143.a670f8","63e7d3a7.1aaa64"],["6f06cd90.779954"],["4056ced5.e6223"]]},{"id":"2acab275.e2dabe","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"Hi","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":3020,"wires":[["2a48add4.ff9f52"]]},{"id":"a84cf817.07a09","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"Is it sunny outside","payloadType":"str","repeat":"","crontab":"","once":false,"x":150,"y":3100,"wires":[["2a48add4.ff9f52"]]},{"id":"4887960a.7d98d","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"bye","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":3060,"wires":[["2a48add4.ff9f52"]]},{"id":"bb1665a7.fc725","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"set colour to green","payloadType":"str","repeat":"","crontab":"","once":false,"x":150,"y":3140,"wires":[["2a48add4.ff9f52"]]},{"id":"d3d8949.1486368","type":"template","z":"97685053.566a9","name":"Centigrade","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.output.text.0}} {{flow.tempC}}, {{payload.output.text.1}}","output":"str","x":890,"y":2880,"wires":[["1040368a.3eec09"]]},{"id":"197ed5af.451c12","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"What's the temp in C","payloadType":"str","repeat":"","crontab":"","once":false,"x":160,"y":3180,"wires":[["2a48add4.ff9f52"]]},{"id":"6f06cd90.779954","type":"change","z":"97685053.566a9","name":"End conversation","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.output.text[0]","tot":"msg"},{"t":"set","p":"inConversation","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":3080,"wires":[["1040368a.3eec09","46832150.266728","ebad8d91.87f28"]]},{"id":"e6c4bb4.6502bc8","type":"template","z":"97685053.566a9","name":"Fahrenheit","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.output.text.0}} {{flow.tempF}}, {{payload.output.text.1}}","output":"str","x":890,"y":2920,"wires":[["1040368a.3eec09"]]},{"id":"6caed143.a670f8","type":"template","z":"97685053.566a9","name":"Colour","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.output.text.0}}, {{payload.output.text.1}}","output":"str","x":870,"y":3000,"wires":[["1040368a.3eec09"]]},{"id":"63e7d3a7.1aaa64","type":"change","z":"97685053.566a9","name":"output colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.entities[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":3040,"wires":[["5eb8e938.88bcc8"]]},{"id":"b5277fda.a03cd8","type":"change","z":"97685053.566a9","name":"convData","rules":[{"t":"set","p":"convData","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2960,"wires":[["c22415f4.3b8788"]]},{"id":"8385f82.d971a88","type":"comment","z":"97685053.566a9","name":"Have a conversation with Toby","info":"","x":150,"y":2880,"wires":[]},{"id":"6908b1d9.c699f8","type":"inject","z":"97685053.566a9","name":"Temp F","topic":"","payload":"What's the temp in Fahrenheit","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":3220,"wires":[["2a48add4.ff9f52"]]},{"id":"a07455fa.6674","type":"switch","z":"97685053.566a9","name":"Using Conversation?","property":"inConversation","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","outputs":2,"x":1340,"y":1300,"wires":[["8b1e19da.9b7d9"],["c62e998d.98642"]]},{"id":"4b511a14.fa6e2c","type":"link in","z":"97685053.566a9","name":"Start conversation","links":["4060d8de.8438e8"],"x":995,"y":3220,"wires":[["b77b03d1.f7122"]]},{"id":"b77b03d1.f7122","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"set","p":"inConversation","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":3220,"wires":[["ff4d95d9.cb70f8","8c0e541.24daca8"]]},{"id":"8b1e19da.9b7d9","type":"link out","z":"97685053.566a9","name":"","links":["c606caba.9530c8"],"x":1475,"y":1280,"wires":[]},{"id":"c62d8791.8501f","type":"comment","z":"97685053.566a9","name":"to conversation","info":"","x":1580,"y":1280,"wires":[]},{"id":"c606caba.9530c8","type":"link in","z":"97685053.566a9","name":"conversation","links":["8b1e19da.9b7d9"],"x":235,"y":2980,"wires":[["2a48add4.ff9f52"]]},{"id":"50d342df.acfb94","type":"debug","z":"97685053.566a9","name":"","active":false,"console":"false","complete":"false","x":190,"y":1840,"wires":[]},{"id":"4056ced5.e6223","type":"change","z":"97685053.566a9","name":"speak text","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.output.text[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":3120,"wires":[["1040368a.3eec09"]]},{"id":"5eb8e938.88bcc8","type":"link out","z":"97685053.566a9","name":"to LED-output","links":["4bae24ba.9c06dc"],"x":1475,"y":3040,"wires":[]},{"id":"91c10800.4833c","type":"comment","z":"97685053.566a9","name":"set LED","info":"","x":1550,"y":3040,"wires":[]},{"id":"1040368a.3eec09","type":"link out","z":"97685053.566a9","name":"","links":["6dd50cad.a00314"],"x":1715,"y":3000,"wires":[]},{"id":"43acf46c.23c2f4","type":"comment","z":"97685053.566a9","name":"Speak output","info":"","x":1810,"y":3000,"wires":[]},{"id":"46832150.266728","type":"change","z":"97685053.566a9","name":"Clear LED panel","rules":[{"t":"set","p":"payload","pt":"msg","to":"*,*,black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":3120,"wires":[["e9624268.a7f4"]]},{"id":"ff4d95d9.cb70f8","type":"change","z":"97685053.566a9","name":"conversation icon","rules":[{"t":"set","p":"payload","pt":"msg","to":"*,*,black,3-5,0,silver,2,1,silver,4,1,silver,1,2,silver,3,2,silver,0,3-4,silver,2,3-4,silver,1,5,silver,3,5,silver,2,6,silver,4,6,silver,3-5,7,silver","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":3240,"wires":[["1073fafa.522905"]]},{"id":"1073fafa.522905","type":"rpi-sensehat out","z":"97685053.566a9","name":"","x":1550,"y":3240,"wires":[]},{"id":"e9624268.a7f4","type":"rpi-sensehat out","z":"97685053.566a9","name":"","x":1530,"y":3120,"wires":[]},{"id":"9172e2d3.3371a8","type":"comment","z":"97685053.566a9","name":"Start the conversation","info":"","x":1080,"y":3180,"wires":[]},{"id":"a86cc3c1.a07ce","type":"comment","z":"97685053.566a9","name":"Paste API keys for Tone Analyzer","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Tone Analyzer service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":450,"y":2460,"wires":[]},{"id":"632b9a52.e77f7c","type":"comment","z":"97685053.566a9","name":"node-red-node-watson dependency","info":"This flow requires the\n node-red-node-watson\nfor the following Watson nodes:\n Speech to Text\n\nYou can either \n $ sudo npm -g install node-red-node-watson\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":460,"y":2420,"wires":[]},{"id":"9a6dfc35.cf6f1","type":"comment","z":"97685053.566a9","name":"Paste API keys for Conversation","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Conversation service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":430,"y":3080,"wires":[]},{"id":"4ee3600a.ea1c28","type":"comment","z":"97685053.566a9","name":"node-red-node-watson dependency","info":"This flow requires the\n node-red-node-watson\nfor the following Watson nodes:\n Speech to Text\n\nYou can either \n $ sudo npm -g install node-red-node-watson\n and restart the Node-RED service\nor install it from Node-RED Manage Palette.","x":440,"y":3040,"wires":[]},{"id":"bf12d712.7402c8","type":"comment","z":"97685053.566a9","name":"to Set LED colour","info":"","x":1500,"y":2600,"wires":[]},{"id":"f5575b12.6119d","type":"comment","z":"97685053.566a9","name":"Wave Arm","info":"","x":480,"y":1400,"wires":[]},{"id":"b9920411.6e8f8","type":"comment","z":"97685053.566a9","name":"Speak output","info":"","x":750,"y":2020,"wires":[]},{"id":"3f2b93a6.f3365c","type":"comment","z":"97685053.566a9","name":"set LED colour","info":"","x":740,"y":1680,"wires":[]},{"id":"8164f476.692038","type":"comment","z":"97685053.566a9","name":"set LED colour","info":"","x":980,"y":1280,"wires":[]},{"id":"fc607771.a65188","type":"comment","z":"97685053.566a9","name":"set LED colour","info":"","x":980,"y":1160,"wires":[]},{"id":"adc850c2.0ed98","type":"comment","z":"97685053.566a9","name":"People in photo","info":"","x":760,"y":60,"wires":[]},{"id":"cda0069e.1c884","type":"comment","z":"97685053.566a9","name":"Summarise photo","info":"","x":770,"y":100,"wires":[]},{"id":"81667983.f51208","type":"comment","z":"97685053.566a9","name":"Start conversation when joystick pressed in","info":"","x":850,"y":180,"wires":[]},{"id":"d96ce8df.da04a","type":"comment","z":"97685053.566a9","name":"Handle joystick","info":"","x":100,"y":100,"wires":[]},{"id":"8e62ec5e.ae7848","type":"ui_button","z":"97685053.566a9","name":"start Conversation","group":"ce2fab3f.765e7","order":1,"width":"5","height":"1","passthru":false,"label":"start conversation","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":1070,"y":3280,"wires":[["b77b03d1.f7122"]]},{"id":"61727925.0985c8","type":"change","z":"97685053.566a9","name":"Set file details","rules":[{"t":"set","p":"filemode","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"filename","pt":"msg","to":"photo.jpg","tot":"str"},{"t":"set","p":"filepath","pt":"msg","to":"/tmp","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":600,"wires":[["fa5fd586.a414c8"]]},{"id":"7a375bbb.3e4444","type":"link in","z":"97685053.566a9","name":"Countdown to take photo","links":["19241fad.c4d2a8"],"x":355,"y":260,"wires":[["314eaeae.e810d2","f9b94382.8b408"]]},{"id":"19241fad.c4d2a8","type":"link out","z":"97685053.566a9","name":"","links":["7a375bbb.3e4444"],"x":655,"y":140,"wires":[]},{"id":"82c7b5b6.6c6d98","type":"comment","z":"97685053.566a9","name":"Countdown then take photo","info":"","x":800,"y":140,"wires":[]},{"id":"1aafc5f9.95c7fa","type":"comment","z":"97685053.566a9","name":"Take photo","info":"","x":1060,"y":480,"wires":[]},{"id":"bb6e3c3e.c95be","type":"ui_text_input","z":"97685053.566a9","name":"","label":"Text input","group":"ce2fab3f.765e7","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":1140,"y":1300,"wires":[["a07455fa.6674"]]},{"id":"4ccd7397.af0624","type":"change","z":"97685053.566a9","name":"Black Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1800,"wires":[["26640361.bd6cfc"]]},{"id":"aa010c63.7127b","type":"ui_gauge","z":"97685053.566a9","name":"Temperature Guage","group":"ce2fab3f.765e7","order":4,"width":0,"height":0,"gtype":"gage","title":"Current Temperature","label":"units","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"30","seg2":"35","x":490,"y":2780,"wires":[]},{"id":"5b2ab7f4.381f58","type":"debug","z":"97685053.566a9","name":"","active":true,"console":"false","complete":"false","x":640,"y":2900,"wires":[]},{"id":"75c51f3d.466f5","type":"change","z":"97685053.566a9","name":"Barcelona","rules":[{"t":"set","p":"lat","pt":"msg","to":"41.382","tot":"str"},{"t":"set","p":"lon","pt":"msg","to":"2.177","tot":"str"},{"t":"set","p":"lang","pt":"msg","to":"en-US","tot":"str"},{"t":"set","p":"units","pt":"msg","to":"m","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":1980,"wires":[["52c9b059.d65c5"]]},{"id":"52c9b059.d65c5","type":"http request","z":"97685053.566a9","name":"Get Current Weather","method":"GET","ret":"obj","url":"https://twcservice.eu-gb.mybluemix.net/api/weather/v1/geocode/{{{lat}}}/{{{lon}}}/observations.json?language={{{lang}}}&units={{{units}}}","tls":"","x":480,"y":1980,"wires":[["c74976d6.636608","ec600831.a9df28"]]},{"id":"c74976d6.636608","type":"change","z":"97685053.566a9","name":"Format forcast","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.observation.(\t\"The current weather at \" & $split(obs_name, '/', 1)[0] & \" is \" & wx_phrase & \t\" with a temperature of \" & temp & \" Celsius. \" & \t(wdir_cardinal = \"CALM\" ? \"It is a calm day.\" : \"The wind is from \" & \t$lookup({\"N\" : \"the North\", \t \"NNE\" : \"North, North East\",\t \"NE\" : \"the North East\",\t \"ENE\" : \"East, North East\",\t \"E\" : \"the East\",\t \"ESE\" : \"East, South East\",\t \"SE\" : \"the South East\",\t \"SSE\" : \"South, South East\",\t \"S\" : \"the South\",\t \"SSW\" : \"South, South West\",\t \"SW\" : \"the South West\",\t \"WSW\" : \"West, South West\",\t \"W\" : \"the West\",\t \"WNW\" : \"West, North West\",\t \"NW\" : \"the North West\",\t \"NNW\" : \"North, North West\"\t }, wdir_cardinal) & \" at \" & wspd & \" km/h.\") & \t(clds in [\"SKC\", \"CLR\", \"SCT\", \"FEW\", \"BKN\", \"OVC\"] ? \t$lookup({\"SKC\" : \" The sky is clear.\", \t \"CLR\" : \" The sky is clear.\", \t \"SCT\" : \" There are scattered clouds.\", \t \"FEW\" : \" There are a few clouds in the sky.\", \t \"BKN\" : \" There are broken clouds.\", \t \"OVC\" : \" Is is overcast.\"} , clds) : \"\")\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":1980,"wires":[["351d2bda.d4621c"]]},{"id":"92b865f7.786828","type":"change","z":"97685053.566a9","name":"Format forcast","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.observation.(\twx_phrase & \t\" with a temperature of \" & temp & \" Celsius. \" & \t(wdir_cardinal = \"CALM\" ? \"It is a calm day.\" : \"The wind is from \" & \t$lookup({\"N\" : \"the North\", \t \"NNE\" : \"North, North East\",\t \"NE\" : \"the North East\",\t \"ENE\" : \"East, North East\",\t \"E\" : \"the East\",\t \"ESE\" : \"East, South East\",\t \"SE\" : \"the South East\",\t \"SSE\" : \"South, South East\",\t \"S\" : \"the South\",\t \"SSW\" : \"South, South West\",\t \"SW\" : \"the South West\",\t \"WSW\" : \"West, South West\",\t \"W\" : \"the West\",\t \"WNW\" : \"West, North West\",\t \"NW\" : \"the North West\",\t \"NNW\" : \"North, North West\"\t }, wdir_cardinal) & \" at \" & wspd & \" km/h.\") & \t(clds in [\"SKC\", \"CLR\", \"SCT\", \"FEW\", \"BKN\", \"OVC\"] ? \t$lookup({\"SKC\" : \" The sky is clear.\", \t \"CLR\" : \" The sky is clear.\", \t \"SCT\" : \" There are scattered clouds.\", \t \"FEW\" : \" There are a few clouds in the sky.\", \t \"BKN\" : \" There are broken clouds.\", \t \"OVC\" : \" Is is overcast.\"} , clds) : \"\")\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":2960,"wires":[["17c45f45.4c9df1"]]},{"id":"54e38cbd.4a7d94","type":"http request","z":"97685053.566a9","name":"Get Current Weather","method":"GET","ret":"obj","url":"https://twcservice.eu-gb.mybluemix.net/api/weather/v1/geocode/{{{lat}}}/{{{lon}}}/observations.json?language={{{lang}}}&units={{{units}}}","tls":"","x":1200,"y":2960,"wires":[["92b865f7.786828"]]},{"id":"c22415f4.3b8788","type":"change","z":"97685053.566a9","name":"Barcelona","rules":[{"t":"set","p":"lat","pt":"msg","to":"41.382","tot":"str"},{"t":"set","p":"lon","pt":"msg","to":"2.177","tot":"str"},{"t":"set","p":"lang","pt":"msg","to":"en-US","tot":"str"},{"t":"set","p":"units","pt":"msg","to":"m","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":2960,"wires":[["54e38cbd.4a7d94"]]},{"id":"17c45f45.4c9df1","type":"template","z":"97685053.566a9","name":"format forecast","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{convData.output.text.0}} {{payload}}, {{convData.output.text.1}}","output":"str","x":1600,"y":2960,"wires":[["1040368a.3eec09"]]},{"id":"5cbde1f2.ac2bb","type":"comment","z":"97685053.566a9","name":"Add basic auth for weather service","info":"Add the credentials for your Weather Data service in to the basic auth settings of the http request node","x":1240,"y":2920,"wires":[]},{"id":"a29ce196.5227a","type":"comment","z":"97685053.566a9","name":"Add basic auth for weather service","info":"Add the credentials for your Weather Data service in to the basic auth settings of the http request node","x":480,"y":2020,"wires":[]},{"id":"edbfc45c.2d2d18","type":"watson-translator","z":"97685053.566a9","name":"en-es","action":"translate","basemodel":"es-en","domain":"conversational","srclang":"en","destlang":"es","password":"ppvbBSSQ3qte","custom":"","domainhidden":"conversational","srclanghidden":"","destlanghidden":"","basemodelhidden":"es-en","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":true,"neural":false,"default-endpoint":true,"service-endpoint":"https://gateway.watsonplatform.net/language-translator/api","x":1150,"y":1740,"wires":[["5c1695d1.13526c","2e3bb6af.a12e72"]]},{"id":"62b2c20e.e02a4c","type":"watson-translator","z":"97685053.566a9","name":"en-fr","action":"translate","basemodel":"es-en","domain":"news","srclang":"en","destlang":"fr","password":"ppvbBSSQ3qte","custom":"","domainhidden":"news","srclanghidden":"en","destlanghidden":"fr","basemodelhidden":"es-en","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":true,"neural":false,"default-endpoint":true,"service-endpoint":"https://gateway.watsonplatform.net/language-translator/api","x":1150,"y":1780,"wires":[["71d5a083.ca687","2e3bb6af.a12e72"]]},{"id":"1399ce4c.ca2512","type":"watson-translator","z":"97685053.566a9","name":"en-pt","action":"translate","basemodel":"es-en","domain":"news","srclang":"en","destlang":"pt","password":"ppvbBSSQ3qte","custom":"","domainhidden":"news","srclanghidden":"en","destlanghidden":"pt","basemodelhidden":"es-en","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":true,"neural":false,"default-endpoint":true,"service-endpoint":"https://gateway.watsonplatform.net/language-translator/api","x":1150,"y":1860,"wires":[["18a6fb94.10a164","2e3bb6af.a12e72"]]},{"id":"66fecf59.79d1a","type":"watson-translator","z":"97685053.566a9","name":"en-it","action":"translate","basemodel":"es-en","domain":"news","srclang":"en","destlang":"it","password":"ppvbBSSQ3qte","custom":"","domainhidden":"news","srclanghidden":"en","destlanghidden":"it","basemodelhidden":"es-en","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":true,"neural":true,"default-endpoint":true,"service-endpoint":"https://gateway.watsonplatform.net/language-translator/api","x":1150,"y":1900,"wires":[["259857c3.58dfe8","2e3bb6af.a12e72"]]},{"id":"71d5a083.ca687","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak French","lang":"fr-FR","langhidden":"fr-FR","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"fr-FR_ReneeVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"X0hRMcBHpPfc","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1420,"y":1780,"wires":[["fe60b6a9.014da"]]},{"id":"5c1695d1.13526c","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak Spanish","lang":"es-LA","langhidden":"es-LA","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"es-LA_SofiaVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"X0hRMcBHpPfc","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1420,"y":1740,"wires":[["fe60b6a9.014da"]]},{"id":"259857c3.58dfe8","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak Italian","lang":"it-IT","langhidden":"it-IT","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"it-IT_FrancescaVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"X0hRMcBHpPfc","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1410,"y":1900,"wires":[["fe60b6a9.014da"]]},{"id":"18a6fb94.10a164","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak Portuguese","lang":"pt-BR","langhidden":"pt-BR","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"pt-BR_IsabelaVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"X0hRMcBHpPfc","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1430,"y":1860,"wires":[["fe60b6a9.014da"]]},{"id":"a1493266.6c451","type":"comment","z":"97685053.566a9","name":"Paste API keys for Translation service","info":"1. Log into Bluemix\n2. Create an instance of the \nWatson Translation service.\n3. Visit the Service Credentials tab\n4. Click on View Credentials\n5. Copy/Paste the password and username into\nthis Node-RED node.","x":1190,"y":1980,"wires":[]},{"id":"1fae06ec.66a349","type":"rpi-dht22","z":"97685053.566a9","name":"","topic":"rpi-dht22","dht":"22","pintype":1,"pin":"15","x":220,"y":2620,"wires":[["f2e35b45.786bf"]]},{"id":"da099f94.ac28f","type":"inject","z":"97685053.566a9","name":"","topic":"","payload":"","payloadType":"str","repeat":"5","crontab":"","once":true,"x":90,"y":2620,"wires":[["1fae06ec.66a349"]]},{"id":"b4572ff6.b613f","type":"change","z":"97685053.566a9","name":"Grey Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"55,55,55","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1560,"wires":[["26640361.bd6cfc"]]},{"id":"50044c9.8cdd3b4","type":"change","z":"97685053.566a9","name":"White Colour","rules":[{"t":"set","p":"payload","pt":"msg","to":"255,255,255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":1440,"wires":[["26640361.bd6cfc"]]},{"id":"45ba25af.430ecc","type":"ui_text","z":"97685053.566a9","group":"ce2fab3f.765e7","order":2,"width":"3","height":"1","name":"","label":"Mode","format":"{{msg.payload}}","layout":"row-spread","x":1530,"y":3180,"wires":[]},{"id":"ebad8d91.87f28","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Word","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":3160,"wires":[["45ba25af.430ecc"]]},{"id":"8c0e541.24daca8","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Conversation","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1360,"y":3200,"wires":[["45ba25af.430ecc"]]},{"id":"149d70af.85078f","type":"ui_button","z":"97685053.566a9","name":"","group":"30d44502.554382","order":4,"width":0,"height":0,"passthru":false,"label":"Ask Watson to Summarise people in this Photo","color":"","bgcolor":"","icon":"","payload":"{\"params\":{\"detect_mode\":\"faces\"}}","payloadType":"json","topic":"","x":200,"y":820,"wires":[["9b0467d2.e00ca8"]]},{"id":"50e0adb7.4dd844","type":"visual-recognition-v3","z":"97685053.566a9","name":"","apikey":"__PWRD__","image-feature":"classifyImage","lang":"en","x":650,"y":920,"wires":[["4ef2ac4.05a99d4"]]},{"id":"8d2750fd.6086d","type":"file in","z":"97685053.566a9","name":"photo.jpg","filename":"/tmp/photo.jpg","format":"","x":480,"y":920,"wires":[["50e0adb7.4dd844"]]},{"id":"723e8c59.3efb24","type":"change","z":"97685053.566a9","name":"Format result","rules":[{"t":"set","p":"template","pt":"msg","to":"result.images.(\t \"\" & \t($exists(faces) \t? (\"People found in the photo
\" & \"Gender | Age |
\" & \t $join(faces.(\"\" & \"\" & $lowercase(gender.gender) & \" (\" & $round(gender.score * 100) & \"%) | \" & age.min & \" - \" & age.max & \" (\" & $round(age.score* 100) & \"%) |
\")) & \"
\") \t: \"No people found
\") \t)","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"\"Test\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":880,"wires":[["b6a68a08.0e5b78","8b52e6a7.aa81c8"]]},{"id":"2c378ace.0380d6","type":"change","z":"97685053.566a9","name":"3","rules":[{"t":"set","p":"template","pt":"msg","to":"3
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":320,"wires":[["3a50b0bb.244dc"]]},{"id":"8fbe4d.0a7461b","type":"change","z":"97685053.566a9","name":"2","rules":[{"t":"set","p":"template","pt":"msg","to":"2
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":360,"wires":[["3a50b0bb.244dc"]]},{"id":"dba3ec73.5ebd","type":"change","z":"97685053.566a9","name":"1","rules":[{"t":"set","p":"template","pt":"msg","to":"1
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":400,"wires":[["3a50b0bb.244dc"]]},{"id":"3a50b0bb.244dc","type":"link out","z":"97685053.566a9","name":"e19a96fd-8a16-4d2a-94a5-ec9056fd921e","links":["f1fb1bba.2f7c58"],"x":1015,"y":340,"wires":[]},{"id":"b9a2b5ab.7a95e8","type":"comment","z":"97685053.566a9","name":"Update dashboard","info":"","x":1130,"y":340,"wires":[]},{"id":"f1fb1bba.2f7c58","type":"link in","z":"97685053.566a9","name":"dashboard photo","links":["3a50b0bb.244dc"],"x":1055,"y":620,"wires":[["d582ac5b.deac88"]]},{"id":"5b063170.35c2d","type":"change","z":"97685053.566a9","name":"","rules":[{"t":"set","p":"template","pt":"msg","to":"
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":660,"wires":[["d582ac5b.deac88"]]},{"id":"93af6a65.425c38","type":"change","z":"97685053.566a9","name":"blank","rules":[{"t":"set","p":"template","pt":"msg","to":"
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":440,"wires":[["3a50b0bb.244dc"]]},{"id":"72dd7c8c.a13624","type":"comment","z":"97685053.566a9","name":"Update senseHAT","info":"","x":1250,"y":280,"wires":[]},{"id":"58eead23.392564","type":"comment","z":"97685053.566a9","name":"If no DHT sensor connected stop inject node","info":"","x":190,"y":2580,"wires":[]},{"id":"f9b94382.8b408","type":"change","z":"97685053.566a9","name":"blank","rules":[{"t":"set","p":"template","pt":"msg","to":"
","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":280,"wires":[["3a50b0bb.244dc"]]},{"id":"f85938fe.3399d8","type":"watson-translator","z":"97685053.566a9","name":"en-de","action":"translate","basemodel":"es-en","domain":"news","srclang":"en","destlang":"de","password":"ppvbBSSQ3qte","custom":"","domainhidden":"news","srclanghidden":"en","destlanghidden":"de","basemodelhidden":"es-en","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":true,"neural":false,"default-endpoint":true,"service-endpoint":"https://gateway.watsonplatform.net/language-translator/api","x":1150,"y":1820,"wires":[["5a354928.f473c8","2e3bb6af.a12e72"]]},{"id":"5a354928.f473c8","type":"watson-text-to-speech","z":"97685053.566a9","name":"Speak German","lang":"de-DE","langhidden":"de-DE","langcustom":"NoCustomisationSetting","langcustomhidden":"","voice":"de-DE_BirgitVoice","voicehidden":"en-US_AllisonVoice","format":"audio/wav","password":"X0hRMcBHpPfc","payload-response":true,"default-endpoint":true,"service-endpoint":"","x":1420,"y":1820,"wires":[["fe60b6a9.014da"]]},{"id":"17622b4.e892dd5","type":"comment","z":"97685053.566a9","name":"Set location for weather","info":"Add the credentials for your Weather Data service in to the basic auth settings of the http request node","x":1060,"y":3000,"wires":[]},{"id":"fa399e9c.6f4bd","type":"comment","z":"97685053.566a9","name":"Set location for weather","info":"Add the credentials for your Weather Data service in to the basic auth settings of the http request node","x":240,"y":1940,"wires":[]},{"id":"39f07a39.58f696","type":"comment","z":"97685053.566a9","name":"rewire through translation?","info":"If you want output in a different language\nrewire the output through one of the translation nodes","x":1150,"y":1660,"wires":[]},{"id":"30d44502.554382","type":"ui_group","z":"","name":"Watson Visual Recognition","tab":"41aa023e.83923c","order":1,"disp":true,"width":"12"},{"id":"fa798db3.ee78e8","type":"ui_group","z":"","name":"Visual Analysis","tab":"41aa023e.83923c","order":2,"disp":true,"width":"10"},{"id":"492ef91b.15913","type":"ui_group","z":"","name":"Audio","tab":"41aa023e.83923c","order":3,"disp":true,"width":"8"},{"id":"ce2fab3f.765e7","type":"ui_group","z":"","name":"Conversation","tab":"41aa023e.83923c","order":4,"disp":true,"width":"8"},{"id":"41aa023e.83923c","type":"ui_tab","z":"","name":"TJBot","icon":"dashboard","order":4}]
--------------------------------------------------------------------------------