Sitesensor - Setting up Openweathermap

Hi @rigpapa ,

Just discovered sitesensor! Thanks again for another great plugin! I don’t know why I keep shopping around for plugins, I should just go to Toggledbits and look for yours. LOL.

I followed your instructions on SiteSensor - Plugin for Vera Home Automation Controllers | toggledbits for openweathermap to pull weather data. Copied the recipe and tested URL successfully, but once the sensor was armed, it said: “Query OK, but 4 expressions failed”.

Here is the log:

23:49:58: SiteSensor: Requesting JSON data
23:49:58: SiteSensor: "GET" "http://api.openweathermap.org/data/2.5/forecast?id=6092122&APPID=MYAPIHERE", headers={  }
23:49:58: SiteSensor: Response is 14650 bytes in "/tmp/Q_SiteSensor_146.txt"
23:49:58: SiteSensor: Failed to execute `"last(response.weather).main"', { location=24, ["__source"]="luaxp", message="Can't dereference through null", type="evaluation" }
23:49:58: SiteSensor: Eval #1: "last(response.weather).main"=(nil)nil
23:49:58: SiteSensor: Eval #2: "response.name"=null
23:49:58: SiteSensor: Failed to execute `"round(response.main.temp - 273.15,1)"', { location=15, ["__source"]="luaxp", message="Can't dereference through null", type="evaluation" }
23:49:58: SiteSensor: Eval #3: "round(response.main.temp - 273.15,1)"=(nil)nil
23:49:58: SiteSensor: Failed to execute `"response.main.humidity"', { location=15, ["__source"]="luaxp", message="Can't dereference through null", type="evaluation" }
23:49:58: SiteSensor: Eval #4: "response.main.humidity"=(nil)nil
23:49:58: SiteSensor: Failed to execute `"response.main.pressure"', { location=15, ["__source"]="luaxp", message="Can't dereference through null", type="evaluation" }
23:49:58: SiteSensor: Eval #5: "response.main.pressure"=(nil)nil
23:49:58: SiteSensor: Eval trip expression: "response.cod == 200"=("boolean")true

Here is the data from openweathermap:

