Signal K: Adding Keys / new sensor - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3) +--- Thread: Signal K: Adding Keys / new sensor (/showthread.php?tid=5260) |
Signal K: Adding Keys / new sensor - SirReal - 2024-03-17 Hi folks! I'm currently playing with Signal K the first time on a more serious level and I am starting to really enjoy it. I also tried the API to read some values, also to change some values after authentication. As I have a serial protocol which is not supported by OpenPlotter, I need to run Node-RED to grab some UART data and create some jsons based on the information. In this case: My solar charger's information, current, power etc. Long story short: I would like to add this data into Signal K and as I am able to modify keys using the API, I could do it. However, I asked myself if I can create own keys and a new type of data. The API can't create new keys - is there any way to do this with Signal K directly? Thanks! RE: Signal K: Adding Keys / new sensor - PaddyB - 2024-03-17 (2024-03-17, 01:32 PM)SirReal Wrote: Hi folks! Node red will do that for you, send the value as msg.payload and the key as msg.topic to a signalk-send-pathvalue node. You can try using an inject node which lets you set those. Or send a signalk delta json with the new keys in it & signalk will create them. siggK does it all for you Copy & paste this into the data fiddler & click send to server then have a look in the data browser >> [ { "updates": [ { "source": { }, "values": [ { "path": "testing.testing", "value": "Hello world" } ] } ], "context": "vessels.self" } ] RE: Signal K: Adding Keys / new sensor - SirReal - 2024-03-17 okay, thanks again, PaddyB. My try with a simple Insomnia API call didn't let me add something but I tried a specific path, maybe I need to create a complete new one. Thanks! RE: Signal K: Adding Keys / new sensor - SirReal - 2024-03-17 PS: I found the full and delta model explanation - okay, now I got it... The node is much bigger than I thought before and a simple put on an address won't work, you need to put a delta action on the node. Cool that this is existing in Node-RED but I will first try this directly RE: Signal K: Adding Keys / new sensor - PaddyB - 2024-03-17 (2024-03-17, 06:51 PM)SirReal Wrote: PS: I found the full and delta model explanation - okay, now I got it... Heres another handy way to get at sigK deltas in a function node, set up lodash then it can read the values > Code: [ Ain't nuthin node red can't do RE: Signal K: Adding Keys / new sensor - SirReal - 2024-03-17 cool. thanks. Good to know. Just if someone else is reading this: What was confusing me is that HTTP rest calls (PUT) can only change node-paths which are made for that and will do an action afterwards. If you just want to send a sensor's data in, you need a websocket connection to make delta calls. I was not aware of that... RE: Signal K: Adding Keys / new sensor - gildas declercq - 2024-03-18 (2024-03-17, 06:51 PM)SirReal Wrote: PS: I found the full and delta model explanation - okay, now I got it... Hi can you give the URL where you found the full model explanation ? thankx and regards RE: Signal K: Adding Keys / new sensor - SirReal - 2024-04-01 (2024-03-18, 02:46 AM)gildas declercq Wrote:(2024-03-17, 06:51 PM)SirReal Wrote: PS: I found the full and delta model explanation - okay, now I got it... sorry, I did read it just now. Here the link: https://signalk.org/specification/1.7.0/doc/data_model.html |