We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I never used Github, I don't know how to propose new content. Thank you for your simple API.
I added 2 new function to splNetatmoAPI.php, it's mostly copy&paste but it can spare a few Minutes to someone:
public function getWeatherHumidity() { if (is_null($this->_weatherDatas)) $this->getWeatherDatas(); $modules = $this->_weatherDatas['body']['devices'][0]['modules']; $jsonDatas = array(); foreach ($modules as $module) { if (!isset($module['dashboard_data']['Humidity'])) continue; $name = $module['module_name']; $humidity = $module['dashboard_data']['Humidity']; $jsonDatas[$name] = $humidity; } //add main station: $jsonDatas[ $this->_weatherDatas['body']['devices'][0]['station_name'] ] = $this->_weatherDatas['body']['devices'][0]['dashboard_data']['Humidity']; return $jsonDatas; } public function getWeatherCO2() { if (is_null($this->_weatherDatas)) $this->getWeatherDatas(); $modules = $this->_weatherDatas['body']['devices'][0]['modules']; $jsonDatas = array(); foreach ($modules as $module) { if (!isset($module['dashboard_data']['CO2'])) continue; $name = $module['module_name']; $co2 = $module['dashboard_data']['CO2']; $jsonDatas[$name] = $co2; } //add main station: $jsonDatas[ $this->_weatherDatas['body']['devices'][0]['station_name'] ] = $this->_weatherDatas['body']['devices'][0]['dashboard_data']['CO2']; return $jsonDatas; }
and you can use it easily with:
$getWeatherHumudity = $_splNetatmo->getWeatherHumidity(); echo "Humidity:".str_replace('"','',json_encode($getWeatherHumudity, JSON_PRETTY_PRINT)); $getWeatherCO2 = $_splNetatmo->getWeatherCO2(); echo "CO2:".str_replace('"','',json_encode($getWeatherCO2, JSON_PRETTY_PRINT));
The text was updated successfully, but these errors were encountered:
Hello, I never used Github, I don't know how to propose new content. Thank you for your simple API. I added 2 new function to splNetatmoAPI.php, it's mostly copy&paste but it can spare a few Minutes to someone: public function getWeatherHumidity() { if (is_null($this->_weatherDatas)) $this->getWeatherDatas(); $modules = $this->_weatherDatas['body']['devices'][0]['modules']; $jsonDatas = array(); foreach ($modules as $module) { if (!isset($module['dashboard_data']['Humidity'])) continue; $name = $module['module_name']; $humidity = $module['dashboard_data']['Humidity']; $jsonDatas[$name] = $humidity; } //add main station: $jsonDatas[ $this->_weatherDatas['body']['devices'][0]['station_name'] ] = $this->_weatherDatas['body']['devices'][0]['dashboard_data']['Humidity']; return $jsonDatas; } public function getWeatherCO2() { if (is_null($this->_weatherDatas)) $this->getWeatherDatas(); $modules = $this->_weatherDatas['body']['devices'][0]['modules']; $jsonDatas = array(); foreach ($modules as $module) { if (!isset($module['dashboard_data']['CO2'])) continue; $name = $module['module_name']; $co2 = $module['dashboard_data']['CO2']; $jsonDatas[$name] = $co2; } //add main station: $jsonDatas[ $this->_weatherDatas['body']['devices'][0]['station_name'] ] = $this->_weatherDatas['body']['devices'][0]['dashboard_data']['CO2']; return $jsonDatas; } and you can use it easily with: $getWeatherHumudity = $_splNetatmo->getWeatherHumidity(); echo "Humidity:".str_replace('"','',json_encode($getWeatherHumudity, JSON_PRETTY_PRINT)); $getWeatherCO2 = $_splNetatmo->getWeatherCO2(); echo "CO2:".str_replace('"','',json_encode($getWeatherCO2, JSON_PRETTY_PRINT));
Hello, and for the Pressure? Do you know how we can have it, please?
Sorry, something went wrong.
No branches or pull requests
Hello, I never used Github, I don't know how to propose new content. Thank you for your simple API.
I added 2 new function to splNetatmoAPI.php, it's mostly copy&paste but it can spare a few Minutes to someone:
and you can use it easily with:
The text was updated successfully, but these errors were encountered: