Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Live data source doesn't work #2

Open
peternewman opened this issue Sep 11, 2019 · 8 comments
Open

Live data source doesn't work #2

peternewman opened this issue Sep 11, 2019 · 8 comments

Comments

@peternewman
Copy link
Contributor

peternewman commented Sep 11, 2019

I have known SimpleWeather is broken for a while, and IIRC, I had a proof of concept using OpenWeather's free tier a while back, but I haven't had much time to devote to this project the last few months. IIRC, the reason I didn't convert this to OpenWeather is because you'd have to be on the paid tier to get a 7 day forecast. Since I wrote this for a public school, there is no way they can justify the paid tier of OpenWeather. I agree that this needs addressing, however, and dummy data may be the best way to do it. Give me a few days to look this over, I'm at Uni right now so things are sort of nuts for me.

Originally posted by @k4kfh in #1 (comment)

Update: perhaps we could do some mild refactoring to use this: https://github.com/BrookeDot/SimplerWeather 1000 free calls a day is more than enough for me, so that solves my problem.

Originally posted by @k4kfh in #1 (comment)

@k4kfh
Copy link
Owner

k4kfh commented Sep 11, 2019

After looking at it a little, I am leaning towards Open Weather Map. They are clearly a big company and not going anywhere anytime soon. I don't know as much about Dark Sky, but mostly I don't want to rely on another library for something so simple. With OWM, I don't even need a library, because I'm only making one call. It's not as "programmatic", but it's so much simpler, and that's really what this needs to be, IMO.

@peternewman
Copy link
Contributor Author

So I looked at a few others:

@peternewman
Copy link
Contributor Author

After looking at it a little, I am leaning towards Open Weather Map.

See my summary above, the benefit of DarkSky is a longer forecast, the downside is needing something server side. Weatherbit could work (which has the best of most worlds), depending on if your usage counts as non-commercial.

I guess the ideal will be if it's coded in such a way you can drop in different providers to suit, but that's probably a whole other library!

For bonus points, make it scale the tiles dynamically based on the number of days the forecast provides...

@k4kfh
Copy link
Owner

k4kfh commented Sep 11, 2019

See my summary above, the benefit of DarkSky is a longer forecast, the downside is needing something server side. Weatherbit could work (which has the best of most worlds), depending on if your usage counts as non-commercial.

That's a negative for me on DarkSky then. I don't need a longer forecast, and since this is going in a public school (and will be maintained and used by non-programmers) I really don't need another complex piece of equipment to maintain. It's bad enough trying to teach them Caspar, lol.

For bonus points, make it scale the tiles dynamically based on the number of days the forecast provides...

I would like to create a set of optional parameters (with defaults, but settable via JSON parameters from the CCG client) that control things like number of forecast days, etc. For my use case, they almost always need 7 days, but I can see the utility for other people.

@peternewman
Copy link
Contributor Author

See my summary above, the benefit of DarkSky is a longer forecast, the downside is needing something server side. Weatherbit could work (which has the best of most worlds), depending on if your usage counts as non-commercial.

That's a negative for me on DarkSky then. I don't need a longer forecast, and since this is going in a public school (and will be maintained and used by non-programmers) I really don't need another complex piece of equipment to maintain. It's bad enough trying to teach them Caspar, lol.

Yeah likewise for my particular use case too. Actually it looks like the CORS tests may be turned off in the Chromium within Caspar:
https://github.com/CasparCG/server/blob/6ee169018e7bfd935bb8330683733b430a08bd7f/src/modules/html/producer/html_producer.cpp#L381

So it would only be an issue for development! Attribution would still need covering though.

For bonus points, make it scale the tiles dynamically based on the number of days the forecast provides...

I would like to create a set of optional parameters (with defaults, but settable via JSON parameters from the CCG client) that control things like number of forecast days, etc. For my use case, they almost always need 7 days, but I can see the utility for other people.

I probably didn't explain my point very well, Open Weather Map's free tier only includes a five day forecast ( https://openweathermap.org/price ), so ideally if that is used, and only five days returned, the system should hide the last two tiles and increase the width of the others to suit.

Yeah the options thing was my thinking for temperature units too.

@k4kfh
Copy link
Owner

k4kfh commented Sep 12, 2019

I probably didn't explain my point very well, Open Weather Map's free tier only includes a five day forecast ( https://openweathermap.org/price ), so ideally if that is used, and only five days returned, the system should hide the last two tiles and increase the width of the others to suit.

Yeah, that makes more sense. I'll see what I can do. I'm thinking I'll also try to incorporate some error screens (e.g. "You didn't specify your ZIP code!" and similar). I know that's not strictly "professional", but since this is used by non-programmers in an elementary school, it's a convenient way to reduce text messages and phone calls to me asking what's going on.

@peternewman
Copy link
Contributor Author

How do you normally deploy it? Who does which bits?

If you enter the URL and the users just add the JSON, then we could add master options URL encoded which can be overridden by the config JSON. Obviously I'd prefer to avoid messages appearing if possible, unless you're in debug mode, in which case they can be useful. I'd hope they can be made to toggle somehow, but out of the control of users.

There's also console.log, which I believe appears in the Caspar log, but it's not quite as user-friendly.

@k4kfh
Copy link
Owner

k4kfh commented Sep 18, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants