Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

NINA status dashboard in Home Assistant via. MQTT

  • Please log in to reply
144 replies to this topic

#126 KTAZ

KTAZ

    Aurora

  • *****
  • Posts: 4,736
  • Joined: 09 Apr 2020
  • Loc: Scottsdale, AZ

Posted 09 October 2024 - 10:01 AM

 

FINALLY got around to also showing RMS values. Took some beating head against the desk to figure out the Regex and how the YAML linter doesn't like parsing characters in regex expressions, it is done.

 

attachicon.gif 2024-10-08_23-02-58.jpg

 

The below templates will strip (for example) "RA: 0.15 (0.42")" down to 0.42


  - name: "Total RMS"
    unique_id: lqasWp87B8bxg2b
    icon: mdi:chart-bell-curve
    state_topic: "Astro/NINA/image/metadata"
    value_template: >-
      {{ value_json.ImageMetaData.Image.RecordedRMS.TotalText | replace ('Tot: ','') | regex_findall_index("\((\d*\.\d*)") | float  }}
    unit_of_measurement: '"'

  - name: "RA RMS"
    unique_id: SrOKnMc14z27wF2
    icon: mdi:arrow-left-top
    state_topic: "Astro/NINA/image/metadata"
    value_template: >-
      {{ value_json.ImageMetaData.Image.RecordedRMS.RAText | replace ('RA: ','') | regex_findall_index("\((\d*\.\d*)") | replace ('"','') | float }}
    unit_of_measurement: '"'

  - name: "Dec RMS"
    unique_id: YsU1rt89dKtzIco
    icon: mdi:arrow-oscillating
    state_topic: "Astro/NINA/image/metadata"
    value_template: >-
      {{ value_json.ImageMetaData.Image.RecordedRMS.DecText | replace ('Dec: ','') | regex_findall_index("\((\d*\.\d*)") | float }}
    unit_of_measurement: '"'

Can you post your yaml for the Clear Outside webpage embed? I've tried copying the code from their website, but it ends up displaying one of my entity switches (very weird).



#127 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 09 October 2024 - 10:49 AM

Can you post your yaml for the Clear Outside webpage embed? I've tried copying the code from their website, but it ends up displaying one of my entity switches (very weird).

Sure, I just embed the large image rather than use the embed code. Replace Lat/Long with your values or copy thee URL of the image from the embed code:

type: picture
image: https://clearoutside.com/forecast_image_large/LATITUDE/LONGITUDE/forecast.png
tap_action:
  action: url
  url_path: https://clearoutside.com/forecast/LATITUDE/LONGITUDE?view=midday


Edited by chvvkumar, 09 October 2024 - 11:01 AM.

  • lurkingtaco and KTAZ like this

#128 DanieleS

DanieleS

    Lift Off

  • -----
  • Posts: 15
  • Joined: 17 Feb 2021

Posted 09 October 2024 - 12:06 PM

I finally managed to do everything and now it works and with the beta version there is no need for the advanced sequence.
The only thing I unfortunately wasn't able to do was read the flip time


  • chvvkumar likes this

#129 ssa2294

ssa2294

    Ranger 4

  • -----
  • Posts: 395
  • Joined: 29 Oct 2018

Posted 09 October 2024 - 08:09 PM

Click on the entity, gear icon and change the "display precision" to one or two decimal places.

This option is not available to me, and I suppose it is how I have my mqtt.yaml configured (i.e. how I am subscribing to the topics?). I took a look at some other entities like my Synology NAS and items like CPU usage do have the option. So I assume it is how the entities get created or entered?



#130 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 09 October 2024 - 08:19 PM

This option is not available to me, and I suppose it is how I have my mqtt.yaml configured (i.e. how I am subscribing to the topics?). I took a look at some other entities like my Synology NAS and items like CPU usage do have the option. So I assume it is how the entities get created or entered?

