Donixon - @AdrianP morning! The new Freeboard l...

@AdrianP morning! The new Freeboard looks great and the IMO setting works like a charm! Question about that; We have some cars that we put onto the chart to follow our own taxis. We use the IMO-only filter, but that will remove our own vessels (they are also in the buddy-list) and also remove the taxis that we put on the chart with nodeRED delta input. I wanted to add an own IMO onto the taxis for example, so it would not filter them out. When I look at the code you put in foor IMO-only filter, it looks like you only check if the "registrations" path is filled. So if I add an object like: {"imo":"IMO xxxxxxx"} onto the taxis, i would suspect that it will work with the filter, no luck. If I go to databrowser, the value would show up with the correct path. Am i missing something, an extra value that is checked? Like ship type or something?
10 Replies
AdrianP
AdrianP2mo ago
I assume that the cars use the vessels context. If so then an IMO registration should be enough. Also the IMO key should be in capitals
Donixon
Donixon2mo ago
This is how i write it to the cars delta
Donixon
Donixon2mo ago
When I check an excisting delta, it also does it this way, so no idea why it doesnt work with the cars.
No description
Donixon
Donixon2mo ago
and here the databrowser of a car. All looks good i think?
No description
AdrianP
AdrianP2mo ago
It all looks good. I'll see if I can reproduce it.
Donixon
Donixon2mo ago
Tried every possible thing , but no luck. Looking forward to your reply @AdrianP oke fixt it, the formating was not correct:
{ "path": "", "value": { "registrations": "IMO 9123456"
} },
I keep forgetting, that when its a single input, the path is empty. Just like the MMSI. Now it works sorry for my missunderstanding! The button somewhat works? - If i open freeboard clean browser, it loads in all vessels - If I toggle the IMO-only the own given IMO to own ships disapear - If I refresh the page with the toggle ON the boats also disapear but when I retoggle it they stay - But the other vessels dont disapear imidiatly but disapear slowly, or just stay; So I dont think the IMO-only toggle works flawless :^)
Donixon
Donixon2mo ago
AdrianP
AdrianP2mo ago
Have made some adjustments and should be fixed in the next release.
Donixon
Donixon2mo ago
Oke, thought I fixed it, but it was just the 'bug' the showed them. Restart full Signla-K docker and didnt inject the 70+ vessel list with an IMO. Now it works 'clean' again. When I test it with injecting just 1 IMO, the stays fast, but the IMO-filter doesnt work. When I fiddle with different paths in 'registrations', the whole filter seems buggy and lagy again. Maybe with the new release, it is fixed! Thanks for the reaction.
{
"path":"",
"value": {
"registrations":
{
"imo":"IMO " + serial
}
},
}
{
"path":"",
"value": {
"registrations":
{
"imo":"IMO " + serial
}
},
}
found the correct way to puth in the custom IMO. It needed an object IN an object. Now it works like intended! A bit complicated that some values works different then others. Alot of reverse engineering with other vessels, to see how they put it in. But works now haha
[{"id":"2c29e5a0b32c4033","type":"split","z":"075d623192a4cbb8","name":"Split Array","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":490,"y":400,"wires":[["59a79a9cbfee678b"]]},{"id":"59a79a9cbfee678b","type":"signalk-send-delta","z":"075d623192a4cbb8","name":"","x":690,"y":400,"wires":[]},{"id":"9f064f3e1ee8d1ef","type":"function","z":"075d623192a4cbb8","name":"IMO","func":"var units = msg.payload.serial;\nvar signalkData = units.map(unit => {\n var serial = unit;\n\n return {\n \"context\": \"vessels.urn:mrn:imo:mmsi:\" + serial,\n \"updates\": [\n {\n \"timestamp\": new Date().toISOString(),\n \"values\": [\n {\n \"path\":\"\",\n \"value\": {\n \"registrations\":\n {\n \"imo\":\"IMO\" + serial\n }\n },\n }\n ]\n }\n ]\n };\n});\n\nmsg.payload = signalkData;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":400,"wires":[["2c29e5a0b32c4033"]]},{"id":"85d041bdcb02656b","type":"inject","z":"075d623192a4cbb8","name":"SHIPS","props":[{"p":"payload"}],"repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"serial\":[\"244660640\"]}","payloadType":"json","x":180,"y":400,"wires":[["9f064f3e1ee8d1ef"]]}]
[{"id":"2c29e5a0b32c4033","type":"split","z":"075d623192a4cbb8","name":"Split Array","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":490,"y":400,"wires":[["59a79a9cbfee678b"]]},{"id":"59a79a9cbfee678b","type":"signalk-send-delta","z":"075d623192a4cbb8","name":"","x":690,"y":400,"wires":[]},{"id":"9f064f3e1ee8d1ef","type":"function","z":"075d623192a4cbb8","name":"IMO","func":"var units = msg.payload.serial;\nvar signalkData = units.map(unit => {\n var serial = unit;\n\n return {\n \"context\": \"vessels.urn:mrn:imo:mmsi:\" + serial,\n \"updates\": [\n {\n \"timestamp\": new Date().toISOString(),\n \"values\": [\n {\n \"path\":\"\",\n \"value\": {\n \"registrations\":\n {\n \"imo\":\"IMO\" + serial\n }\n },\n }\n ]\n }\n ]\n };\n});\n\nmsg.payload = signalkData;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":400,"wires":[["2c29e5a0b32c4033"]]},{"id":"85d041bdcb02656b","type":"inject","z":"075d623192a4cbb8","name":"SHIPS","props":[{"p":"payload"}],"repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"serial\":[\"244660640\"]}","payloadType":"json","x":180,"y":400,"wires":[["9f064f3e1ee8d1ef"]]}]
nodeRED json for the docus
Want results from more Discord servers?
Add your server