Skip to content
New issue

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

Pollen index KeyError #58

Open
fettlaus opened this issue Mar 31, 2021 · 5 comments
Open

Pollen index KeyError #58

fettlaus opened this issue Mar 31, 2021 · 5 comments

Comments

@fettlaus
Copy link

My integration started reporting errors while handling pollen values for my area. It seems there is some kind of unit conversion error with the pollen index going on.

Logger: homeassistant.helpers.entity
Source: custom_components/climacell/sensor.py:411
First occurred: 26. März 2021, 22:50:19 (3158 occurrences)
Last logged: 10:50:03

Update for sensor.cc_climacell_pollen_tree fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 277, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 473, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/climacell/sensor.py", line 411, in update
    self._state = self.__valuemap[str(self._state)]
KeyError: '0.83'

This is my configuration:

- platform: climacell
  api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  name: climacell
  units: metric
  timelines:
    - name: "" #Realtime
      timestep: "1m"
      forecast_observations: 1
      fields:
        - temperatureMax
        - feels_like
        - humidity
        - wind_speed
        - wind_direction
        - wind_gust
        - pressure
        - precipitationIntensity
        - precipitation_type
        - visibility
        - cloud_cover
        - weather_condition
        - pm25
        - pm10
        - o3
        - no2
        - co
        - so2
        - epa_aqi
        - epa_health_concern
        - pollen_tree
        - pollen_weed
        - pollen_grass
        - fire_index
      update: auto
      scan_interval:
        # At least one of these must be specified:
        days: 0
        hours: 1
        minutes: 0
        seconds: 0
        milliseconds: 0
      exclude_interval:
        1:
          - "00:00"
          - "07:00"
    - name: "" #Daily
      timestep: "1d"
      forecast_observations: 5
      fields:
        - temperature
        - temperatureMin
        - temperatureMax
        - precipitationIntensityMin
        - precipitationIntensityMax
        - precipitation_probability
        - weather_condition
      scan_interval:
        # At least one of these must be specified:
        days: 0
        hours: 4
        minutes: 0
        seconds: 0
        milliseconds: 0
      exclude_interval:
        1:
          - "23:00"
          - "06:30"
@Krojack
Copy link

Krojack commented Apr 6, 2021

I'm getting similar

Logger: homeassistant.components.sensor
Source: custom_components/climacell/sensor.py:411
Integration: Sensor (documentation, issues)
First occurred: 3:02:53 PM (1 occurrences)
Last logged: 3:02:53 PM

climacell: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 465, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/climacell/sensor.py", line 411, in update
    self._state = self.__valuemap[str(self._state)]
KeyError: '1.95'

Everything seems to be working but the daily pollen_tree.

@Krojack
Copy link

Krojack commented Apr 7, 2021

Update: The error went away for me today after a restart and the pollen_tree sensor is working again. Maybe this was a problem on Climacell's side.

@damousys
Copy link

I Have the same issue

@mbrihed
Copy link

mbrihed commented Apr 13, 2021

I seem to have the same issue. It seems it is only pollen_tree the other seems ok.

@mbrihed
Copy link

mbrihed commented Apr 13, 2021

Update: Just did an upgrade to core-2021.4.4 and then it worked fine again. SO now I have the sensor working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants