ha-climacell-weather icon indicating copy to clipboard operation
ha-climacell-weather copied to clipboard

After update errors

Open Arturasm opened this issue 4 years ago • 40 comments

Logger: homeassistant.components.sensor Source: custom_components/climacell/sensor.py:241 Integration: Sensor (documentation, issues) First occurred: 12:18:22 PM (1 occurrences) Last logged: 12:18:22 PM

Error while setting up climacell platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform await asyncio.shield(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 241, in setup_platform unit = UNITS[units][field] KeyError: 'sunsetTime'

Arturasm avatar Jan 22 '21 10:01 Arturasm

I have the same problem

gio82c avatar Jan 22 '21 16:01 gio82c

My logs are filling rapidly :

Logger: custom_components.climacell.sensor Source: custom_components/climacell/sensor.py:411 Integration: Climacell weather (documentation) First occurred: 12:22:19 (4312 occurrences) Last logged: 16:51:22

TimelineSensor.update - Provider has no data for: cc cc Weather Condition TimelineSensor.update - Provider has no data for: cc cc Temperature TimelineSensor.update - Provider has no data for: cc cc Humidity Percentage TimelineSensor.update - Provider has no data for: cc cc Barometric pressure

Also showing :

Logger: custom_components.climacell.data_provider Source: custom_components/climacell/data_provider.py:226 Integration: Climacell weather (documentation) First occurred: 12:22:15 (2 occurrences) Last logged: 12:22:15

ClimacellTimelineDataProvider._retrieve_data error status_code 401

Thrasher2020 avatar Jan 22 '21 16:01 Thrasher2020

Same problem here.

jmutnick avatar Jan 22 '21 17:01 jmutnick

Registering with a V4 API key and replacing the V3 stops the errors. There are only 4 sensors now though :(

I have lost all the 5 minute update sensors :( :(

Thrasher2020 avatar Jan 22 '21 17:01 Thrasher2020

I have the same problem also with API V4.

gio82c avatar Jan 22 '21 17:01 gio82c

Same problem here after updating.

solidminds avatar Jan 22 '21 22:01 solidminds

Same problem, also.

rc60 avatar Jan 23 '21 07:01 rc60

I created yet another account on the climacell site to get the v4 API. I put that in my config replacing the v3 key and my errors are gone. All my sensors have values but appear wrong. Temps are saying it's 19f out but it's really 28f.

Also all my daily forecast are gone. It looks like they want to charge a crazy price for precipitation data.

Overview-Home-Assistant

Krojack avatar Jan 23 '21 16:01 Krojack

Hi, unfortunately the ClimaCell API version 4 with a Timestep equal to "1d" (daily) returns only an average value, while at the moment the min and max values are no longer supported.

r-renato avatar Jan 23 '21 16:01 r-renato

Hi. Looks like its not just me with issues on this.

I use the precipitation_probability. Is this not available now ?

Do we need to register for a new v4 api ?

I think the instructions may need updating if so.

Thanks

martyn

nytram-md avatar Jan 23 '21 19:01 nytram-md

Hi,

@Arturasm: That was a bug in my code regarding *Time fields missing the unit of Measurement. I think I fixed it in my banch. Could you please verify this and comment in the the Pull request. @Thrasher2020: Could you please post your sensor config. (redacting secrets of course). @r-renato: sorry to correct you Renato but from how I interpret the documentation Min and Max values should be available. You have to add another field with a Min or Max suffix. I think we should add a example for this usecase to the README.

cbergmann avatar Jan 24 '21 06:01 cbergmann

@Krojack It seems that the core data layers are free and precipitation should be part of Core. So you should get these values. Maybe another bug or changed naming of sensors. Could you please check your log and post your config (redacting secrets) here or via mail.

cbergmann avatar Jan 24 '21 06:01 cbergmann

Hi,

@Arturasm: That was a bug in my code regarding *Time fields missing the unit of Measurement. I think I fixed it in my banch. Could you please verify this and comment in the the Pull request. @Thrasher2020: Could you please post your sensor config. (redacting secrets of course). @r-renato: sorry to correct you Renato but from how I interpret the documentation Min and Max values should be available. You have to add another field with a Min or Max suffix. I think we should add a example for this usecase to the README.

V3 ir V4 should be used?

Arturasm avatar Jan 24 '21 09:01 Arturasm

About the fields, we must use the integration names or the core names listed in the api documentation? For example we must use precipitation_type or precipitationType? And more can we use the nowcast field like before? Can someone quote his configuration to help each others? Mine actually is:

- platform: climacell
  api_key: !secret climacell_api
  name: climacell
  latitude: !secret latitude_casa
  longitude: !secret longitude_casa
  units: metric
  timelines:
    - name: "Daily"
      fields:
        - weather_condition
        - temperature
        - feels_like
        - humidity
        - visibility
        - cloud_cover
        - cloud_base
        - cloud_ceiling
        - surface_shortwave_radiation
        - precipitation
        - precipitation_type
        - precipitation_probability
        - pressure
        - wind_speed
        - wind_direction
        - wind_gust
        - moon_phase
        - sunset
        - sunrise
        - pm25
        - pm10
        - o3
        - co
        - so2
        - no2
        - epa_aqi
        - epa_health_concern
        - pollen_tree
        - pollen_weed
        - pollen_grass
        - road_risk_score
        - road_risk_confidence
        - road_risk_conditions
        - fire_index
      start_time: -5
      forecast_observations: 3
      timestep: "1d"
      update: auto
      scan_interval:
        days: 0
        hours: 2
        minutes: 0
        seconds: 0
        milliseconds: 0
      exclude_interval:
        1:
          - "23:30"
          - "06:00"
    - name: hourly
      forecast_observations: 1
      timestep: "1h"
      start_time: - 5
      update: auto
      fields:
        - temperature
        - feels_like
        - humidity
        - visibility
        - cloud_cover
        - precipitation
        - precipitation_probability
        - precipitation_type
        - pressure
        - wind_speed
        - wind_direction
        - wind_gust
        - cloud_cover
        - cloud_base
        - cloud_ceiling
        - pm25
        - pm10
        - o3
        - co
        - so2
        - no2
        - epa_aqi
        - epa_health_concern
        - pollen_tree
        - pollen_weed
        - pollen_grass
        - road_risk_score
        - road_risk
        - road_risk_confidence
        - road_risk_conditions
      scan_interval:
        days: 0
        hours: 2
        minutes: 0
        seconds: 0
        milliseconds: 0
      exclude_interval:
        1:
          - "00:00"
          - "06:30"
        2:
          - "10:00"
          - "12:00"
    - name: nowcast
      timestep: 15
      forecast_observations: 1
      conditions:
        - weather_condition
        - temperature
        - feels_like
        - humidity
        - visibility
        - cloud_cover
        - cloud_base
        - cloud_ceiling
        - surface_shortwave_radiation
        - precipitation
        - precipitation_type
        - pressure
        - wind_speed
        - wind_direction
        - wind_gust
        - pm25
        - pm10
        - o3
        - co
        - so2
        - no2
        - epa_aqi
        - epa_health_concern
        - pollen_tree
        - pollen_weed
        - pollen_grass
        - road_risk_confidence
        - road_risk_conditions
      scan_interval:
        days: 0
        hours: 2
        minutes: 0
        seconds: 0
        milliseconds: 0
      exclude_interval:
        1:
          - "00:00"
          - "06:30"
        2:
          - "10:00"
          - "12:00"
       ```

mfabiani53 avatar Jan 24 '21 10:01 mfabiani53

Hi,

@Arturasm unfortunately I only have a V4 API key. Therefore I can only test my code with V4 and my Code only works with V4.

@mfabiani53 My code contains backward compatibility code for the "old" attributes "nowcast", "realtime", "daily" and "hourly" and converts them to "timeline"s before creating the sensors. Therefore you can mix "timeline" and the old configuration. The same is true for the "fields" (new config) and "conditions" (old config). You should be able to use precipitation_type or precipitationType. You can also combine it with a suffix (e.g. temperatureMax) or the "Raw" prefix for Mapped fields like "RawweatherCode". In your Config I see the following Problems: 1. you use conditions instead of fields. 2. there is a space in "- 5" in your start_time of your hourly timeline. 3. your nowcast timeline misses a suffix ("h","m","d") in the timestep field.

cbergmann avatar Jan 24 '21 10:01 cbergmann

Yes, you're right, i corrected it and now restarting to see if all is working again... Can you share your configuration? No way... after restarting no climacell sensor is created... I resigned new to get the V4 API... EDIT: I'm getting this error:

2021-01-24 12:16:44 ERROR (SyncWorker_7) [custom_components.climacell.data_provider] ClimacellTimelineDataProvider._retrieve_data error status_code 400

Wha's the meaning?

mfabiani53 avatar Jan 24 '21 11:01 mfabiani53

Yes, you're right, i corrected it and now restarting to see if all is working again... Can you share your configuration? No way... after restarting no climacell sensor is created... I resigned new to get the V4 API... EDIT: I'm getting this error:

2021-01-24 12:16:44 ERROR (SyncWorker_7) [custom_components.climacell.data_provider] ClimacellTimelineDataProvider._retrieve_data error status_code 400

Wha's the meaning?

I get this error too

Logger: custom_components.climacell.data_provider Source: custom_components/climacell/data_provider.py:226 Integration: Climacell weather (documentation) First occurred: 2:12:39 PM (1 occurrences) Last logged: 2:12:39 PM

ClimacellTimelineDataProvider._retrieve_data error status_code 400

Arturasm avatar Jan 24 '21 12:01 Arturasm

Do you have the sensors created or not?

mfabiani53 avatar Jan 24 '21 13:01 mfabiani53

Do you have the sensors created or not?

Yes. All unknown of course 😁

Arturasm avatar Jan 24 '21 13:01 Arturasm

Hi

After a play around last night. I got all mine working again on the below yaml.

Im more after when its going to rain and the feels like temperature. In v3 api, all I got was the temperature and feels like been the same 99% of the time but now in v4 api that I signed up for last night. I get 2 values that seem correct and the chance of rain for the next 6 hours as I want.

Hope this helps some of you guys.

Feel free to use in the instructions if required as they were not the best in this situation but hey, we got there.

Pastebin link to yaml https://pastebin.com/efCKzcPM

Thanks again

Martyn

Preview of yaml

  • platform: climacell api_key: !secret climacell_api_key_v4 name: Climacell latitude: !secret gps_geo_home_lt longitude: !secret gps_geo_home_ln units: metric timelines:
    • name: "Daily" fields:
      • temperature
      • feels_like
      • precipitation
      • precipitation_type
      • precipitation_probability
      • wind_speed
      • wind_direction
      • weather_condition
      • pollen_tree
      • pollen_weed
      • pollen_grass forecast_observations: 1
    • name: "Hourly" fields:
      • temperature
      • feels_like
      • precipitation
      • precipitation_type
      • precipitation_probability
      • wind_speed
      • wind_direction
      • weather_condition
      • pollen_tree
      • pollen_weed
      • pollen_grass forecast_observations: 6 timestep: "1h" update: auto scan_interval: days: 0 hours: 0 minutes: 30 seconds: 0 milliseconds: 0 exclude_interval: 1:
        • "23:30"
        • "05:00"

nytram-md avatar Jan 24 '21 13:01 nytram-md

Hi,

@mfabiani53 @Arturasm could you add the following to your configuration.yaml and post the logs after restart:

logger:
  default: warning
  logs:
    custom_components.climacell: debug

cbergmann avatar Jan 24 '21 14:01 cbergmann

Hi,

@Arturasm: That was a bug in my code regarding *Time fields missing the unit of Measurement. I think I fixed it in my banch. Could you please verify this and comment in the the Pull request. @Thrasher2020: Could you please post your sensor config. (redacting secrets of course). @r-renato: sorry to correct you Renato but from how I interpret the documentation Min and Max values should be available. You have to add another field with a Min or Max suffix. I think we should add a example for this usecase to the README.

Thanks for your support @cbergmann. Please can you add to the README how retrieve the min/max values? Very thanks, Renato

r-renato avatar Jan 24 '21 14:01 r-renato

Hi,

@mfabiani53 @Arturasm could you add the following to your configuration.yaml and post the logs after restart:

logger:
  default: warning
  logs:
    custom_components.climacell: debug

My mistake in config, all is working. Thank you very much.

Arturasm avatar Jan 24 '21 15:01 Arturasm

I'm still having problems with the integration. Here is my log with the debug info.

Getting 2 errors:

ClimacellTimelineDataProvider._retrieve_data error status_code 400

and currently 84 instances of:

TimelineSensor.update - Provider has no data for: cc Climacell Weather Current Temperature

with various data

My config for climacell.

Hilo4321 avatar Jan 24 '21 19:01 Hilo4321

I have this error:

ClimacellTimelineDataProvider._retrieve_data error status_code 500

TimelineSensor.update - Provider has no data for: cc Meteo Giornaliero precipitation Probability 1d TimelineSensor.update - Provider has no data for: cc Meteo Giornaliero precipitation Probability 2d TimelineSensor.update - Provider has no data for: cc Meteo Giornaliero Weather Condition 0d TimelineSensor.update - Provider has no data for: cc Meteo Giornaliero Weather Condition 1d TimelineSensor.update - Provider has no data for: cc Meteo Giornaliero Weather Condition 2d

with this config: https://pastebin.com/7kTW7ith

gio82c avatar Jan 24 '21 20:01 gio82c

With the update v2.0.2 everything I used seems to be back to normal. Some values like what it says the temp and humidity are way off from my home digital weather station but that's on ClimaCell for that poor data.

Edit: nevermind. 8 hours later and none of the sensors have updated. No errors in logs. I'll enable debug for it.

Krojack avatar Jan 24 '21 20:01 Krojack

On API v4.
Version fa9ace5 (latest) of integration. Hass v2101.1.5

I have weather data.

image

Unfortunately I also have hundreds and hundreds of errors in the log.

2021-01-24 22:41:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_dewpoint fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'dewPoint'
2021-01-24 22:41:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_humidity_percentage fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'humidity'
2021-01-24 22:41:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_wind_speed fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'windSpeed'
2021-01-24 22:41:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_wind_direction fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'windDirection'
2021-01-24 22:41:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_wind_gust fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'windGust'
2021-01-24 22:42:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_temperature fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'temperature'
2021-01-24 22:42:07 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cc_home_dewpoint fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, 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 400, in update
    self._state = sensor_data["values"][self.__field]
KeyError: 'dewPoint'

My climacell config.

  - platform: climacell
    api_key: !secret CLIMACELL_API
    name: Home
    timelines:
      - fields:
          - temperature
          - temperatureApparent
          - dewPoint
          - humidity
          - windSpeed
          - windDirection
          - windGust
          - pressureSurfaceLevel
          - precipitationIntensity
          - precipitationProbability
          - precipitationType
          - visibility
          - cloudCover
          - weatherCode
        forecast_observations: 1
        timestep: 1m
        update: auto
        scan_interval:
          minutes: 15

jazzyisj avatar Jan 25 '21 03:01 jazzyisj

They have moved from and underscore naming convention to a camelCase convention, plus a lot of sensor names have changed in V4. This is fairly unusable until the integration is updated to use the new conventions and the config is designed to match the new sensor names.

jmutnick avatar Jan 25 '21 14:01 jmutnick

I am also having the same issue

2021-01-25 18:46:43 WARNING (SyncWorker_6) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Wind speed
2021-01-25 18:46:43 WARNING (SyncWorker_7) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Wind Direction
2021-01-25 18:46:43 WARNING (SyncWorker_1) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Wind Gust
2021-01-25 18:46:43 WARNING (SyncWorker_1) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Barometric pressure
2021-01-25 18:46:44 WARNING (SyncWorker_9) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Precipitation
2021-01-25 18:46:44 WARNING (SyncWorker_4) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 precipitation Probability
2021-01-25 18:46:44 WARNING (SyncWorker_7) [custom_components.climacell.sensor] TimelineSensor.update - Provider has no data for: cc OC_House_v4 Precipitation Type

using this config

  # Weather climatecell.co
  - platform: climacell
    api_key:  !secret climacell_api_key_v4
    name: OC_House_v4
    latitude: !secret gps_geo_home_lt
    longitude: !secret gps_geo_home_ln
    timelines:
      - name: "" #Realtime
        timestep: "1m"
        forecast_observations: 1
        fields:
          - temperature
          - temperatureApparent
          - dewPoint
          - humidity
          - windSpeed
          - windDirection
          - windGust
          - pressureSurfaceLevel
          - precipitationProbability
          - precipitationType
          - sunsetTime
          - sunriseTime
          - visibility
          - cloudCover
          - cloudBase
          - cloudCeiling
          - solarGHI
          - moonPhase
          - weatherCode
          - particulateMatter25
          - particulateMatter10
          - pollutantO3
          - pollutantNO2
          - pollutantCO
          - pollutantSO2
          - epaIndex
          - epaPrimaryPollutant
          - epaHealthConcern
          - treeIndex
          - weedIndex
          - grassIndex
        update: auto
        scan_interval:
          # At least one of these must be specified:
          days: 0
          hours: 0
          minutes: 20
          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
          - weatherCode
        scan_interval:
          # At least one of these must be specified:
          days: 0
          hours: 3
          minutes: 0
          seconds: 0
          milliseconds: 0
        exclude_interval:
          1:
            - "23:00"
            - "06:30"```

the0ckid82 avatar Jan 26 '21 03:01 the0ckid82

I am getting this error in the logs at startup. I am using a V4 key and have tried several different configs including the 2 examples above. 2021-01-26 06:27:59 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up climacell platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform await asyncio.shield(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 280, in setup_platform ClimacellTimelineSensor( File "/config/custom_components/climacell/sensor.py", line 333, in __init__ str(timestep_int * self._observation).zfill(timestep_length) TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

jgosnell56 avatar Jan 26 '21 12:01 jgosnell56