{"id":18851351,"url":"https://github.com/emischorr/forecaster","last_synced_at":"2026-05-03T15:33:35.160Z","repository":{"id":193351164,"uuid":"687854864","full_name":"emischorr/forecaster","owner":"emischorr","description":"A elixir application to fetch weather information and publish that on MQTT","archived":false,"fork":false,"pushed_at":"2025-09-29T13:39:06.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T15:30:34.535Z","etag":null,"topics":["elixir","iot","mqtt","weather"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emischorr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-06T06:34:59.000Z","updated_at":"2025-09-29T13:39:09.000Z","dependencies_parsed_at":"2024-01-04T10:09:46.383Z","dependency_job_id":"7e197361-b53a-4a37-ae29-ec7b07feea35","html_url":"https://github.com/emischorr/forecaster","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"57777718c0000d2fea9db7f60c6db1e463a29c87"},"previous_names":["emischorr/forecaster"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emischorr/forecaster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emischorr%2Fforecaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emischorr%2Fforecaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emischorr%2Fforecaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emischorr%2Fforecaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emischorr","download_url":"https://codeload.github.com/emischorr/forecaster/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emischorr%2Fforecaster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","iot","mqtt","weather"],"created_at":"2024-11-08T03:34:31.714Z","updated_at":"2026-05-03T15:33:35.142Z","avatar_url":"https://github.com/emischorr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forecaster\n\nElixir application to retrieve a weather forecast and publish it to a MQTT broker.\nUseful for smart home automations or anything else that requires a weather forecast.\n\nTo get the correct string for the place you can search for your city, click on it and then copy the ID out of the URL.\nYou can go with just the number (and get a redirect) or with the hole string like \"berlin_germany_2950159\"\n\n## Backends\n\n### Req + Floki\n\nThis backend fetches the html via req and then parses the result with the help of floki.\nAs all data is already included in the first response this is an easy and robust option to get the needed information.\n\n### Selenium\n\n\u003e [!NOTE]  \n\u003e Not supported / recommended anymore\n\nNeeds a running webdriver (e.g. locally 'phantomjs --wd')\n\nThis is not a super fast approach (give a forecast 5-6s) and you should not query data in short intervals (be nice!).\nData on their side isn't going to change too frequently anyway.\n\n## Configuration\n\nConnection to MQTT broker can be configured with the following env variables:\n- MQTT_HOST\n- MQTT_PORT\n- MQTT_USER\n- MQTT_PW\n\nThe Selenium host can be configured with SELENIUM_HOST (if it's not running on localhost).\n\nForecasts are published by default to the \"home/get/forecast\" MQTT topic which can be changed by setting the MQTT_NAMESPACE env variable.\n\n## Running with docker\n\n`docker image build -t elixir/forecaster .`\n\n`docker run -d -e MQTT_HOST=$MQTT_HOST -e MQTT_USER=$MQTT_USER -e MQTT_PW=$MQTT_PW -e SELENIUM_HOST=\"172.17.0.2\" -e FORECAST_PLACE=\"berlin_germany_2950159\" elixir/forecaster start`\n\n## Usage\n```elixir\niex\u003e Forecaster.Weather.forecast(\"a_place_1234567\")\n[\n    {1, %{temp_max: \"27\", temp_min: \"16\", precip_max: \"0\", sun: \"12\", uv: \"7\"},\n        hour: %{\n            1 =\u003e %{temperature: \"4\", condition: \"Mostly cloudy\"},\n            2 =\u003e %{temperature: \"4\", condition: \"Mostly cloudy\"},\n            3 =\u003e %{temperature: \"4\", condition: \"Mostly cloudy\"},\n            4 =\u003e %{temperature: \"4\", condition: \"Overcast with light rain\"},\n            5 =\u003e %{temperature: \"3\", condition: \"Partly cloudy\"},\n            6 =\u003e %{temperature: \"3\", condition: \"Partly cloudy\"},\n            7 =\u003e %{temperature: \"4\", condition: \"Clear with few low clouds\"},\n            8 =\u003e %{temperature: \"5\", condition: \"Clear with few low clouds\"},\n            9 =\u003e %{temperature: \"6\", condition: \"Clear with few low clouds\"},\n            10 =\u003e %{temperature: \"8\", condition: \"Clear with few low clouds\"},\n            11 =\u003e %{temperature: \"9\", condition: \"Clear with few low clouds\"},\n            12 =\u003e %{temperature: \"9\", condition: \"Partly cloudy\"},\n            13 =\u003e %{temperature: \"9\", condition: \"Partly cloudy\"},\n            14 =\u003e %{temperature: \"9\", condition: \"Mixed with showers\"},\n            15 =\u003e %{temperature: \"8\", condition: \"Partly cloudy\"},\n            16 =\u003e %{temperature: \"8\", condition: \"Partly cloudy\"},\n            17 =\u003e %{temperature: \"7\", condition: \"Partly cloudy\"},\n            18 =\u003e %{temperature: \"6\", condition: \"Partly cloudy\"},\n            19 =\u003e %{temperature: \"6\", condition: \"Partly cloudy\"},\n            20 =\u003e %{temperature: \"5\", condition: \"Partly cloudy\"},\n            21 =\u003e %{temperature: \"5\", condition: \"Clear with few low clouds\"},\n            22 =\u003e %{temperature: \"4\", condition: \"Clear with few low clouds\"},\n            23 =\u003e %{temperature: \"4\", condition: \"Clear with few low clouds\"},\n            24 =\u003e %{temperature: \"3\", condition: \"Partly cloudy\"}\n        }\n    },\n    {2, %{temp_max: \"28\", temp_min: \"11\", precip_max: \"0\", sun: \"13\", uv: \"6\"}},\n    ...\n]\n```\n\n## Development\n\nXPath strings can be easily retrieved through Chromes Developer Tools. To get a XPath to an element, just right-click it in the HTML view and select copy -\u003e copy XPath.\nTo validate a giving XPath string you can use it like that in the console: `$x(\"//input[@type='submit']\")`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femischorr%2Fforecaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femischorr%2Fforecaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femischorr%2Fforecaster/lists"}