Starlink - Dish and network stats

That explains a lot!

Thanks for your work! Have you considered integrating the dish control functions to allow rebooting through HA?

1 Like

This has been working great since I got my HP Dish, I submitted a feature request as an issue on GitHub regarding adding the GPS location function.

I have pushed a couple of updates today.

  • The ability to get the GPS location (and the instructions for allowing that are in the readme markdown)
  • The buttons to reboot, stow, and unstow the device.
  • Cleaned up some code and updated the documentation
2 Likes

Fantastic, this is so helpful. Thanks again.

I’m now updating my location based on the dish!

Every 15 minutes (probably can set this to be longer until motion on land is enabled but if you’re on a boat with the maritime plan this’ll work today, I have a High Performance dish on residential so almost the same thing)

I setup this automation in automations, “Start with an empty automation”, then hit the 3 dots and selected “Edit in YAML” saved it and restarted my Home Assistant. Now the map shows home as wherever the dish is. Next up is Auto Time-Zone but that seems to be waiting on: Ability to set timezone when location updates worst case I’ll find a way to just update the time zone each time it updates the location as another part of the automation.

alias: Set Location by Starlink
description: read Starlink GPS and set the location of home to match
trigger:
  - platform: time_pattern
    minutes: /15
condition: []
action:
  - service: homeassistant.set_location
    data_template:
      latitude: |
        {{ states("sensor.dish_latitude") }}
      longitude: |
        {{ states("sensor.dish_longitude") }}
      elevation: |
        {{ states("sensor.dish_altitude") }}
mode: single
1 Like

Hi @ArcherNE,

Apologies for the perhaps silly question, but I can’t seem to be able to configure the integration on my Home Assistant instance. I’ve added the custom repo in HACS, downloaded the custom components from HACS, however when I try to add the integration via the Home Assistant integrations page I just get a generic “Unknown error occurred”.

Would you have any tip on how to enable verbose logging for this integration so I can better understand what is not working?

Needless to say that I can get to 192.168.100.1 just fine, and I have the Gen. 1 round dish.

Thanks!

Can you add the full stack trace from the log details in an issue on GitHub? I’ll see if I can see something.

Thanks for your reply @ArcherNE.

I would be more than happy to do that - but I’d need some tips on how to enable logging for this custom component. At the minute I don’t see anything in the logs other than the following warning.

2022-11-08 12:28:12.385 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration starlink which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Thanks!

Hi @ArcherNE,

I have just bumped the logging to debug for the full Home Assistant, instead of increasing it for just the component. This is what I can see.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_flow.py", line 71, in async_step_confirm
    has_devices = await cast(
  File "/config/custom_components/starlink/config_flow.py", line 14, in _async_has_devices
    devices = await api_client.get()
  File "/config/custom_components/starlink/__init__.py", line 174, in get
    response = _dish_grpc_text.main(obj)
  File "/config/custom_components/starlink/dish_grpc_text.py", line 288, in main
    lines.append(self.loop_body(opts, gstate, print_file))
  File "/config/custom_components/starlink/dish_grpc_text.py", line 239, in loop_body
    rc, status_ts, hist_ts = self._dish_common.get_data(opts,
  File "/config/custom_components/starlink/dish_common.py", line 233, in get_data
    rc, status_ts = self.get_status_data(
  File "/config/custom_components/starlink/dish_common.py", line 274, in get_status_data
    groups = starlink_grpc.status_data(context=gstate.context)
  File "/usr/local/lib/python3.10/site-packages/starlink_grpc.py", line 765, in status_data
    "wedges_fraction_obstructed[]": status.obstruction_stats.wedge_abs_fraction_obstructed,
AttributeError: 'DishObstructionStats' object has no attribute 'wedge_abs_fraction_obstructed'

I guess the key is probably the following error:

AttributeError: 'DishObstructionStats' object has no attribute 'wedge_abs_fraction_obstructed'

Would you have any suggestion as if there is a way to overcome this, please?

Thanks!

@kavejo this appears to have surfaced after the ee39beae-c399-4648-a7d6-949193d8c910.uterm.release update. It is being looked at, at a library level. Once it is fixed there I’ll be able to update here.

Roger that, thanks @ArcherNE!

I have pushed the library update, so after you update the integration it should now work.

1 Like

Thank you, it works now!

@ArcherNE thanks for this it works great!

I see there’s now an addon, seems to work but I was a bit confused at this line in the documentation:

“Your Starlink must not be in bypass mode.”

Is that old or am I just not following why that matters? Seems to work fine for me running pfSense.

I’ve been using ArcherNE’s Starlink integration for a few weeks. Its really nice and gives some good data so first off I would like to say thanks. The Dish Latitude, Longitude and Altitude are the only data points not working. This is installed in my Motorhome and I would really like to tie these to my Home location so it dynamically updates as I move. Is anyone else getting these to values to update?

(Optional) Enable Location

This step is only required if you want to see the latitude, longitude, and altitude in homeassistant (otherwise those sensors will just be blank).

Access to location data must be enabled per dish and currently (2022-Sep), this can only be done using the Starlink mobile app, version 2022.09.0 or later. It cannot be done using the browser app. To enable access, you must be logged in to your Starlink account. You can log in by pressing the user icon in the upper left corner of the main screen of the app. Once logged in, from the main screen, select SETTINGS, then select ADVANCED, then select DEBUG DATA. Scroll down and you should see a toggle switch for “allow access on local network” in a section labelled STARLINK LOCATION, which should be off by default. Turn that switch on to enable access or off to disable it. This may move in the future, and there is no guarantee the ability to enable this feature will remain in the app.

Note that the Starlink mobile app can be pretty finicky and painfully slow. It’s best to wait for the screens to load completely before going on to the next one.

Just sharing in case this becomes of any use to somebody.

I had this custom component running since November 2022 - and my recorder is set to retain 730 days of data (2 years).
Approximately 4 months after enabling the custom component I have found out my HA database was 10 GB, and upon inspecting the content with SQLite Web I have noticed that the vast majority of the space was occupied by 4 sensors coming from this integration (ping drop rate, ping latency, uplina dna ddownlink throughput). There were about 11.000.000 states of each.

I had excluded these sensors from the recorder, however the recorder.purge service was not completing in a night, therefore I manually deleted the entries via SQL queries. Only then I was able to run recorder.purge successfully and repack the database, which has shrunk to 135 MB now.

Just saying, if you happen to record the data for long term, you might want to exclude these 4 sensors from the recorder.

@ArcherNE,

Quick curiosity, I have seen on Starlink - Home Assistant (home-assistant.io) that now Starlink can be integrated with an official integration. Is this based on yours?

Just curious as for me, despite I’m on HA 2023.3.5, the official integration does not show up, therefore I was wondering if yours through HACS and the official one are basically the same.

Thanks!