r-renato / ha-climacell-weather

Climacell weather provider integration is a custom component for Home Assistant. The climacell platform uses the Climacell API as a source for meteorological data for your location.
MIT License
46 stars 10 forks source link

Missing current temperature sensors 'unknown' #51

Open Chompas opened 3 years ago

Chompas commented 3 years ago

Hi,

Today I made the update to Climacell API v4 and updated the fields but I can't get the current temperature sensors to work.

In HA Developer Tools I get the sensors but they display 'unknown' value. This does not happen to all but just the current measurements as the others appear (for example sensor.cc_climacell_temperature = 'unknown' but sensor.cc_climacell_temperature_0d returns a value.

This makes me think I'm missing something for the current weather conditions or that my config is wrong.

  - platform: climacell
    api_key: !secret climacell_api_key
    name: climacell
    units: metric
    timelines:
      - name: "" #Realtime
        timestep: "1m"
        forecast_observations: 1
        fields:
          - temperature
          - feels_like
          - humidity
          - visibility
          - cloud_cover
          - precipitationIntensity
          - precipitation_type
          - pressure
          - wind_speed
          - wind_direction
          - wind_gust
          - sunset
          - sunrise
          - pollen_tree
          - pollen_weed
          - pollen_grass
          - co
          - epa_aqi
          - epa_health_concern
          - no2
          - o3
          - pm10
          - pm25
          - so2
        update: auto
        scan_interval:
          # At least one of these must be specified:
          days: 0
          hours: 0
          minutes: 31
          seconds: 0
          milliseconds: 0
      - name: "" #daily
        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: 3
          minutes: 0
          seconds: 0
          milliseconds: 0
        exclude_interval:
          1:
            - "10:00"
            - "12:00"
          2:
            - "00:00"
            - "06:30"
Mobbsey commented 3 years ago

Hi,

I had the same issue, and found your issue whilst looking for a resolution myself. My issue was caused by using "current" as the timestep for the current conditions, I set mine to "1m" and my sensors started working rather than being sat as "unknown".

I can't see anything drastically different with your config that should cause you issues, the only thing I can see is that you have a mix of v3 and v4 sensor names... I've tried to align mine to the raw Climacell names, whether that has any bearing? In case it helps, my (now working) config is below (just note I prefix the sensors with "daily" or "current" - if you copy and paste and want to maintain your current naming convention, make sure you remove these!):

  - platform: climacell
    name: climacell
    api_key: !secret climacell_api_key
    latitude: !secret H_latitude
    longitude: !secret H_longitude
    units: metric
    timelines:
      - name: "current"
        timestep: "1m"
        forecast_observations: 1
        fields:
          - temperature
          - temperatureApparent
          - humidity
          - windSpeed
          - windDirection
          - windGust
          - pressure
          - precipitationIntensity
          - precipitationType
          - visibility
          - cloudCover
          - weather_condition
          - pm25
          - pm10
          - o3
          - no2
          - co
          - so2
          - epa_aqi
          - epa_health_concern
          - pollen_tree
          - pollen_weed
          - pollen_grass
        update: auto
        scan_interval:
          days: 0
          hours: 0
          minutes: 30
          seconds: 0
          milliseconds: 0

      - name: "daily"
        timestep: "1d"
        forecast_observations: 5
        fields:
          - temperature
          - temperatureMin
          - temperatureMax
          - precipitationIntensityMin
          - precipitationIntensityMax
          - precipitation_probability
          - weather_condition
          - moon_phase
        scan_interval:
          days: 0
          hours: 4
          minutes: 0
          seconds: 0
          milliseconds: 0
        exclude_interval:
          1:
            - "23:00"
            - "06:30"
Chompas commented 3 years ago

Wow @Mobbsey that fixed it. I didn't realize I had a mix (I clearly missed those from the documentation), I just cleaned my config updating the fields using your example and all the sensors are back.

Thanks a lot!