jshufro / home_assistant_noaa_tides

A fork of Home Assistant's NOAA Tides sensor with additional features.
23 stars 4 forks source link

Failing to retrieve temperature from station #17

Closed cmamatey closed 3 years ago

cmamatey commented 4 years ago

My attempt to configure a temp sensor is failing with the following error occurring in the logs.

Logger: custom_components.noaa_tides.sensor Source: custom_components/noaa_tides/sensor.py:295 Integration: noaa_tides First occurred: 4:11:06 PM (2 occurrences) Last logged: 4:11:07 PM

Check NOAA Tides and Currents: ('No data was found. This product may not be offered at this station at the requested time.',)

sensor:
  - platform: noaa_tides
    name: canal_tide
    station_id: 8726520
    type: tides
    scan_interval: 360
  - platform: noaa_tides
    name: canal_temp
    station_id: 8726520
    type: temp
    scan_interval: 360

As far as I can tell, the necessary data should be available: https://tidesandcurrents.noaa.gov/inventory.html?id=8726520

jshufro commented 4 years ago

I've added

  - platform: noaa_tides
    name: canal_temp
    station_id: 8726520
    type: temp
    scan_interval: 360

to my configuration and see

attribution: Data provided by NOAA
temperature: 80.8
temperature_time: '2020-10-21T16:18'
air_temperature: 81.3
air_temperature_time: '2020-10-21T16:18'
unit_of_measurement: °F
friendly_name: canal_temp
device_class: temperature

in the home assistant UI for entity sensor.canal_temp

I also see some error logging similar to yours, but the sensor is working as expected.

cmamatey commented 4 years ago

Thanks for the prompt reply. I only see 'Unknown' image

I am running 116.4 on Docker.

I have another issue I am about to raise separately that might be contributing to the difference in behavior.

cmamatey commented 3 years ago

The TZ environment variable was missing from my docker container configuration. I thought I had set it in the past, but I must have lost it at some point when reconfiguring my docker deployment.

Env variable instructions: https://www.home-assistant.io/docs/installation/docker/#synology-nas

To ensure that Home Assistant displays the correct timezone go to the “Environment” tab and click the plus sign then add variable = TZ & value = Europe/London choosing your correct timezone

Adding back that environment variable and restarting my container resolved this issue. This issue and #18 appear to be related as I suspected.

Referring back to the logged error in my original bug description, I am now assuming my deployment was sending incorrect time values when requesting data from NOAA API: 'No data was found. This product may not be offered at this station at the requested time.'