Do you have a unit of measurement for HFR and the other value you want to change? I believe if it is not there, HA treats it as a string rather than a number. Here mine has it using this code I linked before:

  - name: "Total RMS"
    unique_id: lqasWp87B8bxg2b
    icon: mdi:chart-bell-curve
    state_topic: "Astro/NINA/image/metadata"
    value_template: >-
      {{ value_json.ImageMetaData.Image.RecordedRMS.TotalText | replace ('Tot: ','') | regex_findall_index("\((\d*\.\d*)") | float  }}
    unit_of_measurement: "Arc-Sec"

2024-10-09_20-17-59.jpg



#131 flamidey

flamidey

    Ranger 4

  • -----
  • Posts: 319
  • Joined: 25 Oct 2021
  • Loc: Montreal, Canada

Posted 10 October 2024 - 07:34 AM

Thank you Dale for the update!
  • dghent and chvvkumar like this

#132 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 13 October 2024 - 05:11 PM

On the topic of MQTT, I am working on a machine learning based sky condition reporter heavily inspired from Gord Tulloch's work here:

 

https://github.com/g...h/mlCloudDetect

 

While his aims to create a safety monitor, my aim is to send current sky conditions from my AllSky camera to Home Assistant. I took Gord's code and modified it to train a model with multiple classes for recognizing different types of conditions and publish MQTT messages with the recognized results. I also want to, if possible run this detection on another machine and not on the AllSky Pi itself.

 

Broad architecture:

 

Blank diagram.png

 

https://github.com/c...r/mlCloudDetect


  • dghent likes this

#133 ssa2294

ssa2294

    Ranger 4

  • -----
  • Posts: 395
  • Joined: 29 Oct 2018

Posted 14 October 2024 - 08:07 AM

On the topic of MQTT, I am working on a machine learning based sky condition reporter heavily inspired from Gord Tulloch's work here:

 

https://github.com/g...h/mlCloudDetect

 

While his aims to create a safety monitor, my aim is to send current sky conditions from my AllSky camera to Home Assistant. I took Gord's code and modified it to train a model with multiple classes for recognizing different types of conditions and publish MQTT messages with the recognized results. I also want to, if possible run this detection on another machine and not on the AllSky Pi itself.

 

Broad architecture:

 

attachicon.gif Blank diagram.png

 

https://github.com/c...r/mlCloudDetect

Interesting, thanks for sharing this. I am looking at the ReadMe now but can not seem to figure out, what does this output? What I mean is when it analyzes my 'latest image' does it write to file? Looking at the ini and I see "statusfile = roofStatus.txt" which indicates to me it runs its process and outputs to "roofStatus.txt". 

 

In that case, this would be an easy peazy thing to send to my broker as I would just need to read the file and CLI output to publish. 

 

 

On a different topic, I did change my mqtt.yaml from:

    value_template: "{{ value_json.ImageMetaData.Image.RecordedRMS.TotalText }}"

To

    value_template: >-
      {{ value_json.ImageMetaData.Image.RecordedRMS.TotalText | replace ('Tot: ','') | regex_findall_index("\((\d*\.\d*)") | float  }}
    unit_of_measurement: "Arc-Sec"

And all I had was "unknown". I did reload just the HA config files (i.e. not a full reload). When those did not work I reset back to the original and yet all night they still showed "unknown". All other entities were updating. Now the weird thing was in the morning I opened HA from a different computer and the values WERE there. So it seemed HA's dashboard was just not updating on screen the new values sent by NINA. So before I could play around with this the clouds came, and they just will not leave no matter how much I point my leaf blower at them. 



#134 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 14 October 2024 - 01:00 PM

The text file one is from gordtulloch's repo, I removed that functionality from my codde as that is not needed. I believe the text file is for when you are using the ASCOM Generic File SafetyMonitor Driver software. 



#135 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 26 October 2024 - 10:58 AM

Finally got around to re-writing the cloud detection code from the beginning. I simplified the script quite a bit and found a way to use Teachable Machines website models and code directly. 

 

I found that with my limited understanding of ML, the website based training was giving me vastly better results than the previous script I wrote. 

 

If anyone wants to take it for a spin, here is the code and how to use it:

 

https://github.com/c...mpleCloudDetect

 

