allebb / pirrot

A radio repeater controller (supporting both simplex and duplex operation modes) for the RaspberryPi.
https://pirrot.hallinet.com
54 stars 12 forks source link

Automatic weather download and sythesize voice for annoucement at set intervals. #28

Closed allebb closed 4 years ago

allebb commented 4 years ago

Requested by tekk - Add the ability to set an automatic weather download and annoucement on a predefined interval.

I could use my METAR library (https://github.com/allebb/metar) to provide the weather download functionality or maybe a public "global" weather API that accepts a location string (instead of having to provide a local airport ICAO code as my METAR library would require) - I will look into other Weather API's too though!

allebb commented 4 years ago

This has now been implemented, in the end I went with OpenWeatherMap.org as it provides a free API teir (which should be more than enough for most users if the interval is set to every hour for example).

The user can customise the weather format using placeholders which allows for user choice of unit values such as (wind speed - mps/mph/kph and kts) as well as tempreture (eg. degrees C or F).

I have implemented MP3 file caching too so that if the weather does not change between intervals, and therefore the TTS string doesn't change, we'll output the TTS from cache instead of using another Google API request.

It works really well, the weather sting customisation is really good to, combined with the Google TTS language setting this is then also automatically translated to the country/language of choice!.

Closing this feature request as it is now completed, this will be released in v2.0.0 of Pirrot which should be released in a weeks' time once outstanding features have been completed and full testing has taken place.