forked from tfatykhov/WinkRedNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
winkFreeboards.json
877 lines (877 loc) · 136 KB
/
winkFreeboards.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
[
{
"id": "fe422e63.01bdd",
"type": "comment",
"z": "ba576445.45a898",
"name": "Dynamic freeboard-------------------------------------------------------------------------------------------------------------------------------",
"info": "",
"x": 416,
"y": 23,
"wires": []
},
{
"id": "7f9fef2b.80601",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/red/getFreeboardJson",
"method": "get",
"x": 127,
"y": 68,
"wires": [
[
"a6d162a7.592ea"
]
]
},
{
"id": "964562cd.69baa",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 751,
"y": 69,
"wires": []
},
{
"id": "92c25cff.6d3da",
"type": "json",
"z": "ba576445.45a898",
"name": "",
"x": 584,
"y": 68,
"wires": [
[
"964562cd.69baa"
]
]
},
{
"id": "44b3cc53.bb4c34",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "",
"fieldType": "msg",
"format": "handlebars",
"template": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>Winkboard by Groups</title>\n\t<meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1.0, user-scalable = yes\" />\n <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.11.4/themes/redmond/jquery-ui.css\">\n <script src=\"//code.jquery.com/jquery-1.10.2.js\"></script>\n <script src=\"//code.jquery.com/ui/1.11.4/jquery-ui.js\"></script>\n <link href=\"css/freeboard.min.css\" rel=\"stylesheet\" />\n <script src=\"js/freeboard.thirdparty.min.js\"></script>\n <script type=\"text/javascript\">\n head.js(\"js/freeboard.js\",\"js/freeboard.plugins.min.js\",\"../freeboard_api/datasources\",\n \"lib/js/thirdparty/wink.js\",\n\n // *** Load more plugins here ***\n function(){\n $(function()\n { //DOM Ready\n freeboard.initialize(true);\n\n //var hash = window.location.hash;\n //if (hash !== null) {\n $.get({{context.global.BlueMixUrlBase}}\"/red/getFreeboardJson?auth={{payload.pwd_str}}\", function(data) {\n\t\t\t\t\t\t\t\tvar datap=JSON.parse(data);\n\t\t\t\t\t\t\t\tif (!datap.empty){\n\t\t\t\t\t\t\t\t\tfreeboard.loadDashboard(datap, function() {\n\t\t\t\t\t\t\t\t\t\tfreeboard.setEditing(false);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n });\n //}\n\n });\n });\n </script>\n</head>\n<body>\n<div id=\"board-content\">\n <img id=\"dash-logo\" data-bind=\"attr:{src: header_image}, visible:header_image()\">\n <div class=\"gridster responsive-column-width\">\n <ul data-bind=\"grid: true\">\n </ul>\n </div>\n</div>\n<header id=\"main-header\" data-bind=\"if:allow_edit\">\n <div id=\"admin-bar\">\n <div id=\"admin-menu\">\n <div id=\"board-tools\">\n <h1 id=\"board-logo\" class=\"title bordered\">freeboard</h1>\n <div id=\"board-actions\">\n <ul class=\"board-toolbar vertical\">\n <!--<li data-bind=\"click: loadDashboardFromLocalFile\"><i id=\"full-screen-icon\" class=\"icon-folder-open icon-white\"></i><label id=\"full-screen\">Load Freeboard</label></li>-->\n <li data-bind=\"click: saveDashboard\"><i class=\"icon-download-alt icon-white\"></i><label>Save Freeboard</label></li>\n <li id=\"add-pane\" data-bind=\"click: createPane\"><i class=\"icon-plus icon-white\"></i><label>Add Pane</label></li>\n </ul>\n </div>\n </div>\n <div id=\"datasources\">\n <h2 class=\"title\">DATASOURCES</h2>\n\n <div class=\"datasource-list-container\">\n <table class=\"table table-condensed sub-table\" id=\"datasources-list\" data-bind=\"if: datasources().length\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Last Updated</th>\n <th> </th>\n </tr>\n </thead>\n <tbody data-bind=\"foreach: datasources\">\n <tr>\n <td>\n <span class=\"text-button datasource-name\" data-bind=\"text: name, pluginEditor: {operation: 'edit', type: 'datasource'}\"></span>\n </td>\n <td data-bind=\"text: last_updated\"></td>\n <td>\n <ul class=\"board-toolbar\">\n <li data-bind=\"click: updateNow\"><i class=\"icon-refresh icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'datasource'}\">\n <i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <span class=\"text-button table-operation\" data-bind=\"pluginEditor: {operation: 'add', type: 'datasource'}\">ADD</span>\n </div>\n </div>\n </div>\n\t<div id=\"column-tools\" class=\"responsive-column-width\">\n\t\t<ul class=\"board-toolbar left-columns\">\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnLeft\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnLeft\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t\t<ul class=\"board-toolbar right-columns\">\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnRight\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnRight\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t</div>\n <div id=\"toggle-header\" data-bind=\"click: toggleEditing\">\n <i id=\"toggle-header-icon\" class=\"icon-wrench icon-white\"></i></div>\n</header>\n\n<div style=\"display:hidden\">\n <ul data-bind=\"template: { name: 'pane-template', foreach: panes}\">\n </ul>\n</div>\n\n<script type=\"text/html\" id=\"pane-template\">\n <li data-bind=\"pane: true\">\n <header>\n <h1 data-bind=\"text: title\"></h1>\n <ul class=\"board-toolbar pane-tools\">\n <li data-bind=\"pluginEditor: {operation: 'add', type: 'widget'}\">\n <i class=\"icon-plus icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'pane'}\">\n <i class=\"icon-wrench icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'pane'}\">\n <i class=\"icon-trash icon-white\"></i>\n </li>\n </ul>\n </header>\n <section data-bind=\"foreach: widgets\">\n <div class=\"sub-section\" data-bind=\"css: 'sub-section-height-' + height()\">\n <div class=\"widget\" data-bind=\"widget: true, css:{fillsize:fillSize}\"></div>\n <div class=\"sub-section-tools\">\n <ul class=\"board-toolbar\">\n <!-- ko if:$parent.widgetCanMoveUp($data) -->\n <li data-bind=\"click:$parent.moveWidgetUp\"><i class=\"icon-chevron-up icon-white\"></i></li>\n <!-- /ko -->\n <!-- ko if:$parent.widgetCanMoveDown($data) -->\n <li data-bind=\"click:$parent.moveWidgetDown\"><i class=\"icon-chevron-down icon-white\"></i></li>\n <!-- /ko -->\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'widget'}\"><i class=\"icon-wrench icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'widget'}\"><i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </div>\n </div>\n </section>\n </li>\n</script>\n\n</body>\n</html>\n",
"x": 755.0000152587891,
"y": 130,
"wires": [
[
"c0b2a9c2.3f4d58"
]
]
},
{
"id": "9f4ab280.60b55",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/winkboard",
"method": "post",
"swaggerDoc": "",
"x": 125,
"y": 128,
"wires": [
[
"a44e2543.5bb1d8"
]
]
},
{
"id": "c0b2a9c2.3f4d58",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 915.0000152587891,
"y": 130,
"wires": []
},
{
"id": "a44e2543.5bb1d8",
"type": "function",
"z": "ba576445.45a898",
"name": "",
"func": "if (msg.payload.uid==context.global.WinkUser.uid && msg.payload.pwd==context.global.WinkUser.pwd){\nmsg.statusCode=\"200\";\nmsg.payload={\"pwd_str\":context.global.FREEBOARD_TOKEN}\n} else {\nmsg.statusCode=\"403\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 334.0000305175781,
"y": 127,
"wires": [
[
"ed362673.12c9d8"
]
]
},
{
"id": "2287583e.dd78a8",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/winkboard",
"method": "get",
"swaggerDoc": "",
"x": 121.5,
"y": 196,
"wires": [
[
"a6ade304.59522"
]
]
},
{
"id": "ed362673.12c9d8",
"type": "switch",
"z": "ba576445.45a898",
"name": "",
"property": "statusCode",
"rules": [
{
"t": "eq",
"v": "200"
},
{
"t": "eq",
"v": "403"
}
],
"checkall": "true",
"outputs": 2,
"x": 496.00001525878906,
"y": 128,
"wires": [
[
"44b3cc53.bb4c34"
],
[
"6c2caef2.93d35"
]
]
},
{
"id": "bab3a6f2.454c58",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 919.0000152587891,
"y": 172,
"wires": []
},
{
"id": "6c2caef2.93d35",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "handlebars",
"template": "<html>\n <head>\n <title>Invalid login</title>\n <META http-equiv=\"refresh\" content=\"3;URL=/freeboard/winkboard\">\n </head>\n <body bgcolor=\"#ffffff\">\n <center>Invalid user Id or Password</a>\n </center>\n </body>\n\n</html>",
"x": 757.0000152587891,
"y": 172,
"wires": [
[
"bab3a6f2.454c58"
]
]
},
{
"id": "b6453f6e.49bac",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 907.5000152587891,
"y": 257.5,
"wires": []
},
{
"id": "4d6846ce.b297b8",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "",
"template": "<html>\n<head>\n<style>\n#wrapper { width: 1970px; height: 1080px; padding: 0; overflow: hidden; }\n#scaled-frame { width: 2800px; height: 2400px; border: 0px; color:black; }\n#scaled-frame {\n zoom: 0.71;\n -moz-transform: scale(0.71);\n -moz-transform-origin: 0 0;\n -o-transform: scale(0.71);\n -o-transform-origin: 0 0;\n -webkit-transform: scale(0.71);\n -webkit-transform-origin: 0 0;\n}\n\n@media screen and (-webkit-min-device-pixel-ratio:0) {\n #scaled-frame { zoom: 1; }\n}\n</style>\n</head>\n<body>\n <div id=\"wrapper\">\n <iframe id=\"scaled-frame\" width=100% height=100% src=\"freeboard/winkboardautogroup\"> \n </iframe>\n </div>\n</body>\n</html>\n ",
"x": 757.5000152587891,
"y": 257.5,
"wires": [
[
"b6453f6e.49bac"
]
]
},
{
"id": "e4d50e46.1b2af",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/scaledwinkboard",
"method": "get",
"swaggerDoc": "",
"x": 556.5000152587891,
"y": 257.5,
"wires": [
[
"4d6846ce.b297b8"
]
]
},
{
"id": "a6d162a7.592ea",
"type": "function",
"z": "ba576445.45a898",
"name": "Generate Freeboard",
"func": "if (msg.payload.auth==context.global.FREEBOARD_TOKEN){\nvar pane_idx = {};\nvar freeboard = {}\nfreeboard.version=\"2\";\nfreeboard.allow_edit=false;\nfreeboard.panes=[];\nfreeboard.plugins= [];\nvar i=0;\n\nfreeboard.panes.push( {\n \"title\":\"Time\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.time=i;\n pane_id=i;\n i++;\n\nfreeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"text_widget\",\n \"settings\": {\n \"size\": \"regular\",\n \"value\": \"datasources[\\\"My Clock\\\"][\\\"time_string_value\\\"]\",\n \"animate\": true\n }\n })\nif (typeof context.global.Weather.SunsetHour !== 'undefined')\n{\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Sunrise - Sunset\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseHour\\\"] +\\\":\\\" +(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"] <10 ? \\\"0\\\"+ datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"]) + \\\" AM - \\\" + (datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"] <=12 ? datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"]-12) + \\\":\\\"+(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"]<10 ? \\\"0\\\" + datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"])+\\\" PM\\\"\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n}) \n}\n\n\nif (typeof context.global.Weather.WeatherSummary!== 'undefined')\n{\nfreeboard.panes.push( {\n \"title\":\"Weather\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.weather=i;\n pane_id=i;\n i++;\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Current state\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"WeatherSummary\\\"]\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Temperature\",\n \"value\":\"Math.round((datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"outsideTemp\\\"]-32)*5/9)+ \\\"C / \\\"+ Math.round(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"outsideTemp\\\"]) + \\\"F\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Humidity\",\n \"value\":\"Math.round(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"HumidityOutside\\\"]*100)+ \\\"%\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Cloud Cover\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"CloudCover\\\"]+ \\\"%\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\n}\n\n \n\nfor (var key in context.global.winkState.cameras){\n if( typeof pane_idx.cameras !=='undefined') \n {\n pane_id=pane_idx.cameras; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Cameras\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.cameras=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key ,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n freeboard.panes[pane_id].widgets.push( \n {\n \"type\": \"picture\",\n \"settings\": {\n \"src\": context.global.winkState.cameras[key].url,\n \"refresh\": context.global.winkState.cameras[key].refresh_time\n }\n })\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"html\",\n \"settings\": {\n \"html\": \"<p>\\n<a href=\\\"#\\\" onclick=\\\"window.open('\"+context.global.winkState.cameras[key].history_url+\"', '\"+key+\" History', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=yes' )\\\">History</a>\\n</p>\",\n \"height\": 1\n }\n }) \n }\n\nfor (var key in context.global.winkState.sensor_pods)\n{\n // node.warn(key+\" \"+ context.global.winkDevCap[key].sensor_types)\n //pane_id=4;\n if (typeof context.global.winkState.sensor_pods[key].motion !== 'undefined') \n { \n if( typeof pane_idx.motion !=='undefined') \n {\n pane_id=pane_idx.motion; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Motion Sensors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.motion=i;\n pane_id=i;\n i++;\n }\n } else if (typeof context.global.winkState.sensor_pods[key].opened !== 'undefined') \n {\n if( typeof pane_idx.trippers !=='undefined') \n {\n pane_id=pane_idx.trippers; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Trippers\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.trippers=i;\n pane_id=i;\n i++;\n }\n\n } else\n {\n //other sensors pane\n if( typeof pane_idx.other !=='undefined') \n {\n pane_id=pane_idx.other; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Multi Sensors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.other=i;\n pane_id=i;\n i++;\n }\n }\n if(key in context.global.winkDevCap && context.global.winkDevCap[key].fields)\n {\n for (s=0; s<context.global.winkDevCap[key].fields.length;s++)\n {\n var field=context.global.winkDevCap[key].fields[s].field\n if( context.global.winkState.sensor_pods[key][field] !== null)\n {\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key + \" \" + field.replace(\"_\",\" \").replace(/opened|detected|motion|state/,\"\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\"\n }\n })\n }\n }\n }\n} //end sensor pods\n//i=0;\nfor (var key in context.global.winkState.binary_switches)\n{\n var lbulb=context.global.winkState.binary_switches[key]\n if( typeof pane_idx.lights !=='undefined') \n {\n pane_id=pane_idx.lights; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Lights and Switches\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.lights=i;\n pane_id=i;\n i++;\n }\n \n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n// freeboard.panes[pane_id].widgets.push(\n// {\n// \"type\": \"html\",\n// \"settings\": {\n// \"html\": \"<style> #slider_\"+lbulb.object_id + \"{ background: #729fcf; margin: 10px; border-color: #729fcf; }\\t</style> \\n<div id=\\\"slider_\"+lbulb.object_id+\"\\\"></div><br><br>\\n<script>\\n $( \\\"#slider_\"+lbulb.object_id+\"\\\" ).slider({step:100, value:\"+(lbulb.powered ? 100 : 0)+ \",orientation: \\\"horizontal\\\",range: \\\"min\\\",animate: false,stop : function (e,ui) { $.post( \\\"/red/ifttt\\\", {\\\"winkName\\\":\\\"\"+lbulb.name+\"\\\",\\\"type\\\":\\\"light\\\",\\\"cmd\\\":(ui.value>0 ? 'on' : 'off' ),\\\"level\\\":ui.value , \\\"iftttkey\\\" : \\\"\"+context.global.IFTTT_TOKEN+\"\\\"})} \\n});\\n</script>\",\n// \"height\": 1\n// }\n// })\n}// end bin switches\n\nfor (var key in context.global.winkState.light_bulbs)\n{\n var lbulb=context.global.winkState.light_bulbs[key]\n if( typeof pane_idx.lights !=='undefined') \n {\n pane_id=pane_idx.lights; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Lights and Switches\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.lights=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n \n// freeboard.panes[pane_id].widgets.push(\n// {\n// \"type\": \"html\",\n// \"settings\": {\n// \"html\": \" <style> #slider_\"+lbulb.object_id + \"{ background: #729fcf; margin: 10px; border-color: #729fcf; }\\t</style> \\n<div id=\\\"slider_\"+lbulb.object_id+\"\\\"></div><br><br>\\n<script>\\n$( \\\"#slider_\"+lbulb.object_id+\"\\\" ).slider({value:\"+(lbulb.powered ? lbulb.brightness*100 : 0)+ \",orientation: \\\"horizontal\\\",range: \\\"min\\\",animate: false,stop : function (e,ui) { $.post( \\\"/red/ifttt\\\", {\\\"winkName\\\":\\\"\"+lbulb.name+\"\\\",\\\"type\\\":\\\"light\\\",\\\"cmd\\\":(ui.value>0 ? 'on' : 'off' ),\\\"level\\\":ui.value , \\\"iftttkey\\\" : \\\"\"+context.global.IFTTT_TOKEN+\"\\\"})} \\n});\\n</script>\",\n// \"height\": 1\n// }\n// })\n} // end light bulbs\n\nfor (var key in context.global.winkState.powerstrips)\n{\n if( typeof pane_idx.powerstrips !=='undefined') \n {\n pane_id=pane_idx.powerstrips; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Powerstrips\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.powerstrips=i;\n pane_id=i;\n i++;\n }\n if (typeof context.global.winkState.powerstrips[key].powered !== 'undefined'){\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n }\n} // end light bulbs\n\nfor (var key in context.global.winkState.locks)\n{\n if( typeof pane_idx.locks !=='undefined') \n {\n pane_id=pane_idx.locks; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Locks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.locks=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n if (typeof context.global.winkState.locks[key].battery !== 'undefined')\n {\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + \" battery\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n}\n} //end locks\nfor (var key in context.global.winkState.smoke_detectors)\n{\n if( typeof pane_idx.smoke !=='undefined') \n {\n pane_id=pane_idx.smoke; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Smoke Detectors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.smoke=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.smoke_detectors[key].connection ? \" Smoke\" : \" Offline\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\"\n }\n})\n \n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.smoke_detectors[key].connection ? \" CO2\" : \" Offline\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\"\n }\n})\nif (typeof context.global.winkState.smoke_detectors[key].battery !== 'undefined')\n {\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + \" battery\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n}\n} //end smoke detectors\n\nfor (var key in context.global.winkState.thermostats)\n{\n if( typeof pane_idx.tstats !=='undefined') \n {\n pane_id=pane_idx.tstats; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Thermostats\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.tstats=i;\n pane_id=i;\n i++;\n }\n if (context.global.winkState.thermostats[key].max_set_point>0){\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\"\n }\n})}\n\n//if (typeof context.global.winkState.thermostats[key].users_away !== 'undefined')\n// {\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key+\" Current temperature\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\"\n }\n})\n//}\n} //end thermostats\n\nfor (var key in context.global.winkState.air_conditioners)\n{\n if( typeof pane_idx.air_con !=='undefined') \n {\n pane_id=pane_idx.air_con; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Air Conditioners\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.air_con=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key+ ' temperature',\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\"\n }\n\n})\n\n}\n\nfor (var key in context.global.winkState.propane_tanks)\n{\n if( typeof pane_idx.prop_tnk !=='undefined') \n {\n pane_id=pane_idx.prop_tnk; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Propane Tanks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.prop_tnk=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"remaining\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"remaining\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + ' Battery',\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n\n}\n\nfor (var key in context.global.winkState.garage_doors)\n{\n if( typeof pane_idx.garage !=='undefined') \n {\n pane_id=pane_idx.garage; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Garage doors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.garage=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.garage_doors[key].connection ? \" - Online\" : \" - Off\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n \n}\n\nfor (var key in context.global.winkState.piggy_banks)\n{\n if( typeof pane_idx.porky !=='undefined') \n {\n pane_id=pane_idx.porky; //porky banko\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Piggy Banks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.porky=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n \n}\n\n\n\nfor (var key in context.global.winkState.hubs)\n{\n if( typeof pane_idx.hubs !=='undefined') \n {\n pane_id=pane_idx.hubs; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Hubs\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.hubs=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\"\n }\n}\n)\n\nif (context.global.winkState.hubs[key].firmware_version !== null)\n {\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Current firmware\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"][\\\"firmware_version\\\"]\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\n}\n}\nfreeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\": \"Wink API Index\",\n \"size\": \"regular\",\n \"value\": \"datasources[\\\"winkAPI\\\"][\\\"metrics\\\"][0][\\\"data\\\"][287][\\\"value\\\"]\",\n \"sparkline\": true,\n \"animate\": true\n }\n }\n)\n\n\nfor (var key in context.global.Presence){\n if( typeof pane_idx.presence !=='undefined') \n {\n pane_id=pane_idx.presence; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Presence\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.presence=i;\n pane_id=i;\n i++;\n }\n//}\nif( typeof pane_idx.presence !=='undefined'){\n freeboard.panes[pane_idx.presence].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":\"\" ,\n \"value\":\"(datasources[\\\"Node-Red\\\"][\\\"PresenceDetail\\\"][\\\"\" + key + \"\\\"][\\\"home\\\"]==\\\"yes\\\" ? true : false)\",\n \"on_text\":key+\" Home\",\n \"off_text\":key+\" Out\"\n }\n })\n} \n}\n\nvar k=0;\nvar b=0;\nfor (var key in context.global.winkState.robots){\n if (k>9){\n b++; \n k=0;\n \n }\n if( typeof pane_idx['robots'+b] !=='undefined') \n {\n pane_id=pane_idx['robots'+b]; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Robots\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx['robots'+b]=i;\n pane_id=i;\n i++;\n }\n if( typeof pane_idx['robots'+b] !=='undefined'){\n freeboard.panes[pane_idx['robots'+b]].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key,\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"robots\\\"][\\\"\" + key + \"\\\"][\\\"enabled\\\"]\",\n \"on_text\":\"Enabled\",\n \"off_text\":\"Disabled\"\n }\n })\n k++;\n } \n}\n\n\n\n\n\nfreeboard.datasources =\n [\n {\n \"name\": \"Node-Red\",\n \"type\": \"JSON\",\n \"settings\": {\n \"url\": context.global.BlueMixUrlBase+\"/red/getGlobalDataJson\",\n \"use_thingproxy\": true,\n \"refresh\": 2,\n \"method\": \"GET\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer \"+context.global.FREEBOARD_TOKEN\n }\n ],\n \"name\":\"Node-Red\"\n }\n },\n {\n \"name\": \"My Clock\",\n \"type\": \"clock\",\n \"settings\": {\n \"refresh\": 1,\n \"name\": \"My Clock\"\n }\n },\n {\n \"name\": \"winkAPI\",\n \"type\": \"JSON\",\n \"settings\": {\n \"url\": \"https://status.winkapp.com/metrics-display/009ykpcmnm25/day.json\",\n \"use_thingproxy\": true,\n \"refresh\": 300,\n \"method\": \"GET\"\n }\n } \n ]\nfreeboard.columns=i;\nmsg.payload=freeboard;\n}\nelse\n{\n msg.payload=\"Bad request darling\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 378.50006103515625,
"y": 68.5,
"wires": [
[
"92c25cff.6d3da"
]
]
},
{
"id": "12c26e8c.ed3d91",
"type": "function",
"z": "ba576445.45a898",
"name": "Generate Freeboard by Group",
"func": "if (msg.payload.auth ==context.global.FREEBOARD_TOKEN){\nvar pane_idx = {};\nvar freeboard = {}\nvar bulbs = 0;\nfreeboard.version=\"1\";\nfreeboard.allow_edit=false;\nfreeboard.panes=[];\nfreeboard.plugins= [];\nvar i=0;\n\nfreeboard.panes.push( {\n \"title\":\"Time\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.time=i;\n pane_id=i;\n i++;\n\nfreeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"text_widget\",\n \"settings\": {\n \"size\": \"regular\",\n \"value\": \"datasources[\\\"My Clock\\\"][\\\"time_string_value\\\"]\",\n \"animate\": true\n }\n })\nif (typeof context.global.Weather.SunsetHour !== 'undefined')\n{\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Sunrise - Sunset\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseHour\\\"] +\\\":\\\" +(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"] <10 ? \\\"0\\\"+ datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunriseMin\\\"]) + \\\" AM - \\\" + (datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"] <=12 ? datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetHour\\\"]-12) + \\\":\\\"+(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"]<10 ? \\\"0\\\" + datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"] : datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"SunsetMin\\\"])+\\\" PM\\\"\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n}) \n}\n\n\nif (typeof context.global.Weather.WeatherSummary!== 'undefined')\n{\nfreeboard.panes.push( {\n \"title\":\"Weather\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.weather=i;\n pane_id=i;\n i++;\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Current state\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"WeatherSummary\\\"]\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Temperature\",\n \"value\":\"Math.round((datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"outsideTemp\\\"]-32)*5/9)+ \\\"C / \\\"+ Math.round(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"outsideTemp\\\"]) + \\\"F\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Humidity\",\n \"value\":\"Math.round(datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"HumidityOutside\\\"]*100)+ \\\"%\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Cloud Cover\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WeatherData\\\"][\\\"CloudCover\\\"]+ \\\"%\\\"\", \n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\n}\n\n\n\nfor (var key in context.global.winkState.cameras){\n if( typeof pane_idx.cameras !=='undefined') \n {\n pane_id=pane_idx.cameras; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Cameras\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.cameras=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key ,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n freeboard.panes[pane_id].widgets.push( \n {\n \"type\": \"picture\",\n \"settings\": {\n \"src\": context.global.winkState.cameras[key].url,\n \"refresh\": context.global.winkState.cameras[key].refresh_time\n }\n })\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"html\",\n \"settings\": {\n \"html\": \"<p>\\n<button type=\\\"button\\\" onclick=\\\"window.open('\"+context.global.winkState.cameras[key].history_url+\"', '\"+key+\" History', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=yes' )\\\">History</button>\\n</p>\",\n \"height\": 1\n }\n }) \n \n }\n\n\nfor (var key in context.global.winkState.sensor_pods)\n{\n // node.warn(key+\" \"+ context.global.winkDevCap[key].sensor_types)\n //pane_id=4;\n if (typeof context.global.winkState.sensor_pods[key].motion !== 'undefined') \n { \n if( typeof pane_idx.motion !=='undefined') \n {\n pane_id=pane_idx.motion; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Motion Sensors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.motion=i;\n pane_id=i;\n i++;\n }\n } else if (typeof context.global.winkState.sensor_pods[key].opened !== 'undefined') \n {\n if( typeof pane_idx.trippers !=='undefined') \n {\n pane_id=pane_idx.trippers; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Trippers\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.trippers=i;\n pane_id=i;\n i++;\n }\n\n } else\n {\n //other sensors pane\n if( typeof pane_idx.other !=='undefined') \n {\n pane_id=pane_idx.other; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Multi Sensors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.other=i;\n pane_id=i;\n i++;\n }\n }\n if(key in context.global.winkDevCap && context.global.winkDevCap[key].fields)\n {\n for (s=0; s<context.global.winkDevCap[key].fields.length;s++)\n {\n var field=context.global.winkDevCap[key].fields[s].field\n if( context.global.winkState.sensor_pods[key][field] !== null)\n {\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key + \" \" + field.replace(\"_\",\" \").replace(/opened|detected|motion|state/,\"\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"sensor_pods\\\"][\\\"\" + key + \"\\\"],\\\"\" + field +\"\\\")\"\n }\n })\n }\n }\n }\n} //end sensor pods\n//i=0;\n\nfor (var key in context.global.winkState.groups)\n{\n if(key.substring(0,1)!==\".\" && key.substring(0,1)!==\"@\" && context.global.winkState.groups[key].members)\n {\n freeboard.panes.push( {\n \"title\":context.global.winkState.groups[key].name + \" - Lights and Switches\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.key=i;\n pane_id=i;\n i++;\n \n for (var light_bulbs in context.global.winkState.groups[key].members)\n {\n light_type=context.global.winkState.groups[key].members[light_bulbs].object_type\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":light_bulbs,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"\"+light_type+\"\\\"][\\\"\" + light_bulbs + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"\"+light_type+\"\\\"][\\\"\" + light_bulbs + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"\"+light_type+\"\\\"][\\\"\" + light_bulbs + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"\"+light_type+\"\\\"][\\\"\" + light_bulbs + \"\\\"])\"\n }\n })\n bulbs++;\n context.global.winkState[light_type][light_bulbs].freeboard = 1;\n }\n }\n}\n\n\n\nfor (var key in context.global.winkState.binary_switches){\nif (context.global.winkState.binary_switches[key].freeboard && context.global.winkState.binary_switches[key].freeboard!=1)\n{\n if( typeof pane_idx.lights !=='undefined') \n {\n pane_id=pane_idx.lights; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Switches\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.lights=i;\n pane_id=i;\n i++;\n }\n \n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"binary_switches\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n}\n}// end bin switches\n\n\nfor (var key in context.global.winkState.light_bulbs){\nif (context.global.winkState.light_bulbs[key].freeboard && context.global.winkState.light_bulbs[key].freeboard!=1)\n{\n if( typeof pane_idx.lights !=='undefined') \n {\n pane_id=pane_idx.lights; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Lights and Switches\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.lights=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"light_bulbs\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n}\n} // end light bulbs\n\n\nfor (var key in context.global.winkState.powerstrips)\n{\n if( typeof pane_idx.powerstrips !=='undefined') \n {\n pane_id=pane_idx.powerstrips; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Powerstrips\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.powerstrips=i;\n pane_id=i;\n i++;\n }\n if (typeof context.global.winkState.powerstrips[key].powered !== 'undefined'){\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"powerstrips\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n }\n} // end light bulbs\n\nfor (var key in context.global.winkState.locks)\n{\n if( typeof pane_idx.locks !=='undefined') \n {\n pane_id=pane_idx.locks; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Locks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.locks=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n if (typeof context.global.winkState.locks[key].battery !== 'undefined')\n {\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + \" battery\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"locks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n}\n} //end locks\nfor (var key in context.global.winkState.smoke_detectors)\n{\n if( typeof pane_idx.smoke !=='undefined') \n {\n pane_id=pane_idx.smoke; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Smoke Detectors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.smoke=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.smoke_detectors[key].connection ? \" Smoke\" : \" Offline\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"smoke_detected\\\")\"\n }\n})\n \n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.smoke_detectors[key].connection ? \" CO2\" : \" Offline\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"co_detected\\\")\"\n }\n})\nif (typeof context.global.winkState.smoke_detectors[key].battery !== 'undefined')\n {\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + \" battery\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"smoke_detectors\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n}\n} //end smoke detectors\n\nfor (var key in context.global.winkState.thermostats)\n{\n if( typeof pane_idx.tstats !=='undefined') \n {\n pane_id=pane_idx.tstats; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Thermostats\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.tstats=i;\n pane_id=i;\n i++;\n }\n\n//added so thermostats without max_set_point won't show [ecobee sensor compatibility]\nif (context.global.winkState.thermostats[key].max_set_point>0)\n{\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"mode\\\")\"\n }\n })\n}\n//if (typeof context.global.winkState.thermostats[key].users_away !== 'undefined')\n// {\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key+\" Current temperature\",\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"thermostats\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\"\n }\n})\n//}\n} //end thermostats\n\nfor (var key in context.global.winkState.air_conditioners)\n{\n if( typeof pane_idx.air_con !=='undefined') \n {\n pane_id=pane_idx.air_con; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Air Conditioners\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.air_con=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key+ ' temperature',\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"air_conditioners\\\"][\\\"\" + key + \"\\\"],\\\"temperature\\\")\"\n }\n\n})\n\n}\n\nfor (var key in context.global.winkState.propane_tanks)\n{\n if( typeof pane_idx.prop_tnk !=='undefined') \n {\n pane_id=pane_idx.prop_tnk; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Propane Tanks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.prop_tnk=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"remaining\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"remaining\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + ' Battery',\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"propane_tanks\\\"][\\\"\" + key + \"\\\"],\\\"battery\\\")\"\n }\n})\n\n}\n\nfor (var key in context.global.winkState.garage_doors)\n{\n if( typeof pane_idx.garage !=='undefined') \n {\n pane_id=pane_idx.garage; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Garage doors\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.garage=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key + (context.global.winkState.garage_doors[key].connection ? \" - Online\" : \" - Off\"),\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"garage_doors\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n \n}\n\nfor (var key in context.global.winkState.piggy_banks)\n{\n if( typeof pane_idx.porky !=='undefined') \n {\n pane_id=pane_idx.porky; //porky banko\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Piggy Banks\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.porky=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"piggy_banks\\\"][\\\"\" + key + \"\\\"])\"\n }\n})\n \n}\n\n\n\nfor (var key in context.global.winkState.hubs)\n{\n if( typeof pane_idx.hubs !=='undefined') \n {\n pane_id=pane_idx.hubs; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Hubs\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.hubs=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"indicator\",\n \"settings\": {\n \"title\":key,\n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"])\"\n }\n}\n)\n\nif (context.global.winkState.hubs[key].firmware_version !== null)\n {\nfreeboard.panes[pane_id].widgets.push(\n{\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\":\"Current firmware\",\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"hubs\\\"][\\\"\" + key + \"\\\"][\\\"firmware_version\\\"]\",\n \"size\":\"regular\",\n \"animate\":\"true\"\n }\n})\n}\n}\nfreeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"text_widget\",\n \"settings\": {\n \"title\": \"Wink API Index\",\n \"size\": \"regular\",\n \"value\": \"datasources[\\\"winkAPI\\\"][\\\"metrics\\\"][0][\\\"data\\\"][287][\\\"value\\\"]\",\n \"sparkline\": true,\n \"animate\": true\n }\n }\n)\n\nfor (var key in context.global.Presence){\n if( typeof pane_idx.presence !=='undefined') \n {\n pane_id=pane_idx.presence; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Presence\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.presence=i;\n pane_id=i;\n i++;\n }\n//}\nif( typeof pane_idx.presence !=='undefined'){\n freeboard.panes[pane_idx.presence].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":\"\" ,\n \"value\":\"(datasources[\\\"Node-Red\\\"][\\\"PresenceDetail\\\"][\\\"\" + key + \"\\\"][\\\"home\\\"]==\\\"yes\\\" ? true : false)\",\n \"on_text\":key+\" Home\",\n \"off_text\":key+\" Out\"\n }\n })\n} \n}\n\nvar k=0;\nvar b=0;\nfor (var key in context.global.winkState.robots){\n if (k>9){\n b++; \n k=0;\n \n }\n if( typeof pane_idx['robots'+b] !=='undefined') \n {\n pane_id=pane_idx['robots'+b]; //motion\n } else\n {\n freeboard.panes.push( {\n \"title\":\"Robots\",\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx['robots'+b]=i;\n pane_id=i;\n i++;\n }\n if( typeof pane_idx['robots'+b] !=='undefined'){\n freeboard.panes[pane_idx['robots'+b]].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \"title\":key,\n \"value\":\"datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"robots\\\"][\\\"\" + key + \"\\\"][\\\"enabled\\\"]\",\n \"on_text\":\"Enabled\",\n \"off_text\":\"Disabled\"\n }\n })\n k++;\n } \n}\n\n\n\n\nfreeboard.datasources =\n [\n {\n \"name\": \"Node-Red\",\n \"type\": \"JSON\",\n \"settings\": {\n \"url\": context.global.BlueMixUrlBase+\"/red/getGlobalDataJson\",\n \"use_thingproxy\": true,\n \"refresh\": 2,\n \"method\": \"GET\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer \"+context.global.FREEBOARD_TOKEN\n }\n ],\n \"name\":\"Node-Red\"\n }\n },\n {\n \"name\": \"My Clock\",\n \"type\": \"clock\",\n \"settings\": {\n \"refresh\": 1,\n \"name\": \"My Clock\"\n }\n },\n {\n \"name\": \"winkAPI\",\n \"type\": \"JSON\",\n \"settings\": {\n \"url\": \"https://status.winkapp.com/metrics-display/009ykpcmnm25/day.json\",\n \"use_thingproxy\": true,\n \"refresh\": 300,\n \"method\": \"GET\"\n }\n } \n ]\nfreeboard.columns=i;\nmsg.payload=freeboard;\n}\nelse\n{\n msg.payload=\"Bad request darling\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 465,
"y": 324.94451904296875,
"wires": [
[
"e090688.f1f6f98"
]
]
},
{
"id": "49414f12.b6beb",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/red/getFreeboardAutoGroupJson",
"method": "get",
"swaggerDoc": "",
"x": 161.5,
"y": 325.44451904296875,
"wires": [
[
"12c26e8c.ed3d91"
]
]
},
{
"id": "4517ccbe.bae834",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 886.5,
"y": 330.44451904296875,
"wires": []
},
{
"id": "e090688.f1f6f98",
"type": "json",
"z": "ba576445.45a898",
"name": "",
"x": 713.5,
"y": 329.44451904296875,
"wires": [
[
"4517ccbe.bae834"
]
]
},
{
"id": "90e0a147.6f1f6",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "",
"format": "handlebars",
"template": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>Winkboard by Group</title>\n\t<meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1.0, user-scalable = yes\" />\n <link href=\"css/freeboard.min.css\" rel=\"stylesheet\" />\n <script src=\"js/freeboard.thirdparty.min.js\"></script>\n <script type=\"text/javascript\">\n head.js(\"js/freeboard.js\",\"js/freeboard.plugins.min.js\",\"../freeboard_api/datasources\",\n \"lib/js/thirdparty/wink.js\",\"lib/js/thirdparty/jquery-ui.js\",\n\n // *** Load more plugins here ***\n function(){\n $(function()\n { //DOM Ready\n freeboard.initialize(true);\n\n //var hash = window.location.hash;\n //if (hash !== null) {\n $.get({{context.global.BlueMixUrlBase}}\"/red/getFreeboardAutoGroupJson?auth={{payload.pwd_str}}\", function(data) {\n\t\t\t\t\t\t\t\tvar datap=JSON.parse(data);\n\t\t\t\t\t\t\t\tif (!datap.empty){\n\t\t\t\t\t\t\t\t\tfreeboard.loadDashboard(datap, function() {\n\t\t\t\t\t\t\t\t\t\tfreeboard.setEditing(false);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n });\n //}\n\n });\n });\n </script>\n</head>\n<body>\n<div id=\"board-content\">\n <img id=\"dash-logo\" data-bind=\"attr:{src: header_image}, visible:header_image()\">\n <div class=\"gridster responsive-column-width\">\n <ul data-bind=\"grid: true\">\n </ul>\n </div>\n</div>\n\n<header id=\"main-header\" data-bind=\"if:allow_edit\">\n <div id=\"admin-bar\">\n <div id=\"admin-menu\">\n <div id=\"board-tools\">\n <h1 id=\"board-logo\" class=\"title bordered\">freeboard</h1>\n <div id=\"board-actions\">\n <ul class=\"board-toolbar vertical\">\n <!--<li data-bind=\"click: loadDashboardFromLocalFile\"><i id=\"full-screen-icon\" class=\"icon-folder-open icon-white\"></i><label id=\"full-screen\">Load Freeboard</label></li>-->\n <li data-bind=\"click: saveDashboard\"><i class=\"icon-download-alt icon-white\"></i><label>Save Freeboard</label></li>\n <li id=\"add-pane\" data-bind=\"click: createPane\"><i class=\"icon-plus icon-white\"></i><label>Add Pane</label></li>\n </ul>\n </div>\n </div>\n <div id=\"datasources\">\n <h2 class=\"title\">DATASOURCES</h2>\n\n <div class=\"datasource-list-container\">\n <table class=\"table table-condensed sub-table\" id=\"datasources-list\" data-bind=\"if: datasources().length\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Last Updated</th>\n <th> </th>\n </tr>\n </thead>\n <tbody data-bind=\"foreach: datasources\">\n <tr>\n <td>\n <span class=\"text-button datasource-name\" data-bind=\"text: name, pluginEditor: {operation: 'edit', type: 'datasource'}\"></span>\n </td>\n <td data-bind=\"text: last_updated\"></td>\n <td>\n <ul class=\"board-toolbar\">\n <li data-bind=\"click: updateNow\"><i class=\"icon-refresh icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'datasource'}\">\n <i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <span class=\"text-button table-operation\" data-bind=\"pluginEditor: {operation: 'add', type: 'datasource'}\">ADD</span>\n </div>\n </div>\n </div>\n\t<div id=\"column-tools\" class=\"responsive-column-width\">\n\t\t<ul class=\"board-toolbar left-columns\">\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnLeft\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnLeft\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t\t<ul class=\"board-toolbar right-columns\">\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnRight\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnRight\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t</div>\n <div id=\"toggle-header\" data-bind=\"click: toggleEditing\">\n <i id=\"toggle-header-icon\" class=\"icon-wrench icon-white\"></i></div>\n</header>\n\n<div style=\"display:hidden\">\n <ul data-bind=\"template: { name: 'pane-template', foreach: panes}\">\n </ul>\n</div>\n\n<script type=\"text/html\" id=\"pane-template\">\n <li data-bind=\"pane: true\">\n <header>\n <h1 data-bind=\"text: title\"></h1>\n <ul class=\"board-toolbar pane-tools\">\n <li data-bind=\"pluginEditor: {operation: 'add', type: 'widget'}\">\n <i class=\"icon-plus icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'pane'}\">\n <i class=\"icon-wrench icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'pane'}\">\n <i class=\"icon-trash icon-white\"></i>\n </li>\n </ul>\n </header>\n <section data-bind=\"foreach: widgets\">\n <div class=\"sub-section\" data-bind=\"css: 'sub-section-height-' + height()\">\n <div class=\"widget\" data-bind=\"widget: true, css:{fillsize:fillSize}\"></div>\n <div class=\"sub-section-tools\">\n <ul class=\"board-toolbar\">\n <!-- ko if:$parent.widgetCanMoveUp($data) -->\n <li data-bind=\"click:$parent.moveWidgetUp\"><i class=\"icon-chevron-up icon-white\"></i></li>\n <!-- /ko -->\n <!-- ko if:$parent.widgetCanMoveDown($data) -->\n <li data-bind=\"click:$parent.moveWidgetDown\"><i class=\"icon-chevron-down icon-white\"></i></li>\n <!-- /ko -->\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'widget'}\"><i class=\"icon-wrench icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'widget'}\"><i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </div>\n </div>\n </section>\n </li>\n</script>\n\n</body>\n</html>\n",
"x": 756.5,
"y": 397.44451904296875,
"wires": [
[
"93e3d078.6c1c3"
]
]
},
{
"id": "841c19ce.7be3e8",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/winkboardautogroup",
"method": "post",
"swaggerDoc": "",
"x": 157.5,
"y": 395.44451904296875,
"wires": [
[
"c1e20fc6.3e1df"
]
]
},
{
"id": "93e3d078.6c1c3",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 916.5,
"y": 397.44451904296875,
"wires": []
},
{
"id": "c1e20fc6.3e1df",
"type": "function",
"z": "ba576445.45a898",
"name": "",
"func": "if (msg.payload.uid==context.global.WinkUser.uid && msg.payload.pwd==context.global.WinkUser.pwd){\nmsg.statusCode=\"200\";\nmsg.payload={\"pwd_str\":context.global.FREEBOARD_TOKEN}\n} else {\nmsg.statusCode=\"403\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 384.5,
"y": 395.44451904296875,
"wires": [
[
"d89162cd.276ea"
]
]
},
{
"id": "43cb4dcf.bc34b4",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/winkboardautogroup",
"method": "get",
"swaggerDoc": "",
"x": 154,
"y": 463.44451904296875,
"wires": [
[
"ab056e6c.54fa9"
]
]
},
{
"id": "d89162cd.276ea",
"type": "switch",
"z": "ba576445.45a898",
"name": "",
"property": "statusCode",
"rules": [
{
"t": "eq",
"v": "200"
},
{
"t": "eq",
"v": "403"
}
],
"checkall": "true",
"outputs": 2,
"x": 531.5,
"y": 395.44451904296875,
"wires": [
[
"90e0a147.6f1f6"
],
[
"706c16dd.8f93e8"
]
]
},
{
"id": "c6f401f9.390c",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 920.5,
"y": 439.44451904296875,
"wires": []
},
{
"id": "706c16dd.8f93e8",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "handlebars",
"template": "<html>\n <head>\n <title>Invalid login</title>\n <META http-equiv=\"refresh\" content=\"3;URL=/freeboard/winkboardautogroup\">\n </head>\n <body bgcolor=\"#ffffff\">\n <center>Invalid user Id or Password</a>\n </center>\n </body>\n\n</html>",
"x": 758.5,
"y": 439.44451904296875,
"wires": [
[
"c6f401f9.390c"
]
]
},
{
"id": "d24b1c2.f2db4e",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/red/freeboardcamHistJson",
"method": "get",
"swaggerDoc": "",
"x": 134,
"y": 527.3334350585938,
"wires": [
[
"9c661577.6399e8"
]
]
},
{
"id": "9c661577.6399e8",
"type": "function",
"z": "ba576445.45a898",
"name": "Generate Cameras History Feed",
"func": "if (msg.payload.auth ==context.global.FREEBOARD_TOKEN){\nvar cam_array={}\nif ( 'camera_name' in msg.payload && msg.payload.camera_name!==''){\n cam_array[msg.payload.camera_name]=context.global.winkState.cameras[msg.payload.camera_name]\n} else cam_array=context.global.winkState.cameras\nvar pane_idx = {};\nvar freeboard = {}\nfreeboard.version=\"2\";\nfreeboard.allow_edit=false;\nfreeboard.panes=[];\nfreeboard.plugins= [];\nvar i=0;\nfor (var key in cam_array){\n\n if (typeof(context.global.winkState.cameras[key].activities) !=='undefined'){\n var cam_act=context.global.winkState.cameras[key].activities;\n for (var j=0; j<cam_act.length; j++){\n if (cam_act[j].category=='cuepoint'){\n var datetime=new Date(cam_act[j].cuepoint_id*1000+context.global.Weather.Offset*60*60*1000);\n freeboard.panes.push( {\n \"title\":key+' Time: '+datetime.toLocaleString(),\n \"width\":1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_id=i;\n i++;\n freeboard.panes[pane_id].widgets.push( \n {\n \"type\": \"picture\",\n \"settings\": {\n \"src\": encodeURI(cam_act[j].snapshot_url),\n// context.global.BlueMixUrlBase+\"/freeboard/camera?token=\"+context.global.FREEBOARD_TOKEN+\"&id=\"+context.global.winkState.cameras[key].object_id+\"&cuepoint=\"+cam_act[j].cuepoint_id,\n \"refresh\": 0\n }\n })\n if('media_url' in cam_act[j]){\n freeboard.panes[pane_id].widgets.push( \n {\n \"type\": \"html\",\n \"settings\": {\n \"html\":\"<br><p><a target=\\\"_blank\\\" href=\\\"\"+cam_act[j].media_url+\"\\\">Click here to see the video</a></p>\",\n \"height\": 1\n }\n })\n }\n }\n }\n }\n}\n\nfreeboard.datasources =[]\nfreeboard.columns=i;\nmsg.payload=freeboard;\n}\nelse\n{\n msg.payload=\"Bad request darling\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 538.4999847412109,
"y": 526.3334350585938,
"wires": [
[
"1b712215.e48ede"
]
]
},
{
"id": "1b712215.e48ede",
"type": "json",
"z": "ba576445.45a898",
"name": "",
"x": 770.4999847412109,
"y": 525.3334350585938,
"wires": [
[
"db95d6b9.246a28"
]
]
},
{
"id": "db95d6b9.246a28",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 926.4999847412109,
"y": 524.3334350585938,
"wires": []
},
{
"id": "1f92351a.e06dcb",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/cameraHistory",
"method": "post",
"swaggerDoc": "",
"x": 138.5,
"y": 655.3334045410156,
"wires": [
[
"b925e0ca.46da2"
]
]
},
{
"id": "b925e0ca.46da2",
"type": "function",
"z": "ba576445.45a898",
"name": "",
"func": "if ((msg.payload.uid==context.global.WinkUser.uid && msg.payload.pwd==context.global.WinkUser.pwd) || msg.payload.token==context.global.FREEBOARD_TOKEN){\nmsg.statusCode=\"200\";\nmsg.payload.pwd_str=context.global.FREEBOARD_TOKEN\n//if ('camera_name' in msg.payload && msg.payload.camera_name!=='undefined') msg.payload.camera_name=msg.req.body.camera_name\n} else {\nmsg.statusCode=\"403\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 393.50001525878906,
"y": 655.3333740234375,
"wires": [
[
"b495f0ce.4b6a1"
]
]
},
{
"id": "b495f0ce.4b6a1",
"type": "switch",
"z": "ba576445.45a898",
"name": "",
"property": "statusCode",
"rules": [
{
"t": "eq",
"v": "200"
},
{
"t": "eq",
"v": "403"
}
],
"checkall": "true",
"outputs": 2,
"x": 537.5,
"y": 654.3334045410156,
"wires": [
[
"88f5234b.770ae"
],
[
"8f4319a.f70bce8"
]
]
},
{
"id": "88f5234b.770ae",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "",
"format": "handlebars",
"template": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>freeboard</title>\n\t<meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1, user-scalable = yes\" />\n <link href=\"css/freeboard.min.css\" rel=\"stylesheet\" />\n <script src=\"js/freeboard.thirdparty.min.js\"></script>\n\t\n <script type=\"text/javascript\">\n head.js(\"js/freeboard.js\",\"js/freeboard.plugins.min.js\",\"../freeboard_api/datasources\",\n \"lib/js/thirdparty/wink.js\",\n\n // *** Load more plugins here ***\n function(){\n $(function()\n { //DOM Ready\n freeboard.initialize(true);\n\n //var hash = window.location.hash;\n //if (hash !== null) {\n $.get({{context.global.BlueMixUrlBase}}\"/red/freeboardcamHistJson?auth={{payload.pwd_str}}&camera_name={{payload.camera_name}}\", function(data) {\n\t\t\t\t\t\t\t\tvar datap=JSON.parse(data);\n\t\t\t\t\t\t\t\tif (!datap.empty){\n\t\t\t\t\t\t\t\t\tfreeboard.loadDashboard(datap, function() {\n\t\t\t\t\t\t\t\t\t\tfreeboard.setEditing(false);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n });\n //}\n\n });\n });\n </script>\n</head>\n<body>\n<div id=\"board-content\">\n <img id=\"dash-logo\" data-bind=\"attr:{src: header_image}, visible:header_image()\">\n <div class=\"gridster responsive-column-width\">\n <ul data-bind=\"grid: true\">\n </ul>\n </div>\n</div>\n<header id=\"main-header\" data-bind=\"if:allow_edit\">\n <div id=\"admin-bar\">\n <div id=\"admin-menu\">\n <div id=\"board-tools\">\n <h1 id=\"board-logo\" class=\"title bordered\">freeboard</h1>\n <div id=\"board-actions\">\n <ul class=\"board-toolbar vertical\">\n <!--<li data-bind=\"click: loadDashboardFromLocalFile\"><i id=\"full-screen-icon\" class=\"icon-folder-open icon-white\"></i><label id=\"full-screen\">Load Freeboard</label></li>-->\n <li data-bind=\"click: saveDashboard\"><i class=\"icon-download-alt icon-white\"></i><label>Save Freeboard</label></li>\n <li id=\"add-pane\" data-bind=\"click: createPane\"><i class=\"icon-plus icon-white\"></i><label>Add Pane</label></li>\n </ul>\n </div>\n </div>\n <div id=\"datasources\">\n <h2 class=\"title\">DATASOURCES</h2>\n\n <div class=\"datasource-list-container\">\n <table class=\"table table-condensed sub-table\" id=\"datasources-list\" data-bind=\"if: datasources().length\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Last Updated</th>\n <th> </th>\n </tr>\n </thead>\n <tbody data-bind=\"foreach: datasources\">\n <tr>\n <td>\n <span class=\"text-button datasource-name\" data-bind=\"text: name, pluginEditor: {operation: 'edit', type: 'datasource'}\"></span>\n </td>\n <td data-bind=\"text: last_updated\"></td>\n <td>\n <ul class=\"board-toolbar\">\n <li data-bind=\"click: updateNow\"><i class=\"icon-refresh icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'datasource'}\">\n <i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <span class=\"text-button table-operation\" data-bind=\"pluginEditor: {operation: 'add', type: 'datasource'}\">ADD</span>\n </div>\n </div>\n </div>\n\t<div id=\"column-tools\" class=\"responsive-column-width\">\n\t\t<ul class=\"board-toolbar left-columns\">\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnLeft\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnLeft\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t\t<ul class=\"board-toolbar right-columns\">\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnRight\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnRight\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t</div>\n <div id=\"toggle-header\" data-bind=\"click: toggleEditing\">\n <i id=\"toggle-header-icon\" class=\"icon-wrench icon-white\"></i></div>\n</header>\n\n<div style=\"display:hidden\">\n <ul data-bind=\"template: { name: 'pane-template', foreach: panes}\">\n </ul>\n</div>\n\n<script type=\"text/html\" id=\"pane-template\">\n <li data-bind=\"pane: true\">\n <header>\n <h1 data-bind=\"text: title\"></h1>\n <ul class=\"board-toolbar pane-tools\">\n <li data-bind=\"pluginEditor: {operation: 'add', type: 'widget'}\">\n <i class=\"icon-plus icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'pane'}\">\n <i class=\"icon-wrench icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'pane'}\">\n <i class=\"icon-trash icon-white\"></i>\n </li>\n </ul>\n </header>\n <section data-bind=\"foreach: widgets\">\n <div class=\"sub-section\" data-bind=\"css: 'sub-section-height-' + height()\">\n <div class=\"widget\" data-bind=\"widget: true, css:{fillsize:fillSize}\"></div>\n <div class=\"sub-section-tools\">\n <ul class=\"board-toolbar\">\n <!-- ko if:$parent.widgetCanMoveUp($data) -->\n <li data-bind=\"click:$parent.moveWidgetUp\"><i class=\"icon-chevron-up icon-white\"></i></li>\n <!-- /ko -->\n <!-- ko if:$parent.widgetCanMoveDown($data) -->\n <li data-bind=\"click:$parent.moveWidgetDown\"><i class=\"icon-chevron-down icon-white\"></i></li>\n <!-- /ko -->\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'widget'}\"><i class=\"icon-wrench icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'widget'}\"><i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </div>\n </div>\n </section>\n </li>\n</script>\n\n</body>\n</html>\n",
"x": 722.5,
"y": 647.3334045410156,
"wires": [
[
"b6860c13.4979f"
]
]
},
{
"id": "8f4319a.f70bce8",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "handlebars",
"template": "<html>\n <head>\n <title>Invalid login</title>\n <META http-equiv=\"refresh\" content=\"3;URL=/freeboard/camerahistory\">\n </head>\n <body bgcolor=\"#ffffff\">\n <center>Invalid user Id or Password</a>\n </center>\n </body>\n\n</html>",
"x": 719.5,
"y": 687.3334045410156,
"wires": [
[
"140abfc6.ebf54"
]
]
},
{
"id": "b6860c13.4979f",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 875.5,
"y": 648.3334045410156,
"wires": []
},
{
"id": "140abfc6.ebf54",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 876.5,
"y": 687.3334045410156,
"wires": []
},
{
"id": "8a830f05.757cf",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/cameraHistory",
"method": "get",
"swaggerDoc": "",
"x": 127,
"y": 742.3333740234375,
"wires": [
[
"1b94e626.e46b1a"
]
]
},
{
"id": "5bcd653b.a4329c",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/cameraSnapshots",
"method": "get",
"swaggerDoc": "",
"x": 143.00001525878906,
"y": 598.0000610351562,
"wires": [
[
"b925e0ca.46da2"
]
]
},
{
"id": "a631bdac.59ce4",
"type": "function",
"z": "ba576445.45a898",
"name": "Generate cameras ",
"func": "if (msg.payload.auth ==context.global.FREEBOARD_TOKEN){\nvar pane_idx = {};\nvar freeboard = {}\nvar bulbs = 0;\nfreeboard.version=\"1\";\nfreeboard.allow_edit=false;\nfreeboard.panes=[];\nfreeboard.plugins= [];\nvar i=0;\n\nfor (var key in context.global.winkState.cameras){\n {\n freeboard.panes.push( {\n \"title\":key,\n \"width\": 1,\n \"row\": {\n \"3\": 1\n },\n \"col\": {\n \"3\": 1\n },\n \"col_width\": 1,\n widgets:[]\n });\n pane_idx.cameras=i;\n pane_id=i;\n i++;\n }\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"indicator\",\n \"settings\": \n {\n \n \"value\":\"wink.indicator.value(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"on_text\":\"wink.indicator.on_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"off_text\":\"wink.indicator.off_text(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\",\n \"style_element\":\"wink.indicator.style_element(datasources[\\\"Node-Red\\\"] && datasources[\\\"Node-Red\\\"][\\\"WinkData\\\"][\\\"cameras\\\"][\\\"\" + key + \"\\\"])\"\n }\n })\n freeboard.panes[pane_id].widgets.push( \n {\n \"type\": \"picture\",\n \"settings\": {\n \"src\": context.global.winkState.cameras[key].url,\n \"refresh\": context.global.winkState.cameras[key].refresh_time\n }\n })\n freeboard.panes[pane_id].widgets.push(\n {\n \"type\": \"html\",\n \"settings\": {\n \"html\": \"<p>\\n<button type=\\\"button\\\" class=\\\"btn btn-primary btn-md\\\" onclick=\\\"window.open('\"+context.global.winkState.cameras[key].history_url+\"', '\"+key+\" History', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=yes' )\\\">History</button>\\n</p>\",\n \"height\": 1\n }\n }) \n \n }\n\n\n\nfreeboard.datasources =\n [\n {\n \"name\": \"Node-Red\",\n \"type\": \"JSON\",\n \"settings\": {\n \"url\": context.global.BlueMixUrlBase+\"/red/getGlobalDataJson\",\n \"use_thingproxy\": true,\n \"refresh\": 2,\n \"method\": \"GET\",\n \"headers\": [\n {\n \"name\": \"Authorization\",\n \"value\": \"Bearer \"+context.global.FREEBOARD_TOKEN\n }\n ],\n \"name\":\"Node-Red\"\n }\n }\n ]\nfreeboard.columns=i;\nmsg.payload=freeboard;\n}\nelse\n{\n msg.payload=\"Bad request darling\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 475.60418701171875,
"y": 823.111083984375,
"wires": [
[
"c2f5e222.3d0a2"
]
]
},
{
"id": "e84fc4a6.17b038",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/red/getFreeboardCamerasJson",
"method": "get",
"swaggerDoc": "",
"x": 158.10418701171875,
"y": 823.611083984375,
"wires": [
[
"a631bdac.59ce4"
]
]
},
{
"id": "99aa7314.66559",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 866.1041870117188,
"y": 822.611083984375,
"wires": []
},
{
"id": "c2f5e222.3d0a2",
"type": "json",
"z": "ba576445.45a898",
"name": "",
"x": 719.1041870117188,
"y": 824.611083984375,
"wires": [
[
"99aa7314.66559"
]
]
},
{
"id": "ed8c20dc.1273e",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "",
"format": "handlebars",
"template": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <title>freeboard</title>\n\t<meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1.0, user-scalable = yes\" />\n <link href=\"css/freeboard.min.css\" rel=\"stylesheet\" />\n <script src=\"js/freeboard.thirdparty.min.js\"></script>\n <script type=\"text/javascript\">\n head.js(\"js/freeboard.js\",\"js/freeboard.plugins.min.js\",\"../freeboard_api/datasources\",\n \"lib/js/thirdparty/wink.js\",\n\n // *** Load more plugins here ***\n function(){\n $(function()\n { //DOM Ready\n freeboard.initialize(true);\n\n //var hash = window.location.hash;\n //if (hash !== null) {\n $.get({{context.global.BlueMixUrlBase}}\"/red/getFreeboardCamerasJson?auth={{payload.pwd_str}}\", function(data) {\n\t\t\t\t\t\t\t\tvar datap=JSON.parse(data);\n\t\t\t\t\t\t\t\tif (!datap.empty){\n\t\t\t\t\t\t\t\t\tfreeboard.loadDashboard(datap, function() {\n\t\t\t\t\t\t\t\t\t\tfreeboard.setEditing(false);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n });\n //}\n\n });\n });\n </script>\n</head>\n<body>\n<div id=\"board-content\">\n <img id=\"dash-logo\" data-bind=\"attr:{src: header_image}, visible:header_image()\">\n <div class=\"gridster responsive-column-width\">\n <ul data-bind=\"grid: true\">\n </ul>\n </div>\n</div>\n\n<header id=\"main-header\" data-bind=\"if:allow_edit\">\n <div id=\"admin-bar\">\n <div id=\"admin-menu\">\n <div id=\"board-tools\">\n <h1 id=\"board-logo\" class=\"title bordered\">freeboard</h1>\n <div id=\"board-actions\">\n <ul class=\"board-toolbar vertical\">\n <!--<li data-bind=\"click: loadDashboardFromLocalFile\"><i id=\"full-screen-icon\" class=\"icon-folder-open icon-white\"></i><label id=\"full-screen\">Load Freeboard</label></li>-->\n <li data-bind=\"click: saveDashboard\"><i class=\"icon-download-alt icon-white\"></i><label>Save Freeboard</label></li>\n <li id=\"add-pane\" data-bind=\"click: createPane\"><i class=\"icon-plus icon-white\"></i><label>Add Pane</label></li>\n </ul>\n </div>\n </div>\n <div id=\"datasources\">\n <h2 class=\"title\">DATASOURCES</h2>\n\n <div class=\"datasource-list-container\">\n <table class=\"table table-condensed sub-table\" id=\"datasources-list\" data-bind=\"if: datasources().length\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Last Updated</th>\n <th> </th>\n </tr>\n </thead>\n <tbody data-bind=\"foreach: datasources\">\n <tr>\n <td>\n <span class=\"text-button datasource-name\" data-bind=\"text: name, pluginEditor: {operation: 'edit', type: 'datasource'}\"></span>\n </td>\n <td data-bind=\"text: last_updated\"></td>\n <td>\n <ul class=\"board-toolbar\">\n <li data-bind=\"click: updateNow\"><i class=\"icon-refresh icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'datasource'}\">\n <i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <span class=\"text-button table-operation\" data-bind=\"pluginEditor: {operation: 'add', type: 'datasource'}\">ADD</span>\n </div>\n </div>\n </div>\n\t<div id=\"column-tools\" class=\"responsive-column-width\">\n\t\t<ul class=\"board-toolbar left-columns\">\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnLeft\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnLeft\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t\t<ul class=\"board-toolbar right-columns\">\n\t\t\t<li class=\"column-tool sub\" data-bind=\"click: subGridColumnRight\"><span class=\"column-icon right\"></span><i class=\"icon-arrow-left icon-white\"></i></li>\n\t\t\t<li class=\"column-tool add\" data-bind=\"click: addGridColumnRight\"><span class=\"column-icon left\"></span><i class=\"icon-arrow-right icon-white\"></i></li>\n\t\t</ul>\n\t</div>\n <div id=\"toggle-header\" data-bind=\"click: toggleEditing\">\n <i id=\"toggle-header-icon\" class=\"icon-wrench icon-white\"></i></div>\n</header>\n\n<div style=\"display:hidden\">\n <ul data-bind=\"template: { name: 'pane-template', foreach: panes}\">\n </ul>\n</div>\n\n<script type=\"text/html\" id=\"pane-template\">\n <li data-bind=\"pane: true\">\n <header>\n <h1 data-bind=\"text: title\"></h1>\n <ul class=\"board-toolbar pane-tools\">\n <li data-bind=\"pluginEditor: {operation: 'add', type: 'widget'}\">\n <i class=\"icon-plus icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'pane'}\">\n <i class=\"icon-wrench icon-white\"></i>\n </li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'pane'}\">\n <i class=\"icon-trash icon-white\"></i>\n </li>\n </ul>\n </header>\n <section data-bind=\"foreach: widgets\">\n <div class=\"sub-section\" data-bind=\"css: 'sub-section-height-' + height()\">\n <div class=\"widget\" data-bind=\"widget: true, css:{fillsize:fillSize}\"></div>\n <div class=\"sub-section-tools\">\n <ul class=\"board-toolbar\">\n <!-- ko if:$parent.widgetCanMoveUp($data) -->\n <li data-bind=\"click:$parent.moveWidgetUp\"><i class=\"icon-chevron-up icon-white\"></i></li>\n <!-- /ko -->\n <!-- ko if:$parent.widgetCanMoveDown($data) -->\n <li data-bind=\"click:$parent.moveWidgetDown\"><i class=\"icon-chevron-down icon-white\"></i></li>\n <!-- /ko -->\n <li data-bind=\"pluginEditor: {operation: 'edit', type: 'widget'}\"><i class=\"icon-wrench icon-white\"></i></li>\n <li data-bind=\"pluginEditor: {operation: 'delete', type: 'widget'}\"><i class=\"icon-trash icon-white\"></i></li>\n </ul>\n </div>\n </div>\n </section>\n </li>\n</script>\n\n</body>\n</html>\n",
"x": 729.6041870117188,
"y": 890.111083984375,
"wires": [
[
"8fcab9cc.703548"
]
]
},
{
"id": "8fcab9cc.703548",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 889.6041870117188,
"y": 890.111083984375,
"wires": []
},
{
"id": "46260735.b9d9f8",
"type": "function",
"z": "ba576445.45a898",
"name": "",
"func": "if ((msg.payload.uid==context.global.WinkUser.uid && msg.payload.pwd==context.global.WinkUser.pwd) || msg.payload.token==context.global.FREEBOARD_TOKEN){\nmsg.statusCode=\"200\";\nmsg.payload={\"pwd_str\":context.global.FREEBOARD_TOKEN}\n} else {\nmsg.statusCode=\"403\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 357.60418701171875,
"y": 888.111083984375,
"wires": [
[
"b8d6727d.47299"
]
]
},
{
"id": "afe32d8c.501cd",
"type": "http in",
"z": "ba576445.45a898",
"name": "",
"url": "/freeboard/cameras",
"method": "get",
"swaggerDoc": "",
"x": 119.10418701171875,
"y": 884.111083984375,
"wires": [
[
"46260735.b9d9f8"
]
]
},
{
"id": "b8d6727d.47299",
"type": "switch",
"z": "ba576445.45a898",
"name": "",
"property": "statusCode",
"rules": [
{
"t": "eq",
"v": "200"
},
{
"t": "eq",
"v": "403"
}
],
"checkall": "true",
"outputs": 2,
"x": 504.60418701171875,
"y": 888.111083984375,
"wires": [
[
"ed8c20dc.1273e"
],
[
"e23c937b.1dc37"
]
]
},
{
"id": "20575ef6.dfa8a2",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 893.6041870117188,
"y": 932.111083984375,
"wires": []
},
{
"id": "e23c937b.1dc37",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "handlebars",
"template": "<html>\n <head>\n <title>Invalid login</title>\n <META http-equiv=\"refresh\" content=\"3;URL=/freeboard/winkboardautogroup\">\n </head>\n <body bgcolor=\"#ffffff\">\n <center>Invalid user Id or Password</a>\n </center>\n </body>\n\n</html>",
"x": 731.6041870117188,
"y": 932.111083984375,
"wires": [
[
"20575ef6.dfa8a2"
]
]
},
{
"id": "a6ade304.59522",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "html",
"template": "\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1, user-scalable = yes\" />\n <title>Home Dashboard</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap/css/bootstrap.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"font-awesome/css/font-awesome.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"css/local.css\" />\n <script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n <script type=\"text/javascript\" src=\"bootstrap/js/bootstrap.min.js\"></script>\n <script type=\"text/javascript\" src=\"//www.prepbootstrap.com/Content/js/gridData.js\"></script>\n</head>\n<body>\n<div class=\"container\">\n<form role=\"form\" action=\"/freeboard/winkboard\" method=\"POST\"> \n\n <div class=\"col-lg-6\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3>Please login using Wink app credentials</h3>\n </div> \n <div class=\"panel-body\">\n <div>\n <div class=\"col-md-9\">\n <input type=\"email\" name=\"uid\" class=\"form-control input-lg\" id=\"emailaddress\" placeholder=\"Enter email address\">\n <p class=\"help-block\">\n \n </p>\n </div>\n </div>\n <div>\n <div class=\"col-md-9\">\n <input type=\"password\" name=\"pwd\" class=\"form-control input-lg\" id=\"password\" placeholder=\"Enter Password\">\n <p class=\"help-block\">\n </p>\n </div>\n </div>\n\n <div class=\"col-md-9\">\n <button type=\"submit\" class=\"btn btn-primary btn-lg\">\n Login\n </button>\n </div>\n\n </div> \n </div> \n </div>\n\n</form> \n</div>\n <!-- /#wrapper -->\n\n</body>\n</html>\n",
"x": 329.10418701171875,
"y": 192.11111450195312,
"wires": [
[
"2a93afd5.d56c5"
]
]
},
{
"id": "2a93afd5.d56c5",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 508.10418701171875,
"y": 191.11111450195312,
"wires": []
},
{
"id": "ab056e6c.54fa9",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "html",
"template": "\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1, user-scalable = yes\" />\n <title>Home Dashboard</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap/css/bootstrap.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"font-awesome/css/font-awesome.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"css/local.css\" />\n <script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n <script type=\"text/javascript\" src=\"bootstrap/js/bootstrap.min.js\"></script>\n <script type=\"text/javascript\" src=\"https://www.prepbootstrap.com/Content/js/gridData.js\"></script>\n</head>\n<body>\n<div class=\"container\">\n<form role=\"form\" action=\"/freeboard/winkboardautogroup\" method=\"POST\"> \n\n <div class=\"col-lg-6\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3>Please login using Wink app credentials</h3>\n </div> \n <div class=\"panel-body\">\n <div>\n <div class=\"col-md-9\">\n <input type=\"email\" name=\"uid\" class=\"form-control input-lg\" id=\"emailaddress\" placeholder=\"Enter email address\">\n <p class=\"help-block\">\n \n </p>\n </div>\n </div>\n <div>\n <div class=\"col-md-9\">\n <input type=\"password\" name=\"pwd\" class=\"form-control input-lg\" id=\"password\" placeholder=\"Enter Password\">\n <p class=\"help-block\">\n </p>\n </div>\n </div>\n\n <div class=\"col-md-9\">\n <button type=\"submit\" class=\"btn btn-primary btn-lg\">\n Login\n </button>\n </div>\n\n </div> \n </div> \n </div>\n\n</form> \n</div>\n <!-- /#wrapper -->\n\n</body>\n</html>\n",
"x": 386.10418701171875,
"y": 466.1111145019531,
"wires": [
[
"e5dc6d7c.1a239"
]
]
},
{
"id": "e5dc6d7c.1a239",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 565.1041870117188,
"y": 465.1111145019531,
"wires": []
},
{
"id": "1b94e626.e46b1a",
"type": "template",
"z": "ba576445.45a898",
"name": "",
"field": "payload",
"format": "html",
"template": "\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n\t<meta name=\"mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <meta name=\"viewport\" content = \"width = device-width, initial-scale = 1, user-scalable = yes\" /> \n <title>Home Dashboard</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap/css/bootstrap.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"font-awesome/css/font-awesome.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"css/local.css\" />\n <script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n <script type=\"text/javascript\" src=\"bootstrap/js/bootstrap.min.js\"></script>\n <script type=\"text/javascript\" src=\"https://www.prepbootstrap.com/Content/js/gridData.js\"></script>\n</head>\n<body>\n<div class=\"container\">\n<form role=\"form\" action=\"/freeboard/cameraHistory\" method=\"POST\"> \n\n <div class=\"col-lg-6\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3>Please login using Wink app credentials</h3>\n </div> \n <div class=\"panel-body\">\n <div>\n <div class=\"col-md-9\">\n <input type=\"email\" name=\"uid\" class=\"form-control input-lg\" id=\"emailaddress\" placeholder=\"Enter email address\">\n <p class=\"help-block\">\n \n </p>\n </div>\n </div>\n <div>\n <div class=\"col-md-9\">\n <input type=\"password\" name=\"pwd\" class=\"form-control input-lg\" id=\"password\" placeholder=\"Enter Password\">\n <p class=\"help-block\">\n </p>\n </div>\n </div>\n\n <div class=\"col-md-9\">\n <button type=\"submit\" class=\"btn btn-primary btn-lg\">\n Login\n </button>\n </div>\n\n </div> \n </div> \n </div>\n\n</form> \n</div>\n <!-- /#wrapper -->\n\n</body>\n</html>\n",
"x": 360.10418701171875,
"y": 742.1111145019531,
"wires": [
[
"90d50358.6f2b"
]
]
},
{
"id": "90d50358.6f2b",
"type": "http response",
"z": "ba576445.45a898",
"name": "",
"x": 539.1041870117188,
"y": 741.1111145019531,
"wires": []
},
{
"id": "d29a3f8d.2d65c",
"type": "catch",
"z": "ba576445.45a898",
"name": "",
"x": 111,
"y": 1102,
"wires": [
[
"b3bf7c10.4c408"
]
]
},
{
"id": "b3bf7c10.4c408",
"type": "debug",
"z": "ba576445.45a898",
"name": "",
"active": true,
"console": "false",
"complete": "error",
"x": 311,
"y": 1102,
"wires": []
}
]