-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflows.json
More file actions
4173 lines (4173 loc) · 120 KB
/
flows.json
File metadata and controls
4173 lines (4173 loc) · 120 KB
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
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"id": "4cf5bc897925d109",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "df00f52c34ea8f47",
"type": "tab",
"label": "VSS",
"disabled": false,
"info": "",
"env": []
},
{
"id": "7f2a49a791478fb0",
"type": "tab",
"label": "Seat Adjuster",
"disabled": false,
"info": "",
"env": []
},
{
"id": "bdd28665bfe7cc3e",
"type": "tab",
"label": "Update Status",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8893ce2e3bcd6415",
"type": "tab",
"label": "Connections",
"disabled": false,
"info": "",
"env": []
},
{
"id": "544891f94013761e",
"type": "subflow",
"name": "topic filter",
"info": "## MQTT Topic filter\n\n### Description\nFilters messages based on the value of `msg.topic` using standard MQTT topic filter notation.\n* `#` match all\n* `+` match one level\n\n### example filters\n* `home/+/temperature` \n * will match `home/bedroom/temperature`\n * will match `home/livingroom/temperature`\n * will not match `home/room/1/temperature`\n * will not match `room/1/temperature`\n* `home/#` \n * will match `home/location`\n * will match `home/livingroom/temperature`\n * will match `home/livingroom/humidity`\n * will not match `room/1/temperature`\n\n\n### Outputs\n\n#### Output 1 - match\nMessages with a topic that matches the `topic filter` will be sent out this output.\n\n#### Output 2 - no match\nMessages with a topic that does not match the `topic filter` will be sent out this output to permit next level filtering\n",
"category": "function",
"in": [
{
"x": 68,
"y": 80,
"wires": [
{
"id": "1ef13f666f02eb22"
}
]
}
],
"out": [
{
"x": 340,
"y": 48,
"wires": [
{
"id": "1ef13f666f02eb22",
"port": 0
}
]
},
{
"x": 340,
"y": 96,
"wires": [
{
"id": "1ef13f666f02eb22",
"port": 1
}
]
}
],
"env": [
{
"name": "filter",
"type": "str",
"value": "",
"ui": {
"label": {
"en-US": "Topic filter"
},
"type": "input",
"opts": {
"types": [
"str"
]
}
}
},
{
"name": "status",
"type": "bool",
"value": "true",
"ui": {
"label": {
"en-US": "Show topic"
},
"type": "input",
"opts": {
"types": [
"bool"
]
}
}
}
],
"meta": {
"type": "mqtt-topic-filter",
"version": "1.0.0",
"author": "steve-mcl",
"desc": "A node to filter MQTT topics",
"keywords": "mqtt",
"license": "MIT"
},
"color": "#D8BFD8",
"outputLabels": [
"Match",
"No Match"
],
"icon": "font-awesome/fa-filter",
"status": {
"x": 548,
"y": 160,
"wires": [
{
"id": "a9453c972b2e207a",
"port": 0
},
{
"id": "3f82486996b3cfd5",
"port": 0
}
]
}
},
{
"id": "b1b3032b9f41f38c",
"type": "subflow",
"name": "currentstate ⇒ ui list",
"info": "Converts a currentstate object to the UI list format",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "5ca0c68c699fe867"
}
]
}
],
"out": [
{
"x": 720,
"y": 60,
"wires": [
{
"id": "e39adf356d1d037b",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#E2D96E",
"icon": "node-red/swap.svg"
},
{
"id": "f486fb61943eeb89",
"type": "subflow",
"name": "Broker.GetDatapoints",
"info": "# GetDatapoints\n\nRequest a set of datapoints (values)\n\nExpects `msg.payload` to contain an array with multiple VSS signal names or a string containing a single name.\n\nReturns an object containing all the requested datapoints as `msg.payload`.\nIf there is an error, `msg.error` is set to the error description.\n",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "343d49df0601f0d6"
}
]
}
],
"out": [
{
"x": 900,
"y": 60,
"wires": [
{
"id": "e808e6b1a93017c6",
"port": 0
}
]
},
{
"x": 910,
"y": 120,
"wires": [
{
"id": "4744241463197a11",
"port": 0
}
]
}
],
"env": [],
"meta": {
"module": "GetDatapoints",
"license": "Apache-2.0"
},
"color": "#5d8dab",
"inputLabels": [
"payload"
],
"outputLabels": [
"payload",
"error"
],
"icon": "node-red-contrib-grpc/grpc.svg",
"status": {
"x": 940,
"y": 180,
"wires": [
{
"id": "c8f806e6b667dae4",
"port": 0
}
]
}
},
{
"id": "c86786afde87c8e5",
"type": "subflow",
"name": "datapoints ⇒ ui list",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "c7cc1bdeedc97a30"
}
]
}
],
"out": [
{
"x": 720,
"y": 60,
"wires": [
{
"id": "70fd1b3003f70b0b",
"port": 0
}
]
}
],
"env": [],
"meta": {},
"color": "#E2D96E",
"icon": "node-red/swap.svg"
},
{
"id": "d2f09c088927a668",
"type": "subflow",
"name": "datapoints ⇒ ui table",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "9e9a00fa56add8cc"
}
]
}
],
"out": [
{
"x": 720,
"y": 60,
"wires": [
{
"id": "87c9693a47913239",
"port": 0
}
]
}
],
"env": [],
"meta": {
"license": "Apache-2.0"
},
"color": "#E2D96E",
"icon": "node-red/swap.svg"
},
{
"id": "4f41580d2b2e81cf",
"type": "subflow",
"name": "Broker.Subscribe",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "8cbaf8f7c506d7fe"
}
]
}
],
"out": [
{
"x": 920,
"y": 60,
"wires": [
{
"id": "87a5c171fc770428",
"port": 0
}
]
},
{
"x": 930,
"y": 120,
"wires": [
{
"id": "3d9927502d12ba5d",
"port": 0
}
]
}
],
"env": [],
"meta": {
"module": "Subscribe",
"license": "Apache-2.0"
},
"color": "#5d8dab",
"inputLabels": [
"query"
],
"outputLabels": [
"payload",
"error"
],
"icon": "node-red-contrib-grpc/grpc.svg",
"status": {
"x": 960,
"y": 180,
"wires": [
{
"id": "ec790b0f84c62179",
"port": 0
}
]
}
},
{
"id": "f206c2b27c248139",
"type": "subflow",
"name": "parse field",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "fdb285d6f548d25e"
}
]
}
],
"out": [
{
"x": 430,
"y": 40,
"wires": [
{
"id": "fdb285d6f548d25e",
"port": 0
}
]
},
{
"x": 430,
"y": 100,
"wires": [
{
"id": "fdb285d6f548d25e",
"port": 1
}
]
}
],
"env": [],
"meta": {},
"color": "#E2D96E",
"outputLabels": [
"field",
"value"
],
"icon": "node-red/rbe.png",
"status": {
"x": 400,
"y": 160,
"wires": [
{
"id": "fdb285d6f548d25e",
"port": 2
}
]
}
},
{
"id": "2a90df8a197fb8f2",
"type": "subflow",
"name": "Broker.SetDatapoint",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "aa04a728ca96fca7"
}
]
}
],
"out": [
{
"x": 1090,
"y": 120,
"wires": [
{
"id": "c584248d8e09f50e",
"port": 0
},
{
"id": "11db319f92be5c46",
"port": 0
},
{
"id": "68aac2e6408be595",
"port": 0
}
]
}
],
"env": [],
"meta": {
"module": "SetDatapoint",
"license": "Apache-2.0"
},
"color": "#5d8dab",
"outputLabels": [
"error"
],
"icon": "node-red-contrib-grpc/grpc.svg",
"status": {
"x": 1120,
"y": 60,
"wires": [
{
"id": "bbc19ba6b0c31177",
"port": 0
}
]
}
},
{
"id": "194e312172a28c52",
"type": "subflow",
"name": "Broker.GetMetadata",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "b4a4fd3e5067bf61"
}
]
}
],
"out": [
{
"x": 940,
"y": 60,
"wires": [
{
"id": "dea6b502bbea41c8",
"port": 0
}
]
},
{
"x": 930,
"y": 120,
"wires": [
{
"id": "2623110acbc23bc1",
"port": 0
}
]
}
],
"env": [],
"meta": {
"module": "GetMetadata",
"license": "Apache-2.0"
},
"color": "#5d8dab",
"outputLabels": [
"list",
"error"
],
"icon": "node-red-contrib-grpc/grpc.svg",
"status": {
"x": 960,
"y": 180,
"wires": [
{
"id": "f93ed11c4a31355d",
"port": 0
}
]
}
},
{
"id": "3ba7d7d5ee4707e1",
"type": "subflow",
"name": "VAL.Set",
"info": "",
"category": "SDV",
"in": [
{
"x": 60,
"y": 60,
"wires": [
{
"id": "edd6965ab2fc6f0b"
}
]
}
],
"out": [
{
"x": 1290,
"y": 160,
"wires": [
{
"id": "b94efb2bff0d6e7d",
"port": 0
},
{
"id": "bf1747db2b73a08d",
"port": 0
},
{
"id": "17e5cf57d548e040",
"port": 0
}
]
}
],
"env": [],
"meta": {
"module": "VAL.Set",
"license": "Apache-2.0"
},
"color": "#5d8dab",
"outputLabels": [
"error"
],
"icon": "node-red-contrib-grpc/grpc.svg",
"status": {
"x": 1320,
"y": 100,
"wires": [
{
"id": "2e011263cb6fa367",
"port": 0
}
]
}
},
{
"id": "fb585e7f0dd51cfd",
"type": "mqtt-broker",
"name": "leda-mqtt",
"broker": "${MQTT_ADDR}",
"port": "${MQTT_PORT}",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "6bcbe8d24d01e15f",
"type": "ui_base",
"theme": {
"name": "theme-custom",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#0094CE",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#5d8dab",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"customTheme": {
"name": "Leda",
"default": "#4B7930",
"baseColor": "#5d8dab",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"reset": false
},
"themeState": {
"base-color": {
"default": "#4B7930",
"value": "#5d8dab",
"edited": true
},
"page-titlebar-backgroundColor": {
"value": "#5d8dab",
"edited": false
},
"page-backgroundColor": {
"value": "#434954",
"edited": true
},
"page-sidebar-backgroundColor": {
"value": "#383c45",
"edited": true
},
"group-textColor": {
"value": "#8fb0c5",
"edited": false
},
"group-borderColor": {
"value": "#23252a",
"edited": true
},
"group-backgroundColor": {
"value": "#383c45",
"edited": true
},
"widget-textColor": {
"value": "#fafafa",
"edited": true
},
"widget-backgroundColor": {
"value": "#5d8dab",
"edited": false
},
"widget-borderColor": {
"value": "#383c45",
"edited": true
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey",
"palette": "light"
}
},
"site": {
"name": "Leda Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "true",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 48,
"sy": 48,
"gx": 6,
"gy": 6,
"cx": 6,
"cy": 6,
"px": 0,
"py": 0
}
}
},
{
"id": "31b9a607bd7cffa4",
"type": "ui_tab",
"name": "Update Status",
"icon": "system_update",
"order": 4,
"disabled": false,
"hidden": false
},
{
"id": "853f626a78b514a7",
"type": "ui_group",
"name": "Self Update",
"tab": "31b9a607bd7cffa4",
"order": 1,
"disp": true,
"width": "9",
"collapse": false,
"className": ""
},
{
"id": "a17b70ba881ce441",
"type": "ui_group",
"name": "Containers Update",
"tab": "31b9a607bd7cffa4",
"order": 2,
"disp": true,
"width": "9",
"collapse": false,
"className": ""
},
{
"id": "5d06f71eb2d78bfd",
"type": "ui_group",
"name": "Vehicle Update",
"tab": "31b9a607bd7cffa4",
"order": 3,
"disp": true,
"width": "9",
"collapse": false,
"className": ""
},
{
"id": "1f6dc92172f4e94b",
"type": "grpc-server",
"port": "${BROKER_PORT}",
"name": "leda sdv.databroker.v1",
"server": "${BROKER_ADDR}",
"protoFile": "/********************************************************************************\n * Copyright (c) 2022 Contributors to the Eclipse Foundation\n *\n * See the NOTICE file(s) distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Apache License 2.0 which is available at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * SPDX-License-Identifier: Apache-2.0\n ********************************************************************************/\n\nsyntax = \"proto3\";\n\npackage sdv.databroker.v1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// Data type of a signal\n//\n// Protobuf doesn't support int8, int16, uint8 or uint16.\n// These are mapped to sint32 and uint32 respectively.\n//\nenum DataType {\n STRING = 0;\n BOOL = 1;\n INT8 = 2;\n INT16 = 3;\n INT32 = 4;\n INT64 = 5;\n UINT8 = 6;\n UINT16 = 7;\n UINT32 = 8;\n UINT64 = 9;\n FLOAT = 10;\n DOUBLE = 11;\n TIMESTAMP = 12;\n STRING_ARRAY = 20;\n BOOL_ARRAY = 21;\n INT8_ARRAY = 22;\n INT16_ARRAY = 23;\n INT32_ARRAY = 24;\n INT64_ARRAY = 25;\n UINT8_ARRAY = 26;\n UINT16_ARRAY = 27;\n UINT32_ARRAY = 28;\n UINT64_ARRAY = 29;\n FLOAT_ARRAY = 30;\n DOUBLE_ARRAY = 31;\n TIMESTAMP_ARRAY = 32;\n}\n\nenum DatapointError {\n UNKNOWN_DATAPOINT = 0;\n INVALID_TYPE = 1;\n ACCESS_DENIED = 2;\n INTERNAL_ERROR = 3;\n OUT_OF_BOUNDS = 4;\n}\n\nenum EntryType {\n ENTRY_TYPE_UNSPECIFIED = 0;\n ENTRY_TYPE_SENSOR = 1;\n ENTRY_TYPE_ACTUATOR = 2;\n ENTRY_TYPE_ATTRIBUTE = 3;\n}\n\nenum ChangeType {\n STATIC = 0; // Value never changes\n ON_CHANGE = 1; // Updates are provided every time the value changes (i.e.\n // window is open / closed)\n CONTINUOUS = 2; // Value is updated continuously. Broker needs to tell\n // provider the preferred (update) frequency.\n}\n\nmessage StringArray {\n repeated string values = 1;\n}\n\nmessage BoolArray {\n repeated bool values = 1;\n}\n\nmessage Int32Array {\n repeated sint32 values = 1;\n}\n\nmessage Int64Array {\n repeated sint64 values = 1;\n}\n\nmessage Uint32Array {\n repeated uint32 values = 1;\n}\n\nmessage Uint64Array {\n repeated uint64 values = 1;\n}\n\nmessage FloatArray {\n repeated float values = 1;\n}\n\nmessage DoubleArray {\n repeated double values = 1;\n}\n\nmessage Datapoint {\n // Timestamp of the value\n google.protobuf.Timestamp timestamp = 1;\n\n // values\n oneof value {\n Failure failure_value = 10;\n string string_value = 11;\n bool bool_value = 12;\n sint32 int32_value = 13;\n sint64 int64_value = 14;\n uint32 uint32_value = 15;\n uint64 uint64_value = 16;\n float float_value = 17;\n double double_value = 18;\n StringArray string_array = 21;\n BoolArray bool_array = 22;\n Int32Array int32_array = 23;\n Int64Array int64_array = 24;\n Uint32Array uint32_array = 25;\n Uint64Array uint64_array = 26;\n FloatArray float_array = 27;\n DoubleArray double_array = 28;\n }\n\n enum Failure {\n // The data point is known, but doesn't have a valid value\n INVALID_VALUE = 0;\n // The data point is known, but no value is available\n NOT_AVAILABLE = 1;\n // Unknown datapoint\n UNKNOWN_DATAPOINT = 2;\n // Access denied\n ACCESS_DENIED = 3;\n // Unexpected internal error\n INTERNAL_ERROR = 4;\n }\n}\n\nmessage Metadata {\n // Id to be used in \"get\" and \"subscribe\" requests. Ids stay valid during\n // one power cycle, only.\n int32 id = 1;\n EntryType entry_type = 2;\n string name = 4;\n DataType data_type = 5;\n ChangeType change_type = 6; // CONTINUOUS or STATIC or ON_CHANGE\n string description = 7;\n\n // int32 min_update_hz = 10; // Only for CONTINUOUS\n // int32 max_update_hz = 11; // Only for CONTINUOUS\n}\n\nservice Broker {\n // Request a set of datapoints (values)\n //\n // Returns a list of requested data points.\n //\n // InvalidArgument is returned if the request is malformed.\n rpc GetDatapoints(GetDatapointsRequest) returns (GetDatapointsReply);\n\n // Set a datapoint (values)\n rpc SetDatapoints(SetDatapointsRequest) returns (SetDatapointsReply);\n\n // Subscribe to a set of data points or conditional expressions\n // using the Data Broker Query Syntax (described in QUERY.md)\n //\n // Returns a stream of replies.\n //\n // InvalidArgument is returned if the request is malformed.\n rpc Subscribe(SubscribeRequest) returns (stream SubscribeReply);\n\n // Request the metadata of a set of datapoints\n //\n // Returns metadata of the requested data points that exist.\n rpc GetMetadata(GetMetadataRequest) returns (GetMetadataReply);\n}\n\nmessage GetDatapointsRequest {\n // A list of requested data points.\n repeated string datapoints = 1;\n}\n\nmessage GetDatapointsReply {\n // Contains the values of the requested data points.\n // If a requested data point is not available, the corresponding Datapoint\n // will have the respective failure value set.\n map<string, Datapoint> datapoints = 1;\n}\n\nmessage SetDatapointsRequest {\n // A map of data points to set\n map<string, Datapoint> datapoints = 1;\n}\n\nmessage SetDatapointsReply {\n // A map of errors (if any)\n map<string, DatapointError> errors = 1;\n}\n\nmessage SubscribeRequest {\n // Subscribe to a set of data points (or expressions) described\n // by the provided query.\n // The query syntax is a subset of SQL and is described in more\n // detail in the QUERY.md file.\n string query = 2;\n}\n\nmessage SubscribeReply {\n // Contains the fields specified by the query.\n // If a requested data point value is not available, the corresponding\n // Datapoint will have it's respective failure value set.\n map<string, Datapoint> fields = 1;\n}\n\nmessage GetMetadataRequest {\n // Request metadata for a list of data points referenced by their names.\n // e.g. \"Vehicle.Cabin.Seat.Row1.Pos1.Position\" or \"Vehicle.Speed\".\n //\n // If no names are provided, metadata for all known data points will be\n // returned.\n repeated string names = 1;\n}\n\nmessage GetMetadataReply {\n // Contains metadata of the requested data points. If a data point\n // doesn't exist (i.e. not known to the Data Broker) the corresponding\n // Metadata isn't part of the returned list.\n repeated Metadata list = 1;\n}",
"ca": "",
"chain": "",
"key": "",
"mutualTls": false,
"ssl": false,
"selfsigned": false,
"localServer": false
},
{
"id": "6766a5d8d8a377ed",
"type": "ui_tab",
"name": "Dashboard Example",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
},
{
"id": "0b2827de9e647c6b",
"type": "ui_group",
"name": "Simple Datapoint(s) Query",
"tab": "cb4c0e56e5211151",
"order": 1,
"disp": true,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "ff74e0831e03da9e",
"type": "ui_group",
"name": "VSS Dashboard",
"tab": "6766a5d8d8a377ed",
"order": 1,
"disp": false,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "97020d029d45d7c5",
"type": "ui_group",
"name": "Misc. Data",
"tab": "6766a5d8d8a377ed",
"order": 2,
"disp": false,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "cb4c0e56e5211151",
"type": "ui_tab",
"name": "VSS Control",
"icon": "data_usage",
"order": 3,
"disabled": false,
"hidden": false
},
{
"id": "bbd4d084b2393362",
"type": "ui_tab",
"name": "Seat Adjuster",
"icon": "airline_seat_recline_normal",
"order": 2,
"disabled": false,
"hidden": false
},
{
"id": "f841d8649da9f99c",
"type": "ui_group",
"name": "Seat Position",
"tab": "bbd4d084b2393362",
"order": 2,
"disp": false,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "cf8ef45b9e838be2",
"type": "ui_group",
"name": "Set Seat Position",
"tab": "bbd4d084b2393362",
"order": 1,
"disp": false,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "4c084886ec09c806",
"type": "ui_spacer",
"z": "7f2a49a791478fb0",
"name": "spacer",
"group": "cf8ef45b9e838be2",
"order": 8,
"width": "12",
"height": "1"
},
{
"id": "2c78f54e57368ce2",
"type": "ui_spacer",
"z": "7f2a49a791478fb0",
"name": "spacer",
"group": "cf8ef45b9e838be2",
"order": 1,
"width": "12",
"height": "1"
},
{
"id": "d249a213277af7af",
"type": "ui_spacer",
"z": "7f2a49a791478fb0",
"name": "spacer",
"group": "cf8ef45b9e838be2",
"order": 4,
"width": "1",
"height": "2"
},
{
"id": "efe3a0ea76c51e04",
"type": "ui_group",
"name": "Set Datapoint",
"tab": "cb4c0e56e5211151",
"order": 2,
"disp": true,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "c7d41124ecdd2680",
"type": "ui_spacer",
"z": "df00f52c34ea8f47",
"name": "spacer",
"group": "0b2827de9e647c6b",
"order": 4,
"width": "12",
"height": "1"
},
{
"id": "50d859dc3f14ad9a",
"type": "ui_group",
"name": "VSS Table",
"tab": "cb4c0e56e5211151",
"order": 3,
"disp": false,
"width": "24",
"collapse": false,
"className": ""
},
{
"id": "b88a2b3cf1c2a472",
"type": "ui_group",
"name": "GPS Map",
"tab": "6766a5d8d8a377ed",
"order": 3,
"disp": false,
"width": "12",
"collapse": false,
"className": ""
},
{
"id": "81356b1220393dc3",
"type": "grpc-server",
"z": "3ba7d7d5ee4707e1",
"port": "${BROKER_PORT}",
"name": "leda kuksa.val.v1",
"server": "${BROKER_ADDR}",
"protoFile": "/********************************************************************************\n * Copyright (c) 2022 Contributors to the Eclipse Foundation\n *\n * See the NOTICE file(s) distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Apache License 2.0 which is available at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * SPDX-License-Identifier: Apache-2.0\n ********************************************************************************/\n\nsyntax = \"proto3\";\n\npackage kuksa.val.v1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// Describes a VSS entry\n// When requesting an entry, the amount of information returned can\n// be controlled by specifying either a `View` or a set of `Field`s.\nmessage DataEntry {\n // Defines the full VSS path of the entry.\n string path = 1; // [field: FIELD_PATH]\n\n // The value (datapoint)\n Datapoint value = 2; // [field: FIELD_VALUE]\n\n // Actuator target (only used if the entry is an actuator)\n Datapoint actuator_target = 3; // [field: FIELD_ACTUATOR_TARGET]\n\n // Metadata for this entry\n Metadata metadata = 10; // [field: FIELD_METADATA]\n}\n\nmessage Datapoint {\n google.protobuf.Timestamp timestamp = 1;\n\n oneof value {\n string string = 11;\n bool bool = 12;\n sint32 int32 = 13;\n sint64 int64 = 14;\n uint32 uint32 = 15;\n uint64 uint64 = 16;\n float float = 17;\n double double = 18;\n StringArray string_array = 21;\n BoolArray bool_array = 22;\n Int32Array int32_array = 23;\n Int64Array int64_array = 24;\n Uint32Array uint32_array = 25;\n Uint64Array uint64_array = 26;\n FloatArray float_array = 27;\n DoubleArray double_array = 28;\n }\n}\n\nmessage Metadata {\n // Data type\n // The VSS data type of the entry (i.e. the value, min, max etc).\n //\n // NOTE: protobuf doesn't have int8, int16, uint8 or uint16 which means\n // that these values must be serialized as int32 and uint32 respectively.\n DataType data_type = 11; // [field: FIELD_METADATA_DATA_TYPE]\n\n // Entry type\n EntryType entry_type = 12; // [field: FIELD_METADATA_ENTRY_TYPE]\n\n // Description\n // Describes the meaning and content of the entry.\n optional string description = 13; // [field: FIELD_METADATA_DESCRIPTION]\n\n // Comment [optional]\n // A comment can be used to provide additional informal information\n // on a entry.\n optional string comment = 14; // [field: FIELD_METADATA_COMMENT]\n\n // Deprecation [optional]\n // Whether this entry is deprecated. Can contain recommendations of what\n // to use instead.\n optional string deprecation = 15; // [field: FIELD_METADATA_DEPRECATION]\n\n // Unit [optional]\n // The unit of measurement\n optional string unit = 16; // [field: FIELD_METADATA_UNIT]\n\n // Value restrictions [optional]\n // Restrict which values are allowed.\n // Only restrictions matching the DataType {datatype} above are valid.\n ValueRestriction value_restriction = 17; // [field: FIELD_METADATA_VALUE_RESTRICTION]\n\n // Entry type specific metadata\n oneof entry_specific {\n Actuator actuator = 20; // [field: FIELD_METADATA_ACTUATOR]\n Sensor sensor = 30; // [field: FIELD_METADATA_SENSOR]\n Attribute attribute = 40; // [field: FIELD_METADATA_ATTRIBUTE]\n }\n}\n\n///////////////////////\n// Actuator specific fields\nmessage Actuator {\n // Nothing for now\n}\n\n////////////////////////\n// Sensor specific\nmessage Sensor {\n // Nothing for now\n}\n\n////////////////////////\n// Attribute specific\nmessage Attribute {\n // Nothing for now.\n}\n\n// Value restriction\n//\n// One ValueRestriction{type} for each type, since\n// they don't make sense unless the types match\n//\nmessage ValueRestriction {\n oneof type {\n ValueRestrictionString string = 21;\n // For signed VSS integers\n ValueRestrictionInt signed = 22;\n // For unsigned VSS integers\n ValueRestrictionUint unsigned = 23;\n // For floating point VSS values (float and double)\n ValueRestrictionFloat floating_point = 24;\n }\n}\n\nmessage ValueRestrictionInt {\n optional sint64 min = 1;\n optional sint64 max = 2;\n repeated sint64 allowed_values = 3;\n}\n\nmessage ValueRestrictionUint {\n optional uint64 min = 1;\n optional uint64 max = 2;\n repeated uint64 allowed_values = 3;\n}\n\nmessage ValueRestrictionFloat {\n optional double min = 1;\n optional double max = 2;\n\n // allowed for doubles/floats not recommended\n repeated double allowed_values = 3;\n}\n\n// min, max doesn't make much sense for a string\nmessage ValueRestrictionString {\n repeated string allowed_values = 3;\n}\n\n// VSS Data type of a signal\n//\n// Protobuf doesn't support int8, int16, uint8 or uint16.\n// These are mapped to int32 and uint32 respectively.\n//\nenum DataType {\n DATA_TYPE_UNSPECIFIED = 0;\n DATA_TYPE_STRING = 1;\n DATA_TYPE_BOOLEAN = 2;\n DATA_TYPE_INT8 = 3;\n DATA_TYPE_INT16 = 4;\n DATA_TYPE_INT32 = 5;\n DATA_TYPE_INT64 = 6;\n DATA_TYPE_UINT8 = 7;\n DATA_TYPE_UINT16 = 8;\n DATA_TYPE_UINT32 = 9;\n DATA_TYPE_UINT64 = 10;\n DATA_TYPE_FLOAT = 11;\n DATA_TYPE_DOUBLE = 12;\n DATA_TYPE_TIMESTAMP = 13;\n DATA_TYPE_STRING_ARRAY = 20;\n DATA_TYPE_BOOLEAN_ARRAY = 21;\n DATA_TYPE_INT8_ARRAY = 22;\n DATA_TYPE_INT16_ARRAY = 23;\n DATA_TYPE_INT32_ARRAY = 24;\n DATA_TYPE_INT64_ARRAY = 25;\n DATA_TYPE_UINT8_ARRAY = 26;\n DATA_TYPE_UINT16_ARRAY = 27;\n DATA_TYPE_UINT32_ARRAY = 28;\n DATA_TYPE_UINT64_ARRAY = 29;\n DATA_TYPE_FLOAT_ARRAY = 30;\n DATA_TYPE_DOUBLE_ARRAY = 31;\n DATA_TYPE_TIMESTAMP_ARRAY = 32;\n}\n\n// Entry type\nenum EntryType {\n ENTRY_TYPE_UNSPECIFIED = 0;\n ENTRY_TYPE_ATTRIBUTE = 1;\n ENTRY_TYPE_SENSOR = 2;\n ENTRY_TYPE_ACTUATOR = 3;\n}\n\n// A `View` specifies a set of fields which should\n// be populated in a `DataEntry` (in a response message)\nenum View {\n VIEW_UNSPECIFIED = 0; // Unspecified. Equivalent to VIEW_CURRENT_VALUE unless `fields` are explicitly set.\n VIEW_CURRENT_VALUE = 1; // Populate DataEntry with value.\n VIEW_TARGET_VALUE = 2; // Populate DataEntry with actuator target.\n VIEW_METADATA = 3; // Populate DataEntry with metadata.\n VIEW_FIELDS = 10; // Populate DataEntry only with requested fields.\n VIEW_ALL = 20; // Populate DataEntry with everything.\n}\n\n// A `Field` corresponds to a specific field of a `DataEntry`.\n//\n// It can be used to:\n// * populate only specific fields of a `DataEntry` response.\n// * specify which fields of a `DataEntry` should be set as\n// part of a `Set` request.\n// * subscribe to only specific fields of a data entry.\n// * convey which fields of an updated `DataEntry` have changed.\nenum Field {\n FIELD_UNSPECIFIED = 0; // \"*\" i.e. everything\n FIELD_PATH = 1; // path\n FIELD_VALUE = 2; // value\n FIELD_ACTUATOR_TARGET = 3; // actuator_target\n FIELD_METADATA = 10; // metadata.*\n FIELD_METADATA_DATA_TYPE = 11; // metadata.data_type\n FIELD_METADATA_DESCRIPTION = 12; // metadata.description\n FIELD_METADATA_ENTRY_TYPE = 13; // metadata.entry_type\n FIELD_METADATA_COMMENT = 14; // metadata.comment\n FIELD_METADATA_DEPRECATION = 15; // metadata.deprecation\n FIELD_METADATA_UNIT = 16; // metadata.unit\n FIELD_METADATA_VALUE_RESTRICTION = 17; // metadata.value_restriction.*\n FIELD_METADATA_ACTUATOR = 20; // metadata.actuator.*\n FIELD_METADATA_SENSOR = 30; // metadata.sensor.*\n FIELD_METADATA_ATTRIBUTE = 40; // metadata.attribute.*\n}\n\n// Error response shall be an HTTP-like code.\n// Should follow https://www.w3.org/TR/viss2-transport/#status-codes.\nmessage Error {\n uint32 code = 1;\n string reason = 2;\n string message = 3;\n}\n\n// Used in get/set requests to report errors for specific entries\nmessage DataEntryError {\n string path = 1; // vss path\n Error error = 2;\n}\n\nmessage StringArray {\n repeated string values = 1;\n}\n\nmessage BoolArray {\n repeated bool values = 1;\n}\n\nmessage Int32Array {\n repeated sint32 values = 1;\n}\n\nmessage Int64Array {\n repeated sint64 values = 1;\n}\n\nmessage Uint32Array {\n repeated uint32 values = 1;\n}\n\nmessage Uint64Array {\n repeated uint64 values = 1;\n}\n\nmessage FloatArray {\n repeated float values = 1;\n}\n\nmessage DoubleArray {\n repeated double values = 1;\n}\n\n// Note on authorization:\n// Tokens (auth-token or auth-uuid) are sent as (GRPC / http2) metadata.\n//\n// The auth-token is a JWT compliant token as the examples found here:\n// https://github.com/eclipse/kuksa.val/tree/master/kuksa_certificates/jwt\n//\n// See also https://github.com/eclipse/kuksa.val/blob/master/doc/jwt.md\n//\n// Upon reception of auth-token, server shall generate an auth-uuid in metadata\n// that the client can use instead of auth-token in subsequent calls.\n\nservice VAL {\n // Get entries\n rpc Get(GetRequest) returns (GetResponse);\n\n // Set entries\n rpc Set(SetRequest) returns (SetResponse);\n\n // Subscribe to a set of entries\n //\n // Returns a stream of notifications.\n //\n // InvalidArgument is returned if the request is malformed.\n rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);\n\n // Shall return information that allows the client to determine\n // what server/server implementation/version it is talking to\n // eg. kuksa-databroker 0.5.1\n rpc GetServerInfo(GetServerInfoRequest) returns (GetServerInfoResponse);\n}\n\n// Define which data we want\nmessage EntryRequest {\n string path = 1;\n View view = 2;\n repeated Field fields = 3;\n}\n\n// Request a set of entries.\nmessage GetRequest {\n repeated EntryRequest entries = 1;\n}\n\n// Global errors are specified in `error`.\n// Errors for individual entries are specified in `errors`.\nmessage GetResponse {\n repeated DataEntry entries = 1;\n repeated DataEntryError errors = 2;\n Error error = 3;\n}\n\n// Define the data we want to set\nmessage EntryUpdate {\n DataEntry entry = 1;\n repeated Field fields = 2;\n}\n\n// A list of entries to be updated\nmessage SetRequest {\n repeated EntryUpdate updates = 1;\n}\n\n// Global errors are specified in `error`.\n// Errors for individual entries are specified in `errors`.\nmessage SetResponse {\n Error error = 1;\n repeated DataEntryError errors = 2;\n}\n\n// Define what to subscribe to\nmessage SubscribeEntry {\n string path = 1;\n View view = 2;\n repeated Field fields = 3;\n}\n\n// Subscribe to changes in datapoints.\nmessage SubscribeRequest {\n repeated SubscribeEntry entries = 1;\n}\n\n// A subscription response\nmessage SubscribeResponse {\n repeated EntryUpdate updates = 1;\n}\n\nmessage GetServerInfoRequest {\n // Nothing yet\n}\n\nmessage GetServerInfoResponse {\n string name = 1;\n string version = 2;\n}\n",
"ca": "",
"chain": "",
"key": "",
"mutualTls": false,
"ssl": false,
"selfsigned": false,
"localServer": false
},
{
"id": "1ef13f666f02eb22",
"type": "function",
"z": "544891f94013761e",
"name": "filter",
"func": "var a = msg.topic;\nvar b = env.get(\"filter\") || '#';\n\nif(a===b) { return [msg, null]; }\nif(b==='#') { \n if(a) return [msg, null]; //if topic is something, OK\n return [null, msg];//otherwise, fail!\n}\nvar nameSegments = a.split('/');\nvar filterSegments = b.split('/');\nfor (var i = 0; i < filterSegments.length; i++) {\n var topicSegment = nameSegments[i];\n var patternSegment = filterSegments[i];\n var match = false;\n if(topicSegment === patternSegment) { match = true; }\n if(patternSegment === '+') { match = true; }\n if(patternSegment === '#') { return [msg, null]; }\n if(match === false) { return [null, msg]; }\n}\nif(nameSegments.length !== filterSegments.length) { return [null, msg]; }\n\nreturn [msg, null];\n",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 192,
"y": 80,
"wires": [
[],
[]
]
},
{
"id": "d55c5c0a665fdcc9",
"type": "inject",
"z": "544891f94013761e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",