Next step is to see how I can relay specific detection classes to NINA and use this to pause imaging if specific classes are detected.

 

For example, the idea is:

 

If it is 'Cloudy' or 'Wispy Clouds': Pause the sequence until it is clear again and restart the sequence.

If it is 'Overcast' or 'Rain': Stop imaging and park the scope such that the scope is parallel to the ground and the dew shield protects the objective from droplets.

 

Screenshots:

 

2024-10-26_19-41-40.jpg

2024-10-26_18-45-56.jpg

2024-10-26_17-51-11.jpg


Edited by chvvkumar, 26 October 2024 - 08:00 PM.

  • joshman and richard1955 like this

#136 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 09 November 2024 - 04:46 PM

If any one wants to try this, I made a docker container. I added the relevant run command and docker-compose if you want to try it:

 

https://github.com/c...referred-method


  • lurkingtaco likes this

#137 Astro_BC

Astro_BC

    Vostok 1

  • *****
  • Posts: 191
  • Joined: 18 Sep 2016

Posted 19 November 2024 - 06:51 PM

If any one wants to try this, I made a docker container. I added the relevant run command and docker-compose if you want to try it:

https://github.com/c...referred-method

This is pretty cool. Do you think a Pi 4b would run it?

Sent from my SM-G981U1 using Tapatalk

#138 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 19 November 2024 - 07:12 PM

This is pretty cool. Do you think a Pi 4b would run it?

Sent from my SM-G981U1 using Tapatalk

Don't see why it can't. I run docker and a handful of containers on my Pi3 that sits outside on my deck tracking ADS-B data for the past four years.

 

Actually not right now, let me see if I can build an ARM image.

 

EDIT: Tried and I couldn't find an equivalent tensorflow-cpu build for ARM architecture :\ If anyone has any ideas I would love to be able to build an ARM image.


Edited by chvvkumar, 19 November 2024 - 08:04 PM.


#139 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 04 December 2024 - 11:11 AM

Here is an automation I created last night that announces that it's raining through my Nest speakers throughout the house. 

 

It works by keying off of change in cloud detection status and if it changes to 'Rain' and if the value of the AC smart plug I use for telescope power is any thing greater than 0W (meaning the rig is powered on), it sends a notification to my phone as well with the allsky image as an attachment.

 

Screenshot_20241204-095705.jpg



#140 dghent

dghent

    N.I.N.A. (& More)

  • *****
  • Freeware Developers
  • Posts: 2,241
  • Joined: 10 Jun 2007
  • Loc: Maryland, US

Posted 18 December 2024 - 11:09 AM

In the interest of furthering stats nerdery, I released my InfluxDB Exporter plugin for NINA this morning. It's available in NINA's beta plugin channel, so you must be subscribed to that in order to see it until I make it a GA release. General information on it is on its website.  This is something I've been working on for a while but this kind of thing is tough to keep up with without a remote system. I installed my own remote system at HCRO in November which allowed me to dust off the code and get it fixed up and working. I've cobbled together a Grafana dashboard.

 

Some interesting things I've noticed while playing around:

  • Correlating wind speed with guiding excursions.
  • Sometimes rises in sky temperature is a better indicator of clouds than a %-based cloud cover.
  • Sky temperature trending in conjunction with image mean trends can indicate the presence of very faint clouds/cirrus/ice that may be invisible on an all-sky camera or not registering enough to induce the cloud sensor to up its estimate of cloud cover percentage.
  • Clouds moving over the site can cause an increase in camera cooler power level, which also registers as higher current load on the power supply.

  • Bob Denny and chvvkumar like this

#141 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 18 December 2024 - 12:47 PM

 

In the interest of furthering stats nerdery, I released my InfluxDB Exporter plugin for NINA this morning. It's available in NINA's beta plugin channel, so you must be subscribed to that in order to see it until I make it a GA release. General information on it is on its website.  This is something I've been working on for a while but this kind of thing is tough to keep up with without a remote system. I installed my own remote system at HCRO in November which allowed me to dust off the code and get it fixed up and working. I've cobbled together a Grafana dashboard.

 

