Skip to content

Latest commit

 

History

History
102 lines (76 loc) · 2.13 KB

build-a-tempsensor-raspi.adoc

File metadata and controls

102 lines (76 loc) · 2.13 KB

Needs python libs

python dev requests vcgencmd time math datetime envirophat schedule

Based on

Raspberry Pi Zero W Pimoroni enviropHAT

pip install schedule vcgendcmd requests pyowm

Wolfram Alpha Solve for Temp

x = raw temp y = Measured Temp z = cpu temp

x = 32.434425, y = 27.0, z = 36.300000, y = x - ((z - x)/a)

Emojis to use

Conditions

Faces

TODO

  • build data collection script

  • store in JSON

  • every 15mins write to file and create average

  • read averages and calculate thresholds

  • define limits when to send message

  • map OWM weather ids/descriptions to Slack emoji

  • figure out how to deploy webhook variable in screen session

  • build error handling

DONE

  • read every 30 sec

  • send weather report at 0800 1200

Traceback (most recent call last):
  File "tempi-script.py", line 149, in <module>
    perform_update()
  File "tempi-script.py", line 134, in perform_update
    get_condition()
  File "tempi-script.py", line 62, in get_condition
    observation = owm.weather_at_zip_code(zip_code,country_code)
  File "/usr/local/lib/python2.7/dist-packages/pyowm/webapi25/owm25.py", line 282, in weather_at_zip_code
    'lang': self._language})
  File "/usr/local/lib/python2.7/dist-packages/pyowm/commons/weather_client.py", line 94, in call_API
    return self._lookup_cache_or_invoke_API(self._cache, url, timeout)
  File "/usr/local/lib/python2.7/dist-packages/pyowm/commons/weather_client.py", line 65, in _lookup_cache_or_invoke_API
    raise api_call_error.APICallError(str(e), e)
pyowm.exceptions.api_call_error.APICallError: Exception in calling OWM web API.
Reason: <urlopen error [Errno -2] Name or service not known>
Caused by: <urlopen error [Errno -2] Name or service not known>