Xorfor / HA-PWS

Capture data directly from your PWS into Home Assistant
GNU General Public License v3.0
25 stars 0 forks source link

Dict Errors #8

Closed MarcelMertens closed 10 months ago

MarcelMertens commented 10 months ago

Hi, i'm currenlty migrating from IOBroker to HA and try to integrate my Ventus W820.

For Debugging reasing i set the API Endpoint of the PWS to: https://webhook.site/#!/16272b42-ba2a-4ad0-97ce-fb402ba38fa4/a1d58eb5-6494-4306-a0f0-b903868c953f/1

Any idea what i'm doing wrong?

`2023-12-10 22:09:02.146 DEBUG (MainThread) [homeassistant.components.webhook] Handling webhook POST payload for pws 2023-12-10 22:09:02.148 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ ((trigger.data.tempf | float - 32) / 1.8) | round(1) }}' 2023-12-10 22:09:02.148 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_temperature: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.149 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ ((trigger.data.tempinf | float - 32) / 1.8) | round(1) }}' 2023-12-10 22:09:02.149 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_temperature_indoor: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.149 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.humidity }}' 2023-12-10 22:09:02.149 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_humidity: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.150 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.humidityin }}' 2023-12-10 22:09:02.150 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_humidity_indoor: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.150 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.baromrelin | float 33.86) | round(1) }}' 2023-12-10 22:09:02.150 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_barometer_relative: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.151 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.baromabsin | float 33.86) | round(1) }}' 2023-12-10 22:09:02.151 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_barometer_absolute: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.151 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.rainratein | float 2.54 10) | round(1) }}' 2023-12-10 22:09:02.151 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_rainrate: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.152 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.dailyrainin | float 2.54 10) | round(1) }}' 2023-12-10 22:09:02.152 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_rain: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.153 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.solarradiation | float }}' 2023-12-10 22:09:02.153 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_solar_radiation: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.153 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.uv }}' 2023-12-10 22:09:02.153 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_uv: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.158 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.windspeedmph | float 0.44704) | round(1) }}' 2023-12-10 22:09:02.159 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_wind_speed: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.159 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (trigger.data.windgustmph | float 0.44704) | round(1) }}' 2023-12-10 22:09:02.159 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_wind_gust: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.159 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.winddir }}' 2023-12-10 22:09:02.160 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_wind_direction: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.160 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_wind_direction_text: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set direction = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'] %} {% set degree = states('sensor.pws_wind_direction') | float %} {{ direction[((degree + 11.25) / 22.5) | int] }}' but no default was specified 2023-12-10 22:09:02.160 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.stationtype }}' 2023-12-10 22:09:02.160 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_stationtype: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.161 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ trigger.data.model }}' 2023-12-10 22:09:02.161 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_model: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.161 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'data' when rendering '{{ ((trigger.data.humidity | float / 100) * (1 / 8) (112 + 0.9 ((trigger.data.tempf | float - 32) / 1.8)) + 0.1 ((trigger.data.tempf | float - 32) / 1.8) - 112) | round(1) }}' 2023-12-10 22:09:02.161 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_dewpoint: UndefinedError: 'dict object' has no attribute 'data' 2023-12-10 22:09:02.162 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_windchill: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set v = states('sensor.pws_wind_speed') | float %} {% set t = states('sensor.pws_temperature') | float %} {% if t > -46.0 and t < 10.0 and v > 1.3 and v < 49.0 %} {% set w = v 0.16 %} {{ (13.12 + 0.6215 t - 13.96 w + 0.4867 t w) | round(1) }} {% else %} {{ t }} {% endif %}' but no default was specified 2023-12-10 22:09:02.162 ERROR (MainThread) [homeassistant.helpers.sensor] Error rendering state template for sensor.pws_heat_index: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set t = states('sensor.pws_temperature') | float %} {% set h = states('sensor.pws_humidity') | float %} {% if t >= 26 and h >= 0.0 and h <= 100.0 %} {% set tp = t 2 %} {% set hp = h ** 2 %} {{ (-8.78469475556

Xorfor commented 10 months ago

Marcel,

Did you configure your PWS as described in the README.md? So with Ecowitt and the correct ip address/port? Is it possible to get the json from your PWS? My guess is that you received an empty json from your PWS.

MarcelMertens commented 10 months ago

It is working now. I dont know the exact reason. Due to the issue that the EasyWeather only send to HTTP endpoints i put a nginx reverseproxy infront. After checking i saw that the endpoint responded with 301?? error. I reconfigured a lot and suddenly it worked.