So, yes this is selfhosting related. I am working on an n8n flow to pull in weather data so that I can have this data on a dashboard. I can’t find any dockerized weather forecasting apps. Most of them connect to a personal weather station, which might be an option in the future. For the time being, this is a little project I’m working on.

Partial JSON snippet:

spoiler
0	
json	
cod	"200"
message	0
cnt	40
list	
0	
dt	1780693200
main	
temp	29.4
feels_like	29.23
temp_min	29.4
temp_max	29.68
pressure	1019
sea_level	1019
grnd_level	984
humidity	42
temp_kf	-0.28
weather	

I would like to display something like this:

spoiler
Current temperature: 23.25 °C
Feels like: 24.09 °C
Low / High: 23.25 °C / 23.60 °C
Humidity: 94%
Atmospheric pressure: 1023 hPa (sea level: 1023 hPa, ground level: 988 hPa)
Temperature correction factor (temp_kf): -0.35

Weather: Light rain
Weather code: 500
Short condition: Rain
Icon: 10d

So, this is for you devs or coders out there. I can produce the JSON data. I’m just not sure how to parse it to something meaningful. I’m sure Python will have to be incorporated, but unsure of how to proceed.

Maybe someone could point me in a direction to tuts, articles, or your own experience. Sorry the JSON data doesn’t format correctly. Lemmy formatting doesn’t seem to allow that.

  • obdurant@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 hours ago

    I spent some time writing a script first in Python and then in ExcelScript at work to pull data from from OpenWeather API to compare ambient temperature and humidity to some of our indoor spaces. Both Python and JS (which ExcelScript is, basically) will make it very easy to pull the JSON from the API and pass whatever data you want down the line.

    I don’t have any experience with dashboards or your setup in particular so I can’t give any good advice about how to go forward though. If you have a pre-existing dashboard, what makes it and what feeds it data? Is it a webpage or an app or such?

    • irmadlad@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 hours ago

      Is it a webpage or an app or such?

      I am using the Homarr dashboard. It does have an iframe module that I think I could use once I pretty up the data.

      • obdurant@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        59 minutes ago

        Okay, I see what you’re going for and from another comment that you want to avoid the built-in weather app that dashboard has. I agree that the iframe should work for what you want.

        In this case I would make a webpage you can host locally, ignoring the dashboard aspect for a moment, and have it format the data how you want it to show up. If you want to use this as an excuse to tinker with Python and learn a new project I would probably follow the tutorial for Flask on setting up a simple webapp. I imagine by the end of it you could use the example project and tweak it somewhat painlessly to render what you want. Since you already have the ability to get the weather JSON you’ll just need to link the two up.

        Anyway, once you have the page working properly you’ll have something to put in the iframe.