bacco007 / sensor.opennem

OpenNEM Sensor for Home Assistant
MIT License
12 stars 6 forks source link

Configurations with multiple regions show the values of one region on all regions #8

Closed chrisp250 closed 2 years ago

chrisp250 commented 2 years ago

Version of the custom_component

Current/latest version

Configuration

Config inside sensor.yaml

- platform: opennem
  name: "AEMO NSW"
  region: nsw1
  monitored_conditions:
    - exports
    - demand
    - distillate
    - fossilfuel
    - renewables
    - generation
    - hydro
    - imports
    - price
    - pumps
    - solar_rooftop
    - solar_utility
    - temperature
    - wind
- platform: opennem
  name: "AEMO VIC"
  region: vic1
  monitored_conditions:
    - exports
    - demand
    - distillate
    - fossilfuel
    - renewables
    - generation
    - hydro
    - imports
    - price
    - pumps
    - solar_rooftop
    - solar_utility
    - temperature
    - wind

Add your logs here.

Not sure how to extract the logs. Happy to do that if I can get hand.

Describe the bug

When configuring multiple regions, all regions show the same information. In this case I configured NSW and Victoria, and while NSW sensors are always correct, Victoria's seem to be toggling between the NSW and the Victoria data. See the graph attached.

I'm running the last/current version from GitHub.

Screen Shot 2022-01-04 at 9 29 55 am

Debug log

<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ -->

Add your logs here.
bacco007 commented 2 years ago

Hmm, Cheers... :)

I'm not sure when I'll get a chance to have a look at this - I suspect I need to make some significant changes to make it work properly.

Open to any PRs that resolve the problem if I'm a bit tardy getting this one cleaned up

chrisp250 commented 2 years ago

Sorry mate :) I would have a crack it myself if I knew where to start. I've never written an Home Assistant integration.

It's interesting to look at multiple regions to see what's going on and potentially understand condition of the grid from the status of the interconnectors.

Thank you Christian

bacco007 commented 2 years ago

I've pushed a new version that should resolve this one

https://github.com/bacco007/sensor.opennem/releases/tag/2022.01.1