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

Climate Data is way off vs their site. #17

Open guice opened 3 years ago

guice commented 3 years ago

Climate numbers are off (vs their site). Looks like elevation might play a factor here. Anyway to get that incorporated? Our elevation here is 6276 (feet). I think other weather apis send it automatically. Climacell must have it automatically when I typed in my address.

Screen Shot 2020-07-10 at 2 57 23 PM
jsermer commented 3 years ago

Comparing the sensor numbers with the mobile app seems to indicate (for me at least), that _0d looks like yesterday, _1d today, _2d tomorrow, etc when my local time is in the morning hours (7-8am)....things align using those assumptions (I'm running latest commit in my env).

r-renato commented 3 years ago

The sensors reference time is UTC. What is your timezone?

Thanks, bye Renato

jsermer commented 3 years ago

currently -5 from utc

r-renato commented 3 years ago

Climate numbers are off (vs their site). Looks like elevation might play a factor here. Anyway to get that incorporated? Our elevation here is 6276 (feet). I think other weather apis send it automatically. Climacell must have it automatically when I typed in my address.

Thank you for your reporting. Let me investigate. Renato

danmed commented 3 years ago

Climate numbers are off (vs their site). Looks like elevation might play a factor here. Anyway to get that incorporated? Our elevation here is 6276 (feet). I think other weather apis send it automatically. Climacell must have it automatically when I typed in my address.

Screen Shot 2020-07-10 at 2 57 23 PM

Can i be cheeky and get your yaml for your weather card?

r-renato commented 3 years ago

Climate numbers are off (vs their site). Looks like elevation might play a factor here. Anyway to get that incorporated? Our elevation here is 6276 (feet). I think other weather apis send it automatically. Climacell must have it automatically when I typed in my address.

Screen Shot 2020-07-10 at 2 57 23 PM

Can i be cheeky and get your yaml for your weather card?

Sure, my customized weather card is the following:

# lovelace_gen
####################################################################################################
# Params:
#   sensor_prefix
####################################################################################################
                            {% macro climacell_sensor(prefix, suffix) -%}
                            sensor.{{ prefix }}_{{ suffix }}
                            {%- endmacro %}

                              type: custom:ha-card-weather-conditions
                              name: {{ name }}
                              language: {{ locale }}
                              animation: true
                              camera: {{ camera }}
#
# ALERT
#
                              alert:
                                fire_risk:
                                  entity: {{ climacell_sensor( sensor_prefix, 'fire_index' ) }}
                                  icon: mdi:campfire
                                  min: 1
                                  max: 100
                                  show_if_ge: 21
                                thunderstorms_risk:
                                  entity: binary_sensor.dpc_roma_temporali_oggi
                                  show_if_on: true
                                hydraulic_risk:
                                  entity: binary_sensor.dpc_roma_idraulico_oggi
                                  show_if_on: true
                                hydrogeological_risk:
                                  entity: binary_sensor.dpc_roma_idrogeologico_oggi
                                  show_if_on: true
#
# AIR QUALITY
#
                              air_quality:
                                pm25: {{ climacell_sensor( sensor_prefix, 'pm25' ) }}
                                pm10: {{ climacell_sensor( sensor_prefix, 'pm10' ) }}
                                o3: {{ climacell_sensor( sensor_prefix, 'o3' ) }}
                                no2: {{ climacell_sensor( sensor_prefix, 'no2' ) }}
                                co: {{ climacell_sensor( sensor_prefix, 'co' ) }}
                                so2: {{ climacell_sensor( sensor_prefix, 'so2' ) }}
                                epa_aqi: {{ climacell_sensor( sensor_prefix, 'epa_aqi' ) }}
                                epa_health_concern: {{ climacell_sensor( sensor_prefix, 'epa_health_concern' ) }}
#
# Pollen
#
#                              pollen:
#                                tree:
#                                  entity: {{ climacell_sensor( sensor_prefix, 'pollen_tree' ) }}
#                                  min: 0
#                                  max: 5
#                                  low: 1
#                                  high: 3
#                                weed:
#                                  entity: {{ climacell_sensor( sensor_prefix, 'pollen_weed' ) }}
#                                  min: 0
#                                  max: 5
#                                  low: 1
#                                  high: 3
#                                grass:
#                                  entity: {{ climacell_sensor( sensor_prefix, 'pollen_grass' ) }}
#                                  min: 0
#                                  max: 5
#                                  low: 1
#                                  high: 3
#
# WEATHER
#
                              weather:
                                icons_model: climatecell
                                current:
                                  sun: sun.sun
                                  moon_phase: {{ climacell_sensor( sensor_prefix, 'moon_phase' ) }}
                                  feels_like: {{ climacell_sensor( sensor_prefix, 'feels_like' ) }}
                                  current_conditions: {{ climacell_sensor( sensor_prefix, 'weather_condition' ) }}
                                  humidity: {{ climacell_sensor( sensor_prefix, 'humidity_percentage' ) }}
                                  pressure: {{ climacell_sensor( sensor_prefix, 'barometric_pressure' ) }}
                                  temperature: {{ climacell_sensor( sensor_prefix, 'temperature' ) }}
                                  visibility: {{ climacell_sensor( sensor_prefix, 'visibility' ) }}
                                  wind_bearing: {{ climacell_sensor( sensor_prefix, 'wind_direction' ) }}
                                  wind_speed: {{ climacell_sensor( sensor_prefix, 'wind_speed' ) }}
                                  precipitation: {{ climacell_sensor( sensor_prefix, 'precipitation' ) }}
                                  forecast: true
                                forecast:
                                  meteogram: {{ meteogram }}
                                  icons:
                                    day_1: {{ climacell_sensor( sensor_prefix, 'weather_condition_0d' ) }}
                                    day_2: {{ climacell_sensor( sensor_prefix, 'weather_condition_1d' ) }}
                                    day_3: {{ climacell_sensor( sensor_prefix, 'weather_condition_1d' ) }}
                                    day_4: {{ climacell_sensor( sensor_prefix, 'weather_condition_2d' ) }}
                                    day_5: {{ climacell_sensor( sensor_prefix, 'weather_condition_3d' ) }}
                                  temperature_high:
                                    day_1: {{ climacell_sensor( sensor_prefix, 'temperature_max_0d' ) }}
                                    day_2: {{ climacell_sensor( sensor_prefix, 'temperature_max_1d' ) }}
                                    day_3: {{ climacell_sensor( sensor_prefix, 'temperature_max_2d' ) }}
                                    day_4: {{ climacell_sensor( sensor_prefix, 'temperature_max_3d' ) }}
                                    day_5: {{ climacell_sensor( sensor_prefix, 'temperature_max_4d' ) }}
                                  temperature_low:
                                    day_1: {{ climacell_sensor( sensor_prefix, 'temperature_min_0d' ) }}
                                    day_2: {{ climacell_sensor( sensor_prefix, 'temperature_min_1d' ) }}
                                    day_3: {{ climacell_sensor( sensor_prefix, 'temperature_min_2d' ) }}
                                    day_4: {{ climacell_sensor( sensor_prefix, 'temperature_min_3d' ) }}
                                    day_5: {{ climacell_sensor( sensor_prefix, 'temperature_min_4d' ) }}
                                  precipitation_probability:
                                    day_1: {{ climacell_sensor( sensor_prefix, 'precipitation_probability_0d' ) }}
                                    day_2: {{ climacell_sensor( sensor_prefix, 'precipitation_probability_1d' ) }}
                                    day_3: {{ climacell_sensor( sensor_prefix, 'precipitation_probability_2d' ) }}
                                    day_4: {{ climacell_sensor( sensor_prefix, 'precipitation_probability_3d' ) }}
                                    day_5: {{ climacell_sensor( sensor_prefix, 'precipitation_probability_4d' ) }}
                                  precipitation_intensity:
                                    day_1: {{ climacell_sensor( sensor_prefix, 'precipitation_max_0d' ) }}
                                    day_2: {{ climacell_sensor( sensor_prefix, 'precipitation_max_1d' ) }}
                                    day_3: {{ climacell_sensor( sensor_prefix, 'precipitation_max_2d' ) }}
                                    day_4: {{ climacell_sensor( sensor_prefix, 'precipitation_max_3d' ) }}
                                    day_5: {{ climacell_sensor( sensor_prefix, 'precipitation_max_4d' ) }}

I use it inside a view:

# lovelace_gen

#############################################################################################################################################
#                                                                                                                                           #
#                                                     VIEW 1 - Weather Home page                                                            #
#                                                                                                                                           #
#############################################################################################################################################

    id: 2
    icon: mdi:weather-cloudy
    title: Weather Roma
    panel: true
    cards:
      - type: custom:layout-card
        layout: vertical
        max_width: 100%
        cards:
          - id:
            type: horizontal-stack
            cards:
              - !include
                - ../lovelace_cards/card_weather_conditions.yaml
                - sensor_prefix: cc_roma
                  camera: camera.roma
                  meteogram: camera.roma_meteogram
                  name: Roma
                  locale: it

Thanks, bye Renato