AstroLive - Monitor your observatory from within Home Assistant

Ever wanted to check your astrophotography session via your phone? Now you can.

AstroLive is a connector for the ASCOM Alpaca REST API designed to work with Home Assistant via MQTT. It supports the autodiscovery of Home Assistant for your observatory devices like your camera, telescope mount, focuser, filter wheel, and switch.
AstroLive is designed to run as a container to be deployed on a dedicated host or next to Home Assistant. It does not require any custom integration for Home Assistant since communication is sole via MQTT.

  • For each configured and connected component MQTT device configuration for sensors and if applicable a camera is created.
  • If the component is of the type camera the last captured FITS image is auto stretched, downsized, and published as a .jpg. This is the same for camera via file where AstroLive watches a directory for new FITS images.

Slewing the telescope using the equatorial coordinate system, moving the focuser and some more commands are possible directly from Home Assistant.

Find it here: AstroLive alongside the documentation on how to set it up.

Tell me if you like it or if you have suggestions to improve it.

5 Likes

This is AWESOME!!! I have used HA to control devices in my own home observatory for years. However, my integration has been limited to turning on/off the various devices using Shelly 1 12v Relays and a Digital Logger Web Switch. I never managed to get ASCOM integrated so that I could monitor/control ASCOM devices directly in HA. I started to play around with the Ground Station pluggin with MQTT in N.I.N.A, but this stilll did not give me current status of my ASCOM devices. It would appear from your dashboard screen shot that you may have “cracked the code” using AstroLive. I would love to learn more about this project. I have already checked out the AstoLive github and will try and install using docker as soon as I get a chance. Do you by chance have a link to your HA configuration?

Thank you for the applause :slight_smile:

Docker is not a must but simplifies the use because containerization creates a defined environment for the app. I describe the different variants on how to run AstroLive within the readme.

Same for the HA configuration. My nearly up-to-date configuration for the different devices is in the “Devices and Sensors” section of the readme or within the config directory of the repo. This should get you started, hopefully.

If you run into any problems just ask.
Clear skies! :telescope:

Agreed, this is awesome. I made a few tweaks here and there to support my setup and the vagaries of N.I.N.A. and SGP, but apart from that it works very nicely. Happy to share the changes I made here or on Github…

Might I say this is very nice indeed. Would it be easy to integrate something like my NexDome Beaver ASCOM driver? I would like to have HA know the dome’s shutter is either open or closed so I can set the dehumidifier to turn on, etc. So much information…

This is absolutely possible. The single reason for me not having it implemented yet is that I don’t have a dome, sadly.
I’ll put it on my to-do list but will only be able to test against the ASCOM simulator, of course.

@astroisk
I would be very interested in your improvements. Where could I find them, eventually on GitHub somewhere?

@stephen2615
I added Dome, Rotator, and Safety monitor. At least with the simulators, it seems to work. Maybe give it a try… Feedback would be appreciated.

1 Like

Hi Markus,

Did you ever think going the other direction - such as exposing weather data in homeassistant (rain/wind/cloud/sqm sensors…) as ASCOM Alpaca device?

Hi Frank,
not really. Initially the need for me to build this was that I wanted to be able to check the imaging session from my phone and not have to turn on my computer :slight_smile:
What would be the use case for going the other way?

Hi Markus, in ASCOM you can add any ASCOM Remote Server as device (such as Safety Monitor or Weather data). Instead of using specialiced devices (Lunatico in example) one may add the „Home Assistant based ASCOM Remote Server“ in NINA, SGP… I can even imagine finally replacing my current custom VBS script in NINA (currently driving a gate opener in Homematic CCU).

I am currently at the very beginning - not yet even wrote a single line of code, still evaluating if doing it in homeassistant OR (for simplicity) run a uwsgi service in my Synology WebStation using homeassistant API.

Possible starting point:

Got it and I also found this. Looks pretty straightforward and could be something for the fall after the holidays.

Cool, I am currently still a beginner in HA. What I am still missing is the „thinking“ how the SDK might be transformed from a standalone flask app to uwsgi… I have it currently running standalone in my NAS but fighting to integrate it into webstation (Nginx + uwsgi) - although flask is supposed to be WSGI callable.

If you may have any ideas how to implement this (not just standalone) your ideas are welcome :hugs:

Too easy…

When downloading the GitHub Repo it’s pretty straight forward to run it as uWSGI instead of standalone application:

In /device/app.py (line 213ff)

  1. Remove def main():
  2. Remove indent of the following lines
  3. Delete everything from line #264 (server application…)

Setup the Python web application (uWSGI)

  1. Document-Root: */your/path/AlpycaDevice/*device
  2. WSGI-File: app.py
  3. Callable: falc_app

It’s pretty cool to have it now running on my NAS already…