aukedejong / lovelace-windrose-card

Home Assistant Lovelace Windrose Card
60 stars 2 forks source link

1 Hour chart not updating #34

Closed LouPaloma closed 1 year ago

LouPaloma commented 1 year ago

Version 1.2.0 with Hass 2023.6.3, Frontend 20230608.0 - latest

After updating to the data_period: with hours_to_show value of 1, the chart does not update unless there's a manual refresh of the page. Even changing the refresh_interval to a low number doesn't seem to change the chart.

Here's an example card:

- type: custom:windrose-card
  title: Last Hour
  data_period:
    hours_to_show: 1
  max_width: 400
  refresh_interval: 60
  windspeed_bar_location: bottom
  wind_direction_entity: 
    entity: sensor.home_wind_angle
  windspeed_entities:
    - entity: sensor.home_wind_speed
      name: Speed
    - entity: sensor.home_wind_gust
      name: Gusts
  wind_direction_unit: degrees
  #direction_compensation: 0
  speed_range_beaufort: false
  input_speed_unit: mph
  output_speed_unit: mph
  speed_ranges:
    - from_value: 0
      color: rgb(32,174,32)
    - from_value: 3
      color: yellow
    - from_value: 6
      color: orange
    - from_value: 8
      color: red
    - from_value: 10
      color: purple
  #cardinal_direction_letters: NESW
  card_mod:
    class: top-level-card
aukedejong commented 1 year ago

I tried to reproduce your problem. Copied your configuration and using my sensors. It still refreshes.

If you add log_level: INFO to the configuration and open the browser console, you can see some log output. Can you share this output here?

LouPaloma commented 1 year ago

Here's what I see in the logs (there are 2 windroses, but the 60s one (which is the problem child) does look like it's doing calls

value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
setTimeout (async)
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
apexcharts-card.js:1 Error: <svg> attribute height: Expected length, "NaN".
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
setTimeout (async)
value @ apexcharts-card.js:1
value @ apexcharts-card.js:1
(anonymous) @ apexcharts-card.js:1
windrose-card.js:196 INFO Interval running with 300 seconds.
windrose-card.js:196 INFO Interval running with 60 seconds.
DevTools failed to load source map: Could not load content for chrome-extension://agipnmmjnjcfgkhmlgifikmibgngblop/sm/50a6907fb78f9ce350ecd8437eec0dcc604ba21287893abed38c4313e34e04a6.map: System error: net::ERR_BLOCKED_BY_CLIENT
DevTools failed to load source map: Could not load content for chrome-extension://agipnmmjnjcfgkhmlgifikmibgngblop/stacktrace.min.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
DevTools failed to load source map: Could not load content for chrome-extension://agipnmmjnjcfgkhmlgifikmibgngblop/in-content.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
windrose-card.js:196 INFO Windspeed unit detected for sensor.home_wind_speed: mph
windrose-card.js:199 INFO Using start time for data query [Mon Jun 26 2023 14:19:22 GMT-0700 (Pacific Daylight Time)]
windrose-card.js:196 INFO Loaded measurements: directions: 1695, speeds: 1453, entity: sensor.home_wind_speed
windrose-card.js:196 INFO Matched measurements, direction-first: 1695
windrose-card.js:196 INFO Windspeed unit detected for sensor.home_wind_speed: mph
windrose-card.js:196 INFO Windspeed unit detected for sensor.home_wind_gust: mph
windrose-card.js:199 INFO Using start time for data query [Tue Jun 27 2023 13:19:22 GMT-0700 (Pacific Daylight Time)]
windrose-card.js:196 INFO Loaded measurements: directions: 79, speeds: 73, entity: sensor.home_wind_speed
windrose-card.js:196 INFO Matched measurements, direction-first: 79
windrose-card.js:196 INFO Loaded measurements: directions: 79, speeds: 67, entity: sensor.home_wind_gust
windrose-card.js:196 INFO Matched measurements, direction-first: 79
windrose-card.js:199 INFO Using start time for data query [Tue Jun 27 2023 13:20:21 GMT-0700 (Pacific Daylight Time)]
windrose-card.js:196 INFO Loaded measurements: directions: 80, speeds: 73, entity: sensor.home_wind_speed
windrose-card.js:196 INFO Matched measurements, direction-first: 80
windrose-card.js:196 INFO Loaded measurements: directions: 80, speeds: 66, entity: sensor.home_wind_gust
windrose-card.js:196 INFO Matched measurements, direction-first: 80
windrose-card.js:199 INFO Using start time for data query [Tue Jun 27 2023 13:21:21 GMT-0700 (Pacific Daylight Time)]
windrose-card.js:196 INFO Loaded measurements: directions: 80, speeds: 72, entity: sensor.home_wind_speed
windrose-card.js:196 INFO Matched measurements, direction-first: 80
windrose-card.js:196 INFO Loaded measurements: directions: 80, speeds: 65, entity: sensor.home_wind_gust
windrose-card.js:196 INFO Matched measurements, direction-first: 80

However, the display does not update until I do a page refresh.

Browser is Brave [Version 1.47.186 Chromium: 109.0.5414.119 (Official Build) (64-bit)]

I should also note that the parent card for this is a custom:layout-card

aukedejong commented 1 year ago

Released version 1.2.1.

Found a bug that should fix this. I can't explain why only one of the two has this problem.

Can you let me know if this fixes it, thanks.

aukedejong commented 1 year ago

Did the new version fix the refresh issue?

LouPaloma commented 1 year ago

The fix looks to have worked. You can mark this as closed. FYI: I noticed that this was a Brave/Chrome issue only, but not an issue with Firefox.