SK
Signal Kβ€’2mo ago
Captain

Captain - I'm thinking of writing a simple plug...

I'm thinking of writing a simple plugin that would give the user a way to calculate synthetic paths based on a simple formula. Something like this:
electrical.dc.0.load.current = (electrical.solar.0.current + electrical.solar.1.current + electrical.alternators.0.current) - electrical.batteries.0.current
electrical.dc.0.load.current = (electrical.solar.0.current + electrical.solar.1.current + electrical.alternators.0.current) - electrical.batteries.0.current
Or maybe a spreadsheet style syntax. I don't want to reinvent the wheel, so before I do this, does anyone know of a better way to achieve that outcome?
5 Replies
PaddyB
PaddyBβ€’2mo ago
I've just been using a little bit of node red but an little app might be nice. Useful thing to keep an eye on. 😎
No description
Teppo Kurki
Teppo Kurkiβ€’2mo ago
I think it is a good idea. You could start simple, like just an array of formula strings & result paths
Captain
CaptainOPβ€’2mo ago
Yes, Node Red can be quite initimidating, I want something simple that anyone can figure out.
Teppo Kurki
Teppo Kurkiβ€’2mo ago
Since schema can be dynamic you could do similar trick like signalk-to-nmea0183 and put debug information in the description in the form of a list of the input paths and then βœ… or ❓to indicate that data is there
Tony
Tonyβ€’2mo ago
This is basically a custom formula. I think it would be extremely valuable to have a formula plugin. You can use math-expression-evaluator to evaluate the generated expression and provide the result as well as a preview of the formula expression Also happy to help with this. I have built a custom formula builder. Yours could be much simpler that only needs to check the path and map it to an expression token

Did you find this page helpful?