AIS-catcher icon indicating copy to clipboard operation
AIS-catcher copied to clipboard

Home Assistant - Addon

Open CzarofAK opened this issue 9 months ago • 14 comments

I like your project!

May i drop a feature request? It would be really cool to have this as an Home Assistant Addon available!

CzarofAK avatar Mar 27 '25 18:03 CzarofAK

Of course! We have already MQTT output as an option. Can this be read into Home Assistant or can you otherwise elaborate what you mean?

Thanks, Jasper

jvde-github avatar Mar 27 '25 22:03 jvde-github

@jvde-github, i have no clue about SW, so bare with me :-) MQTT is of course no problem in HA, but this only pulls metadata in and does not provide a nice GUI/Map. On the other hand, i still would require a second device to run your containers.

My usecase is to run everything on my Home Assistant Yellow in my Motorhome. So i would like to stick with one computer device.

I tried to run Portainer on my HA OS and installed there your dockers which worked. But as Portainer is overly powerfull and not official supported, that will also not be my solution.

Last but not least, there is a possibility to run you dockers as a Addon on HA, see here: https://developers.home-assistant.io/docs/add-ons/ As it uses docker too, i think it would not be such a big task to fiddle it together (but as i said, i am not a SW guy!!).

  • The advantage for a Addon is, it is basically a one click installation for users like me

CzarofAK avatar Mar 28 '25 07:03 CzarofAK

This is an example which i use in my installation. From what it is doing, it is very closely related to your SW. https://github.com/MaxWinterstein/homeassistant-addons/tree/main/adsb-multi-portal-feeder

CzarofAK avatar Mar 28 '25 07:03 CzarofAK

Thanks, will have a look!

jvde-github avatar Mar 28 '25 07:03 jvde-github

I did not specify, that it would be very very cool to have the *-control also part of the same addon!

CzarofAK avatar Mar 28 '25 17:03 CzarofAK

Pity that this Home Assistant does not support add ons in the docker version (although that is what I suspect).

jvde-github avatar Mar 28 '25 22:03 jvde-github

Yes, that would be very easy. but it really does not like running Portainer to add the ais-catcher.

CzarofAK avatar Mar 29 '25 16:03 CzarofAK

Had a look, and installing the docker with the GUI version might be a good option as it has all the config and map options https://docs.aiscatcher.org/installation/docker/#docker-with-web-gui

I am not sure though what further Home Assistant integration would bring. But got it up and running and will have a further look.

jvde-github avatar Apr 05 '25 07:04 jvde-github

I tried around with AI to create this Addon, and it kind of worked... https://github.com/CzarofAK/homesassistant-addons/tree/main/ais_catcher_control As I have nothing to do with coding, it might be good that a professional could have a quick look.

Four things still to be investigated:

  1. The RTL-SDR was working fine, but I had issues with my Cypho-150
  2. What i like to add is, that the addon is pulling the GPS data from the HomeAssistant like this addon: https://github.com/MaxWinterstein/homeassistant-addons/tree/main/adsb-multi-portal-feeder
  3. Would be nice to have also the webinterface to be shown in the sidebar -> Done Also ports can now be configured via the HA Gui

May you can have a quick look, @jvde-github

CzarofAK avatar Apr 12 '25 22:04 CzarofAK

I have setup a few ships as "devices" in Home Assistant. This is obviously most relevant for ships that are recurring visitors. I use it to track the local ferries, and when they dock. The device shows a few data points but most importantly they have a "device tracker" entity, so they can be shown on the map in Home Assistant.

Image

The configuration is here:

#1st ship
  - device_tracker:
      name: "Location"
      device:
        name: "DBB Asterix" #Vessel name
        identifiers: ["MMSI_219025528"]
      json_attributes_topic : ais/data
      json_attributes_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 ) or 
            (value_json.type == 4)) %}
          {"latitude":{{ value_json.lat|float }}
            ,"longitude":{{ value_json.lon| float }}
            }
        {%else%}
          {}
        {%endif%}
      source_type: gps
      unique_id: 46d6862b-3017-4b1f-81d9-3b1a62957250

  - sensor:
    - name: "Speed"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      suggested_display_precision: 1
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 ) or 
            (value_json.type == 4)) %}
          {{value_json.speed }}
        {%endif%}
      device_class: "speed"
      state_class: "measurement"
      unit_of_measurement: "kn"
      unique_id: 29fec687-f0a6-456c-9523-459f30fb9c7e

    - name: "Status"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 )) %}
          {{ value_json.status_text}}
        {%elif this is defined%}
          {{this.state}}
        {%endif%}
      device_class: "enum"
      unique_id: 0ab624da-a001-440d-8159-6160825a909b

    - name: "Course over ground"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      suggested_display_precision: 0
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 ) or 
            (value_json.type == 4)) %}
          {{value_json.course }}
        {%endif%}
      icon: mdi:compass
      unit_of_measurement: "°"
      unique_id: 235f086c-c4d6-4615-b0a4-c9a201b64eed

    - name: "Turn"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      suggested_display_precision: 0
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 ) or 
            (value_json.type == 4)) %}
          {{value_json.turn }}
        {%endif%}
      icon: mdi:ship-wheel
      unit_of_measurement: "°"
      unique_id: a0911d1a-b51e-47b0-981c-b573509193d1

    - name: "Received"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 )) %}
          {{value_json.rxtime[0:4]}}-{{value_json.rxtime[4:6]}}-{{value_json.rxtime[6:8]}}T{{value_json.rxtime[8:10]}}:{{value_json.rxtime[10:12]}}:{{value_json.rxtime[12:14]}}Z
        {%elif this is defined%}
          {{this.state}}
        {%endif%}
      device_class: "timestamp"
      entity_category: diagnostic
      unique_id: f16a520d-4da9-4003-9954-0c0fc1ba2639

    - name: "RX strength"
      device:
        identifiers: ["MMSI_219025528"]
      state_topic: ais/data
      value_template: >-
        {%if value_json.mmsi == 219025528 and
          ((value_json.type == 1 ) or 
            (value_json.type == 2 ) or
            (value_json.type == 3 )) %}
          {{value_json.signalpower}}
        {%else%}
          {{this.state}}
        {%endif%}
      device_class: "signal_strength"
      entity_category: diagnostic
      unit_of_measurement: "dB"
      suggested_display_precision: 1
      unique_id: ded8f494-5bb2-4f0d-81f7-ed437175d049

Xrlls avatar Aug 20 '25 13:08 Xrlls