Skip to content

Octopus regexes seems to be out of date in various templates #3304

@reedy

Description

@reedy

I'm using https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/releases/tag/v17.1.1, and have used it for many versions, but have had HA to recreate the entity IDs to make sure things are up to date.

2026-02-01 00:20:43.968300: Warn: Regular expression argument: metric_octopus_import unable to match re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate), now will disable
2026-02-01 00:20:43.970728: Warn: Regular expression argument: metric_octopus_export unable to match re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate), now will disable
2026-02-01 00:20:43.973097: Warn: Regular expression argument: metric_standing_charge unable to match re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge), now will disable

batpred/docs/devices.md

Lines 248 to 253 in d1b61f8

**For Energy Rates**
```yaml
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)'
```

# Energy rates
# Please set one of these three, if multiple are set then Octopus is used first, second rates_import/rates_export and latest basic metric
# Set import and export entity to point to the Octopus Energy plugin
# automatically matches your meter number assuming you have only one
# Will be ignored if you don't have the sensor
# Or manually set it to the correct sensor names e.g:
# sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_rate
# sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_export_current_rate
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)'
# Standing charge can be set to a sensor (e.g. Octopus) or manually entered in pounds here (e.g. 0.50 is 50p)
metric_standing_charge: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)'

But for example, for mine, the regex needs to be something more like:

  • sensor.current_standing_charge_electricity_[0-9a-z]+_[0-9]+
  • sensor.current_rate_electricity_[0-9a-z]+_[0-9]+
  • sensor.current_rate_export_electricity_[0-9a-z]+_[0-9]+

I'm not sure if the last string after the _ may include letters, but obviously regex can be have both for ease... And I guess possibly trying to keep the old variants working too?

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions