30
submitted 1 day ago* (last edited 1 day ago) by irmadlad@lemmy.world to c/selfhosted@lemmy.world

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.

you are viewing a single comment's thread
view the rest of the comments
[-] GreenKnight23@lemmy.world 4 points 1 day ago

lots of ways to do it, where will it be displayed? if it's in a console, jq would more than suffice.

if you want it to be processed heavily and added to an HTML document, probably something like a mix of jq and envsubst. you could forego all that and just use sed to inject the json into HTML then have JavaScript parse it out for you browser side.

if you want to store it in a database why not just store the whole json?

your requirements aren't very clear on what you want this data for or how it will be used. without that there's just too many variable solutions.

can you parse json? sure! what for/how will it be used? not sure.

hope this helps.

[-] irmadlad@lemmy.world 2 points 1 day ago

envsubst sed

Ahh more to explore. Thanks.

your requirements aren’t very clear on what you want this data for or how it will be used.

Apologies. As per usual, it's all in my head and sometimes doesn't make it to paper. I am using Homarr dashboard. Homarr has the ability to incorporate iframes. Ideally I would like to parse the JSON data into a prettier format perhaps adding some icons in the future once I get it all hammered out, and display it in an iframe on my dashboard.

Thank you for the leads and your time.

[-] GreenKnight23@lemmy.world 2 points 1 day ago

I don't know much about homarr but it sounds like going with jq and envsubst might give you a faster solution that you can just iframe in your dashboard. though the learning curve can be steep if you're unfamiliar with Linux command line.

I'm pretty sure you can literally pass in base64 encoded HTML to an iframe it will load in or pass it a publicly accessible file and it will work too.

I had messed around with building a locally hosted dashboard using similar methods so I'm pretty sure it will work.

this post was submitted on 09 Jun 2026
30 points (94.1% liked)

Selfhosted

59799 readers
576 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS