[Модуль] OpenWeatherMap (openweather) Не актуально!

Разработка дополнительных модулей, подключение различных приложений.

Модератор: immortal

MaxVM
Сообщения: 69
Зарегистрирован: Вт янв 10, 2017 2:26 pm

Re: Модуль - Погода от OpenWeatherMap

Сообщение MaxVM »

Приветствую!
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?

Хоть с какого нить сервиса

Спасибо
bat86
Сообщения: 80
Зарегистрирован: Пн ноя 30, 2015 10:20 pm

Re: Модуль - Погода от OpenWeatherMap

Сообщение bat86 »

У меня всё работает, никаких проблем нет
Aranaks
Сообщения: 2
Зарегистрирован: Вт май 31, 2016 5:30 pm

Re: Модуль - Погода от OpenWeatherMap

Сообщение Aranaks »

Действительно странно, у меня море ошибок и не работает.
smden
Сообщения: 19
Зарегистрирован: Сб апр 23, 2016 10:42 am

Re: Модуль - Погода от OpenWeatherMap

Сообщение smden »

У них теперь авторизация, надо php скрипт чуть допилить. Тока сначала там зарегится и получить appkey
Raspberry Pi 3
wildsm
Сообщения: 6
Зарегистрирован: Пт дек 25, 2015 12:28 am

Re: Модуль - Погода от OpenWeatherMap

Сообщение wildsm »

Напиши подробней, пожалуйста, что допилить надо?
maks_mkv
Сообщения: 16
Зарегистрирован: Пн янв 09, 2017 1:52 am

Re: Модуль - Погода от OpenWeatherMap

Сообщение maks_mkv »

Как сделать, чо бы модуль заработал ? на сайте зарегистрировался, код ввел и все равно ошибки
Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300
smden
Сообщения: 19
Зарегистрирован: Сб апр 23, 2016 10:42 am

Re: Модуль - Погода от OpenWeatherMap

Сообщение smden »

У меня другой видать модуль.
require_once("./lib/OpenWeather/OpenWeather.php");
Но суть не меняет. Данные вытягиваются функцией

protected static function GetJsonWeatherDataByCityID
($vCityID,
$vUnits = "metric")
{
if (!isset($vCityID)) return null;

$vUnits = OpenWeather::GetUnits($vUnits);
$query = "http://api.openweathermap.org/data/2.5/weather?id=" . $vCityID. "&APPID=твойАППКЕЙ&units=" . $vUnits;
$data = json_decode(file_get_contents($query));

return $data;
}

далее в сценарии

require_once("./lib/OpenWeather/OpenWeather.php"); // Подключаем погодный класс
$weather = new OpenWeather(); // наследуем класс
$curWeather = $weather->GetWeatherByCityID("524901", "metric"); // получаем массив с данными о погоде
$widget = $weather->GetCurrentWeatherWidgetByCityID("524901","metric"); // html код с детализацией о погоде
$temp = $curWeather->main->temp; // берём из массива температуру
setGlobal('ThisComputer.TempOutside', $temp); // обновляем свойства
setGlobal('ThisComputer.weatherFull', $widget); // обновляем свойства
$this->setProperty('tempoutside.Temp',$temp);

ну как-то так.
И на сайте ихнем всё подробно есть http://openweathermap.org/current
Raspberry Pi 3
eygen
Сообщения: 393
Зарегистрирован: Чт сен 25, 2014 5:37 pm
Откуда: Екатеринбург

Re: Модуль - Погода от OpenWeatherMap

Сообщение eygen »

maks_mkv писал(а):Как сделать, чо бы модуль заработал ? на сайте зарегистрировался, код ввел и все равно ошибки
Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300
Пол часика подожди, ключ дают но он еще не активен...
Sl1ng3R
Сообщения: 4
Зарегистрирован: Сб янв 14, 2017 10:12 pm

Re: Модуль - Погода от OpenWeatherMap

Сообщение Sl1ng3R »

Всем привет.
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...
kas5858
Сообщения: 366
Зарегистрирован: Вс янв 15, 2017 5:34 pm
Откуда: Москва

Re: Модуль - Погода от OpenWeatherMap

Сообщение kas5858 »

Появился недавно конфликт модуля OpenWeather и Онлайн радио, при обновлении погоды включается одна и та же радио станция (причем не важно обновлять в ручную или через onNewHour). После удаления модуля Онлайн радио, каждое обновление модуля OpenWeather ругается на отсутствие Онлайн радио. Не подскажите что может мешать их союзу?
Raspberry Pi3 - Broadlink - MegaD - Много датчиков - Камеры - Часы.
Изображение Connect
Закрыто