Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octopus all_rates attribute warning #1684

Open
zaheerm opened this issue Dec 3, 2024 · 11 comments
Open

Octopus all_rates attribute warning #1684

zaheerm opened this issue Dec 3, 2024 · 11 comments
Assignees

Comments

@zaheerm
Copy link

zaheerm commented Dec 3, 2024

Describe the bug

Log shows:

2024-12-03 09:30:04.507396: Warn: No Octopus data in sensor sensor.electricity_<meter>_previous_rate attribute 'all_rates'
2024-12-03 09:30:04.507507: Warn: No Octopus data in sensor event.electricity_<meter>_current_day_rates attribute 'all_rates' / 'rates' / 'raw_today'
2024-12-03 09:30:04.507691: Error: metric_octopus_import is not set correctly or no energy rates can be read
2024-12-03 09:30:04.547027: Warn: record_status Error: metric_octopus_import not set correctly or no energy rates can be read
2024-12-03 09:30:04.547354: Error: Exception raised 
2024-12-03 09:30:04.547909: Error: Traceback (most recent call last):
  File "/config/predbat.py", line 959, in run_time_loop
    self.update_pred(scheduled=True)
  File "/config/predbat.py", line 529, in update_pred
    self.fetch_sensor_data()
  File "/config/fetch.py", line 825, in fetch_sensor_data
    raise ValueError
ValueError

Expected behaviour
A clear and concise description of what you expected to happen.

Predbat version

Latest (zip file shows 8.8.1)

Environment details

  • GivTCP inverter and battery
  • Standard HAOS installer
  • Octopus integration latest version

Screenshots
If applicable, add screenshots to help explain your problem. The most useful ones can be your battery chart, the Predbat HTML plan and your current settings in HA.

Log file
Can you capture a log file from the time of the issue, debug mode is not normally required.
If you are not keeping the full logs then please enable this in appdaemon.yaml (see the installation instruction in the Predbat docs area for details on how to do this)

@gcoan
Copy link
Collaborator

gcoan commented Dec 3, 2024

Is this a new install or an upgrade?

Are the Octopus sensors that Predbat is looking for populated correctly and what's in your apps.yaml, is Predbat configured correctly to find the Octopus sensors?

If its a new install, you follow the instructions about enabling specific events that Predbat needs

@zaheerm
Copy link
Author

zaheerm commented Dec 3, 2024

Thanks @gcoan for the response. It's a new install of predbat. The Octopus sensors and events are enabled as per the instructions. The apps.yaml relating to octopus minus the comments are:

  octopus_intelligent_slot: "re:(binary_sensor.octopus_energy([0-9a-z_]+|)_intelligent_dispatching)"
  octopus_ready_time: "re:(time.octopus_energy_([0-9a-z_]+|)_intelligent_target_time)"
  octopus_charge_limit: "re:(number.octopus_energy([0-9a-z_]+|)_intelligent_charge_limit)"
  octopus_saving_session: "re:(binary_sensor.octopus_energy([0-9a-z_]+|)_saving_session(s|))"
  octopus_saving_session_octopoints_per_penny: 8
  octopus_free_session: "re:(event.octopus_energy_([0-9a-z_]+|)_octoplus_free_electricity_session_events)"
  metric_octopus_import: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)"
  metric_octopus_export: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate)"
  metric_standing_charge: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)"

@zaheerm
Copy link
Author

zaheerm commented Dec 3, 2024

Screenshot 2024-12-03 at 19 13 10 is a screenshot of my home-assistant current_day_rates event sensor.

@gcoan
Copy link
Collaborator

gcoan commented Dec 3, 2024

Thanks for the extra info. The apps.yaml looks correct.

If you look at the sensor sensor.octopus_energy_electricity_MPAN_METERSERIAL_current_rate what do you see, is it populated OK?

Can you share your logfile please, am guessing it's either a problem with not picking up your Octopus details properly.

@gcoan
Copy link
Collaborator

gcoan commented Dec 3, 2024

is a screenshot of my home-assistant current_day_rates event sensor.

Looks like the event is firing OK. Let's see what's in the actual import sensor

@zaheerm
Copy link
Author

zaheerm commented Dec 3, 2024

@zaheerm
Copy link
Author

zaheerm commented Dec 3, 2024

Screenshot 2024-12-03 at 19 34 27 when expanding attributes

@springfall2008
Copy link
Owner

There's something wrong here as the Event shown doesn't have the mpan in its name?

@gcoan
Copy link
Collaborator

gcoan commented Dec 3, 2024

I think the problem is that your import energy sensor is named in a way that Predbat doesn't expect.

From the logfile it finds your import sensor:

2024-12-03 09:02:10.818563: Regular expression argument metric_octopus_import matched ^(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)$ with sensor.electricity_METER_NUMBER_current_rate

Whereas on mine the sensor name is sensor.octopus_energy_electricity_METER_NUMBER_current_rate

Predbat uses the import sensor to then find the names of other sensors it needs, and it's not finding them. Guessing that there is a mis-match and the other sensors have the octopus_energy_ prefix whereas current_rate doesn't.

Did you rename this sensor?

Simplest thing to try is to rename the sensor you have to the name it should normally be. If you want to rename it then you'll also need to rename the other sensors that Predbat is looking for so they all have matching name structure

@zaheerm
Copy link
Author

zaheerm commented Dec 3, 2024

Good spot, All my sensors seem to be sensor.electricity_ while my events seem to be event.octopus_energy_electricity. I may set the sensors and events manually in predbat config and give that a go rather than doing renames.

@gcoan
Copy link
Collaborator

gcoan commented Dec 4, 2024

👍

I think that's your problem. Without checking the code I think Predbat expects the events and sensors to be named consistently. You may have to do some renaming.

Curious as to why your new install ended up like this. Maybe something changed in the Octopus Integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants