The beauty of this solution is you can send MQTT back into SignalK paths and openplotter can then send these back out on the NMEA bus as NMEA PGN’s. So Home Assistant can actually influence NMEA2000 data on proprietary devices.
Blockquote
what about a simple way to take GPS data in the form of a National Marine Electronics Association (NMEA) text stream so my HA in the Overlanding Prius can have GPS from the M2000 5G mobile device? Even better if HA could rebroadcast to other devices/applications like my head unit thats android and on the same wifi network?
Reply on a old post but still a very interesting one. I was trying to get things up and running. I used the plugin SignalK → MQTT home assistant bridge. This appears to connect with my home assistant as in mentions in the MQTT log.
Only this is that i dont see any data. On the SignalK side i used a slef path which is active and has data .
In HA i dont see any sensor or something added in the MQTT area.
Any suggestions
There’s a lot of moving parts, the SignalK plugin only pulls data if running on the OpenPlotter and cannot access the SignalK data if it is on device (when I set it up that was the case, maybe changed since).
I got around this, by using NodeRed on the OpenPlotter. With the Hone Assistant palette installed. Then force HA to create sensors from OpenPlotter with the SignalK data.
Another option is to manually create the sensors for MQTT topic on the Hone Assistant. The reason they don’t automatically appear is because SignalK MQTT data isn’t formed to the auto-discovery JSON format that HA expects for auto creation of sensors. This was how I did it originally, but most values were like m3 instead of L and so on. This is why I used NodeRed because I could convert the values create the HA sensors and debug all in the same interface.
You can subscribe to MQTT # topic and check that the SignalK data is appearing in MQTT it will show all topics on the server.
There are two SignalK plugins to interact with MQTT. There’s the signalk-mqtt-gw, which is the oldest one and it’s been unmaintained for some time now. This is the one that @craigy mentioned in previous posts, and it allows for a simple integration between SignalK and MQTT.
Now there’s another plugin, signalk-mqtt-bridge which I created recently because the original gateway plugin was lacking some key functionality that I needed. The new plugin allows for a more dynamic integration with MQTT, allowing subscribers to select which data they want in MQTT, and also allows for data to flow back into SignalK from MQTT, including sending PUT requests.
From your message I assume you’re referring to this second plugin. If so, you need to understand and use the Keepalive mechanism in order to get some data flowing into the broker. It’s explained in the README here. In short, you need to post a keepalive message into MQTT every ~30 seconds with the topics that you want SignalK to publish. For example, this Home Assistant automation would instruct SignalK to publish all deltas from vessels.self.* to MQTT:
I am trying to get signalk-mqtt-bridge working for a signalk - node-red connection.
In signalk it will send the initial keep alive message that I can then see in MQTT_Explorer. So I know that the plugin is configured and talking to the mqtt broker. In node-red Im sending an mqtt message with R/signalk/f005dc8c4fcd/keepalive as the topic and empty payload. This also shows in the MQTT_Explorer. But no deltas are getting published to mqtt broker. When I look at the signalk logs I’m getting the following error: Can you advise what I may be doing incorrectly? I’d really like to get this working, its exactly what I am looking for. It would allow me to get all my NMEA and Victron data in a consistant way into node_red for processing and feeding Home Assistant as my frontend. Im using on a live-aboard sailboat.
‘Jan 16 09:58:40 TypeError: path.replaceAll is not a function at signalkPathToMqttTopic (/home/pi/.signalk/node_modules/signalk-mqtt-bridge/index.js:323:17) at handleDelta (/home/pi/.signalk/node_modules/signalk-mqtt-bridge/index.js:177:36) at /usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:1048:16 at /usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:463:23 at processAfters (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:359:11) at Object.inTransaction (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:439:9) at Dispatcher.push (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:1214:24) at Dispatcher.handleEvent (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:1267:17) at Bus.sink (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:242:17) at Bus.push (/usr/local/lib/node_modules/signalk-server/node_modules/baconjs/dist/Bacon.js:2371:21) at StreamBundle.push (/usr/local/lib/node_modules/signalk-server/lib/streambundle.js:68:19) at StreamBundle. (/usr/local/lib/node_modules/signalk-server/lib/streambundle.js:36:22) at Array.forEach () at processIems (/usr/local/lib/node_modules/signalk-server/lib/streambundle.js:35:19) at StreamBundle. (/usr/local/lib/node_modules/signalk-server/lib/streambundle.js:55:21) at Array.forEach ()’
That’s an odd error It would seem that SignalK is publishing a delta without a path or with a path property that’s not a string… I’ve never seen that.
To avoid deviating from the current topic of this discussion, I’d suggest you open an issue in the Github repository of the plugin, so it can be checked further.
Information that you could attach to the Github issue:
Which version of NodeJs and SingalK are you using?
Are you seeing anything else in the logs?
Can you think of any data being processed in SignalK that would produce a delta without a path?
I have gotten this set-up to work with the help of this post of the author of plugin signalk-mqtt-bridge (thanks a lot for that! ). Here is the description of the neccessary set-up to connect SignalK with Home Assistant:
I have NOde Red running on both Cerbo GX signal k and node red server, and node red in home assistant, on same LAN, can you help how the two communicate?
@iuri
Hi I can’t get any topic in Home Assistant (I tried with another plugin the mqtt assistant and that works, but topics are separated by dots and having hard time with it).
in MQTT explorer (in HA) the topic ikeepalive s there, but no response from signal k
In signalk plugin configuration
SignalK will use system id 247385xxx, to interact with MQTT
Jan 18 09:24:45 2024-01-18T09:24:45.836Z signalk-mqtt-bridge Plugin stopped
Jan 18 09:24:45 2024-01-18T09:24:45.841Z signalk-mqtt-bridge Plugin starting
Jan 18 09:24:45 POST /skServer/plugins/signalk-mqtt-bridge/config 200 12.947 ms - 50
Jan 18 09:24:46 2024-01-18T09:24:46.016Z signalk-mqtt-bridge MQTT connection closed
Jan 18 09:24:46 2024-01-18T09:24:46.024Z signalk-mqtt-bridge MQTT connected
Jan 18 09:24:48 GET /skServer/debugKeys 304 7.639 ms -
In MQTT explorer you should also see the keepalive advertisement message from SignalK, it should start with an N/ prefix (not R/). That’s also a good way to check which system id signalk is using.
From the looks of it, it might be that SignalK is not recognizing the system id you’re using as its own, and it’s ignoring your keepalive message.
Also, if you’ve enabled debug logs for the SignalK plugin, it should log any messages received through MQTT and the outcome of them. So you should see your keepalive messages logged there.
You could also try to manually send the keepalive message from MQTT explorer directly, to see if the problem is in the HA automation or in SignalK (or MQTT).
Latest BBN Marine OS 2024-04-20 FULL now includes these NMEA 2000 integrations as well as NMEA 0183 TCP. Run the homeassistant-install.sh from add-ons reboot once after configuration of HomeAssistant is complete and you will be able to find these integrations in Settings/Add Integration in HomeAssistant web UI.