Some interesting things I've noticed while playing around:

  • Correlating wind speed with guiding excursions.
  • Sometimes rises in sky temperature is a better indicator of clouds than a %-based cloud cover.
  • Sky temperature trending in conjunction with image mean trends can indicate the presence of very faint clouds/cirrus/ice that may be invisible on an all-sky camera or not registering enough to induce the cloud sensor to up its estimate of cloud cover percentage.
  • Clouds moving over the site can cause an increase in camera cooler power level, which also registers as higher current load on the power supply.

 

This is exactly what I was tryign to do with HA. Since my HA pushes all it's metrics to influxdb, I wanted HA to act as a collector from various sources and use Grafana for graphing. Here's mine (it's kind of primitive as I do my dashboarding in HA) but I have the historical data if I ever think up interesting correlations like you did.

 

https://grafana.chal...imezone=browser

 

Nice work! It must have taken a lot of effort to put htis together!


Edited by chvvkumar, 18 December 2024 - 12:55 PM.

  • dghent likes this

#142 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 26 December 2024 - 12:27 PM

Not directly related to NINA but I wrote a script to control my AllSky camera dew heater from Home Assistant. Main reason is, I have a moisture tight enclosure and the M+BME280 in the box won't be able to detect humidity outside the box. So I am using my weather station's outdoor thermometer to calculate dew point and turn on and off the heater via GPIO pins. This script should be able to control multiple GPIO pins via MQTT if required:

 

https://github.com/c...TT_GPIO_control

 

In addition, I wrote a module for TJ's AllSky to receive MQTT data and make it available as variables for the overlay module. It's not pulled into the main branch yet but I am using it now and it works well.

 

https://github.com/A...y_mqttsubscribe


  • dghent likes this

#143 dghent

dghent

    N.I.N.A. (& More)

  • *****
  • Freeware Developers
  • Posts: 2,241
  • Joined: 10 Jun 2007
  • Loc: Maryland, US

Posted 07 January 2025 - 03:30 AM

Kicked out beta #3 of InfluxDB Exporter. This adds 2 metrics for certain QHY cameras - sensor chamber humidity and air pressure.

 

https://daleghent.co...wPanel=panel-33

 

It also has a fix to URL validation that permits it to connect to https addresses. Oops. Wasn't a big deal for most self-hosted InfluxDB cases (and probably why it was not noticed) but this fix now permits one to feed metrics to InfluxData's InfluxDB Cloud 2 service if you don't go the self-hosted route.


Edited by dghent, 07 January 2025 - 03:32 AM.

  • flamidey likes this

#144 ssa2294

ssa2294

    Ranger 4

  • -----
  • Posts: 395
  • Joined: 29 Oct 2018

Posted 05 May 2025 - 07:04 PM

I have been hibernating all winter, so I just got my gear out and started up again. I suspect many will already be aware of something, but I thought I would share this just in case. I found a few months back in the HCAS store an integration called AstroWeather. For me it was a nice addition as I could use it with my voice assistant. While still in bed I could say "Hey Jarvis, what is Astro Cloud Cover" or similar. Without even having to open my eyes I could get a sense of whether I needed to get out of bed or not to close the dome and shut everything down :)


  • chvvkumar likes this

#145 chvvkumar

chvvkumar

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,821
  • Joined: 03 Aug 2020
  • Loc: Cottleville, MO

Posted 08 May 2025 - 08:58 AM

I have been hibernating all winter, so I just got my gear out and started up again. I suspect many will already be aware of something, but I thought I would share this just in case. I found a few months back in the HCAS store an integration called AstroWeather. For me it was a nice addition as I could use it with my voice assistant. While still in bed I could say "Hey Jarvis, what is Astro Cloud Cover" or similar. Without even having to open my eyes I could get a sense of whether I needed to get out of bed or not to close the dome and shut everything down smile.gif

I have used Astroweather before but for my location, Accuweather is alomost spot on for clouds whereas astroweather was off by quite a bit.




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics