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

Invalid timestep: current #41

Closed Hilo4321 closed 3 years ago

Hilo4321 commented 3 years ago

Hello,

On the new API 4, I am seeing this error in the log:

Logger: custom_components.climacell.sensor
Source: custom_components/climacell/sensor.py:197
Integration: Climacell weather (documentation)
First occurred: 11:08:41 AM (1 occurrences)
Last logged: 11:08:41 AM
Invalid timestep: current 

Configuration:

  - platform: climacell
    api_key: 
    name: Climacell Weather
    latitude: 
    longitude: 
    timelines:
      - name: "Current"
        timestep: "current"
        fields:
          - temperature
...

As far as I can tell from the docs, this should be a valid timestep.

https://docs.climacell.co/reference/data-layers-overview

Cheers.

Hilo4321 commented 3 years ago

Of course the instant I post this I realize my error. The correct format is:

timestep: "[0,0]"
Hilo4321 commented 3 years ago

Turns out that doesn't work either.

Nor does:

timestep: "0,0"

or:

timestep: "0"
cbergmann commented 3 years ago

hi, I totally did not see that timestep option. I will try to implement this but it will take some time.

cbergmann commented 3 years ago

@Hilo4321 I just created a new pull-request with the support for "current" timestamp. Could you please test this and give feedback. Thanks

Hilo4321 commented 3 years ago

I don't know how to do this properly, so I created the files and uploaded the 2 relevant changed files into the folder. Can you download a pull directly vs copy/paste into a file?

I was able to set it up using "current" without seeing the invalid timestep error in the log (there are others), but sensors were showing "unknown" for data. I am getting data for daily forecasts (only other I am using).

Full startup log

Side note: it looks like climacell docs suggest that "0" is the correct timestep, am I reading that wrong?

cbergmann commented 3 years ago

hi @Hilo4321

I use the following config for my "current" test timeline and it seems to work fine:

    - fields:
        - temperature
      timestep: "current"
      scan_interval:
        minutes: 30
      update: auto
      name: "current"

regarding your setup: it seems that your are using fields which are currently not supported. Line 13 of your log says ".query.fields[10] should be equal to one of the allowed values". It seems that your are using the fields epaHealthConcern,roadRiskScore,roadRiskConfidence and roadRiskConditions which are not in the core data layers.

Hilo4321 commented 3 years ago

I appreciate the follow up. With those adjustments I am no longer seeing errors.