{"cod":"200","message":0,"cnt":40,"list":[{"dt":1590300000,"main":{"temp":289.36,"feels_like":287.6,"temp_min":288.51,"temp_max":289.36,"pressure":1031,"sea_level":1018,"grnd_level":1008,"humidity":77,"temp_kf":0.85},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":33},"wind":{"speed":3.48,"deg":79},"sys":{"pod":"n"},"dt_txt":"2020-05-24 06:00:00"},{"dt":1590310800,"main":{"temp":287.97,"feels_like":287.15,"temp_min":287.37,"temp_max":287.97,"pressure":1023,"sea_level":1017,"grnd_level":1008,"humidity":84,"temp_kf":0.6},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"clouds":{"all":62},"wind":{"speed":2.12,"deg":68},"sys":{"pod":"n"},"dt_txt":"2020-05-24 09:00:00"},{"dt":1590321600,"main":{"temp":289.32,"feels_like":289.82,"temp_min":289.26,"temp_max":289.32,"pressure":1019,"sea_level":1017,"grnd_level":1008,"humidity":86,"temp_kf":0.06},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":71},"wind":{"speed":1.01,"deg":121},"sys":{"pod":"d"},"dt_txt":"2020-05-24 12:00:00"},{"dt":1590332400,"main":{"temp":294.19,"feels_like":293.45,"temp_min":294.19,"temp_max":294.22,"pressure":1018,"sea_level":1018,"grnd_level":1008,"humidity":70,"temp_kf":-0.03},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":52},"wind":{"speed":3.55,"deg":177},"sys":{"pod":"d"},"dt_txt":"2020-05-24 15:00:00"},{"dt":1590343200,"main":{"temp":296.6,"feels_like":294.85,"temp_min":296.6,"temp_max":296.6,"pressure":1016,"sea_level":1016,"grnd_level":1007,"humidity":63,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":62},"wind":{"speed":5.34,"deg":168},"sys":{"pod":"d"},"dt_txt":"2020-05-24 18:00:00"},{"dt":1590354000,"main":{"temp":297.25,"feels_like":296.34,"temp_min":297.25,"temp_max":297.25,"pressure":1015,"sea_level":1015,"grnd_level":1005,"humidity":65,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":31},"wind":{"speed":4.76,"deg":169},"sys":{"pod":"d"},"dt_txt":"2020-05-24 21:00:00"},{"dt":1590364800,"main":{"temp":295.27,"feels_like":294.66,"temp_min":295.27,"temp_max":295.27,"pressure":1014,"sea_level":1014,"grnd_level":1005,"humidity":75,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":28},"wind":{"speed":4.55,"deg":187},"rain":{"3h":3.01},"sys":{"pod":"d"},"dt_txt":"2020-05-25 00:00:00"},{"dt":1590375600,"main":{"temp":292.71,"feels_like":291.98,"temp_min":292.71,"temp_max":292.71,"pressure":1015,"sea_level":1015,"grnd_level":1005,"humidity":86,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":11},"wind":{"speed":4.53,"deg":199},"rain":{"3h":2},"sys":{"pod":"n"},"dt_txt":"2020-05-25 03:00:00"},{"dt":1590386400,"main":{"temp":291.75,"feels_like":290.37,"temp_min":291.75,"temp_max":291.75,"pressure":1015,"sea_level":1015,"grnd_level":1005,"humidity":90,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":11},"wind":{"speed":5.33,"deg":210},"rain":{"3h":0.75},"sys":{"pod":"n"},"dt_txt":"2020-05-25 06:00:00"},{"dt":1590397200,"main":{"temp":290.82,"feels_like":289.87,"temp_min":290.82,"temp_max":290.82,"pressure":1015,"sea_level":1015,"grnd_level":1006,"humidity":92,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":66},"wind":{"speed":4.39,"deg":214},"rain":{"3h":0.14},"sys":{"pod":"n"},"dt_txt":"2020-05-25 09:00:00"},{"dt":1590408000,"main":{"temp":291.76,"feels_like":291.36,"temp_min":291.76,"temp_max":291.76,"pressure":1017,"sea_level":1017,"grnd_level":1007,"humidity":90,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":66},"wind":{"speed":3.93,"deg":223},"sys":{"pod":"d"},"dt_txt":"2020-05-25 12:00:00"},{"dt":1590418800,"main":{"temp":293.69,"feels_like":293.89,"temp_min":293.69,"temp_max":293.69,"pressure":1017,"sea_level":1017,"grnd_level":1008,"humidity":85,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":99},"wind":{"speed":3.66,"deg":220},"rain":{"3h":0.26},"sys":{"pod":"d"},"dt_txt":"2020-05-25 15:00:00"},{"dt":1590429600,"main":{"temp":297.38,"feels_like":298.36,"temp_min":297.38,"temp_max":297.38,"pressure":1017,"sea_level":1017,"grnd_level":1008,"humidity":73,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":97},"wind":{"speed":3.27,"deg":225},"sys":{"pod":"d"},"dt_txt":"2020-05-25 18:00:00"},{"dt":1590440400,"main":{"temp":299.83,"feels_like":300.68,"temp_min":299.83,"temp_max":299.83,"pressure":1016,"sea_level":1016,"grnd_level":1006,"humidity":63,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":23},"wind":{"speed":3.43,"deg":220},"rain":{"3h":0.4},"sys":{"pod":"d"},"dt_txt":"2020-05-25 21:00:00"},{"dt":1590451200,"main":{"temp":297.87,"feels_like":299.23,"temp_min":297.87,"temp_max":297.87,"pressure":1016,"sea_level":1016,"grnd_level":1007,"humidity":71,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":13},"wind":{"speed":2.74,"deg":231},"sys":{"pod":"d"},"dt_txt":"2020-05-26 00:00:00"},{"dt":1590462000,"main":{"temp":294.68,"feels_like":296.02,"temp_min":294.68,"temp_max":294.68,"pressure":1017,"sea_level":1017,"grnd_level":1007,"humidity":81,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":26},"wind":{"speed":2.15,"deg":224},"sys":{"pod":"n"},"dt_txt":"2020-05-26 03:00:00"},{"dt":1590472800,"main":{"temp":293.02,"feels_like":294.26,"temp_min":293.02,"temp_max":293.02,"pressure":1017,"sea_level":1017,"grnd_level":1008,"humidity":84,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"clouds":{"all":18},"wind":{"speed":1.68,"deg":211},"sys":{"pod":"n"},"dt_txt":"2020-05-26 06:00:00"},{"dt":1590483600,"main":{"temp":292.04,"feels_like":293.31,"temp_min":292.04,"temp_max":292.04,"pressure":1017,"sea_level":1017,"grnd_level":1007,"humidity":89,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"clouds":{"all":8},"wind":{"speed":1.61,"deg":212},"sys":{"pod":"n"},"dt_txt":"2020-05-26 09:00:00"},{"dt":1590494400,"main":{"temp":293.47,"feels_like":293.89,"temp_min":293.47,"temp_max":293.47,"pressure":1018,"sea_level":1018,"grnd_level":1009,"humidity":83,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":6},"wind":{"speed":3,"deg":213},"sys":{"pod":"d"},"dt_txt":"2020-05-26 12:00:00"},{"dt":1590505200,"main":{"temp":297.29,"feels_like":297.76,"temp_min":297.29,"temp_max":297.29,"pressure":1019,"sea_level":1019,"grnd_level":1009,"humidity":70,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":12},"wind":{"speed":3.51,"deg":196},"sys":{"pod":"d"},"dt_txt":"2020-05-26 15:00:00"},{"dt":1590516000,"main":{"temp":300.28,"feels_like":300.83,"temp_min":300.28,"temp_max":300.28,"pressure":1018,"sea_level":1018,"grnd_level":1009,"humidity":61,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":44},"wind":{"speed":3.8,"deg":191},"rain":{"3h":1.13},"sys":{"pod":"d"},"dt_txt":"2020-05-26 18:00:00"},{"dt":1590526800,"main":{"temp":301.06,"feels_like":301.35,"temp_min":301.06,"temp_max":301.06,"pressure":1017,"sea_level":1017,"grnd_level":1008,"humidity":59,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":94},"wind":{"speed":4.3,"deg":203},"rain":{"3h":0.14},"sys":{"pod":"d"},"dt_txt":"2020-05-26 21:00:00"},{"dt":1590537600,"main":{"temp":298.74,"feels_like":299.33,"temp_min":298.74,"temp_max":298.74,"pressure":1017,"sea_level":1017,"grnd_level":1008,"humidity":67,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":93},"wind":{"speed":3.78,"deg":224},"rain":{"3h":0.18},"sys":{"pod":"d"},"dt_txt":"2020-05-27 00:00:00"},{"dt":1590548400,"main":{"temp":295.81,"feels_like":297.03,"temp_min":295.81,"temp_max":295.81,"pressure":1018,"sea_level":1018,"grnd_level":1008,"humidity":77,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":92},"wind":{"speed":2.51,"deg":235},"sys":{"pod":"n"},"dt_txt":"2020-05-27 03:00:00"},{"dt":1590559200,"main":{"temp":294.35,"feels_like":295.07,"temp_min":294.35,"temp_max":294.35,"pressure":1018,"sea_level":1018,"grnd_level":1008,"humidity":82,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":96},"wind":{"speed":2.96,"deg":213},"sys":{"pod":"n"},"dt_txt":"2020-05-27 06:00:00"},{"dt":1590570000,"main":{"temp":293.18,"feels_like":293.98,"temp_min":293.18,"temp_max":293.18,"pressure":1018,"sea_level":1018,"grnd_level":1008,"humidity":86,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":100},"wind":{"speed":2.61,"deg":213},"sys":{"pod":"n"},"dt_txt":"2020-05-27 09:00:00"},{"dt":1590580800,"main":{"temp":293.56,"feels_like":293.49,"temp_min":293.56,"temp_max":293.56,"pressure":1018,"sea_level":1018,"grnd_level":1009,"humidity":79,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":100},"wind":{"speed":3.29,"deg":216},"sys":{"pod":"d"},"dt_txt":"2020-05-27 12:00:00"},{"dt":1590591600,"main":{"temp":296.71,"feels_like":297.41,"temp_min":296.71,"temp_max":296.71,"pressure":1018,"sea_level":1018,"grnd_level":1009,"humidity":69,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":100},"wind":{"speed":2.71,"deg":198},"sys":{"pod":"d"},"dt_txt":"2020-05-27 15:00:00"},{"dt":1590602400,"main":{"temp":299.7,"feels_like":300.14,"temp_min":299.7,"temp_max":299.7,"pressure":1018,"sea_level":1018,"grnd_level":1008,"humidity":59,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":3.28,"deg":185},"rain":{"3h":0.26},"sys":{"pod":"d"},"dt_txt":"2020-05-27 18:00:00"},{"dt":1590613200,"main":{"temp":300.16,"feels_like":299.92,"temp_min":300.16,"temp_max":300.16,"pressure":1017,"sea_level":1017,"grnd_level":1007,"humidity":57,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":79},"wind":{"speed":4.19,"deg":223},"rain":{"3h":0.68},"sys":{"pod":"d"},"dt_txt":"2020-05-27 21:00:00"},{"dt":1590624000,"main":{"temp":297.77,"feels_like":297.72,"temp_min":297.77,"temp_max":297.77,"pressure":1016,"sea_level":1016,"grnd_level":1007,"humidity":65,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":70},"wind":{"speed":3.82,"deg":219},"sys":{"pod":"d"},"dt_txt":"2020-05-28 00:00:00"},{"dt":1590634800,"main":{"temp":294.93,"feels_like":294.76,"temp_min":294.93,"temp_max":294.93,"pressure":1017,"sea_level":1017,"grnd_level":1007,"humidity":73,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":100},"wind":{"speed":3.48,"deg":213},"sys":{"pod":"n"},"dt_txt":"2020-05-28 03:00:00"},{"dt":1590645600,"main":{"temp":293.29,"feels_like":293.39,"temp_min":293.29,"temp_max":293.29,"pressure":1016,"sea_level":1016,"grnd_level":1007,"humidity":78,"temp_kf":0},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":96},"wind":{"speed":2.79,"deg":224},"sys":{"pod":"n"},"dt_txt":"2020-05-28 06:00:00"},{"dt":1590656400,"main":{"temp":292.41,"feels_like":292.64,"temp_min":292.41,"temp_max":292.41,"pressure":1016,"sea_level":1016,"grnd_level":1006,"humidity":83,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":26},"wind":{"speed":2.67,"deg":212},"sys":{"pod":"n"},"dt_txt":"2020-05-28 09:00:00"},{"dt":1590667200,"main":{"temp":293.61,"feels_like":293.35,"temp_min":293.61,"temp_max":293.61,"pressure":1016,"sea_level":1016,"grnd_level":1007,"humidity":80,"temp_kf":0},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":{"all":13},"wind":{"speed":3.71,"deg":222},"sys":{"pod":"d"},"dt_txt":"2020-05-28 12:00:00"},{"dt":1590678000,"main":{"temp":297.56,"feels_like":297.2,"temp_min":297.56,"temp_max":297.56,"pressure":1016,"sea_level":1016,"grnd_level":1006,"humidity":68,"temp_kf":0},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":{"all":0},"wind":{"speed":4.57,"deg":209},"sys":{"pod":"d"},"dt_txt":"2020-05-28 15:00:00"},{"dt":1590688800,"main":{"temp":299.84,"feels_like":298.41,"temp_min":299.84,"temp_max":299.84,"pressure":1014,"sea_level":1014,"grnd_level":1004,"humidity":61,"temp_kf":0},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":10},"wind":{"speed":6.36,"deg":218},"rain":{"3h":0.43},"sys":{"pod":"d"},"dt_txt":"2020-05-28 18:00:00"},{"dt":1590699600,"main":{"temp":299.91,"feels_like":298.65,"temp_min":299.91,"temp_max":299.91,"pressure":1012,"sea_level":1012,"grnd_level":1003,"humidity":61,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":{"all":49},"wind":{"speed":6.16,"deg":222},"sys":{"pod":"d"},"dt_txt":"2020-05-28 21:00:00"},{"dt":1590710400,"main":{"temp":297.54,"feels_like":297.35,"temp_min":297.54,"temp_max":297.54,"pressure":1012,"sea_level":1012,"grnd_level":1003,"humidity":69,"temp_kf":0},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":{"all":69},"wind":{"speed":4.47,"deg":231},"sys":{"pod":"d"},"dt_txt":"2020-05-29 00:00:00"},{"dt":1590721200,"main":{"temp":294.95,"feels_like":294.6,"temp_min":294.95,"temp_max":294.95,"pressure":1013,"sea_level":1013,"grnd_level":1003,"humidity":79,"temp_kf":0},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"clouds":{"all":35},"wind":{"speed":4.49,"deg":233},"sys":{"pod":"n"},"dt_txt":"2020-05-29 03:00:00"}],"city":{"id":6092122,"name":"Oakville","coord":{"lat":43.4501,"lon":-79.6829},"country":"CA","timezone":-14400,"sunrise":1590227189,"sunset":1590281093}}

I’m playing around with it now, but has anything changed from the toggledbits instructions?

EDIT: just realized I did a city code instead of zip code (because I’m in canada). That may have caused the problem due to number of stations in my city. will try Latitude/Longitude instead…will update if that fixes it.

Yes that fixed the problem!

Used:
http://api.openweathermap.org/data/2.5/weather?lat=LATITUDEHERE&lon=LONGITUDEHERE&appid=MYAPIHERE

Pulled Lat and Lon from google maps by following these instructions.

1 Like