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

Multiple accounts #223

Closed
alandrumo opened this issue Apr 22, 2023 · 28 comments
Closed

Multiple accounts #223

alandrumo opened this issue Apr 22, 2023 · 28 comments
Labels
enhancement New feature or request

Comments

@alandrumo
Copy link

I have two different octopus accounts and two meters in my house. How difficult would it be to add another account and meter to the same home assistant instance?

@BottlecapDave BottlecapDave added the enhancement New feature or request label Apr 23, 2023
@BottlecapDave
Copy link
Owner

Hello. I've had a couple of requests, but tbh it's low on my list as it would require quite a major re-write. One of the biggest issues is the limitation on HA integration UIs. I'll keep this issue open so other people can upvote it.

@rwbarrett
Copy link

Would also like this as have 2 accounts

@ronhogwarts
Copy link

Same, two accounts for me

@ACALVETT
Copy link

Me to, useful as i would like to manage and automate my mums energy as well.

@BottlecapDave
Copy link
Owner

BottlecapDave commented Jan 20, 2024

I've created an initial beta release to support this, which can be found at https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/releases/tag/multi-account-support-beta-1.

I don't have multiple accounts so very hard for me to test. Because of this and that less than 1% of installs are requesting this feature, the presence of the beta does not guarantee an eventual release.

Multiple accounts with target rate sensors and cost sensors that span multiple accounts should be tested.

Installation Instructions

Go to HACS and click redownload

hacs-1

From here, you'll need to switch to see beta releases and select the target beta version.

hacs-2

Once downloaded, you'll need to restart your HA instance.

Additional Accounts

If this is your first time using the integration, then you'll need to add your initial account. After this, to add additional accounts, you'll need to configure another instance of the integration, which will bring up the following menu

integration-1

If you add target rate sensors or cost sensors, you'll now be presented with this pre-menu where you need to select your target account. This will filter down the target meters for the sensors.

integration-2

@ACALVETT
Copy link

Amazing! I will setup and feedback

@rwbarrett
Copy link

HACS tells me I have the beta installed but when I add the integration it only asks me for one account number and sets up as before with only the devises for that single account

@BottlecapDave
Copy link
Owner

@rwbarrett You'll need to configure an initial account first. This flow will not change as 99% of users will not need to setup more than one account. I've updated my comment above with installation and instructions on how to add additional accounts.

@ACALVETT
Copy link

Working for me, i will test more. One minor thing to note is the api key is the same so don't need to add it again for multiple accounts.

@rwbarrett
Copy link

rwbarrett commented Jan 20, 2024

Thanks - thats brilliant - all working now. Will need to see what Predbat does now it has two octopus accounts to choose from

@markcocker
Copy link
Contributor

markcocker commented Jan 21, 2024

The beta is work great for me. I now have two accounts configured: both with gas + electric meters, and one also has export meter and four export rate meters. Amazing. Thank you!

Update: I have now have 3 Octopus accounts added and working.

@alandrumo
Copy link
Author

alandrumo commented Jan 21, 2024 via email

@PhillyGilly
Copy link

Can I use this to compare two tariffs? I'm on the octopus variable E7 tariff but I'd like to compare this with Agile using traget Rate Sensors before switching over. Thanks

@BottlecapDave
Copy link
Owner

This will not support this functionality as you'll result in clashes in entity names (which include account id or meter ids). There is checks in place to ensure you can't setup the same account multiple times. You can use the override sensors to compare tariffs, but this will not effect target rate sensors.

@alfwro13
Copy link

alfwro13 commented Feb 7, 2024

I agree with @PhillyGilly that would be a great enhancement - i.e. add the same account 2nd time and use the tariff override for cost comparison. But I understand why that is currently not possible with the sensors are named.

@BottlecapDave
Copy link
Owner

There is a separate ticket around being able to override the main tariff of your account which would have a cascading effect to everything including target rate sensors. But this would obv replace all data while the tariff has been override (which could cause confusion when looking at past data). As mentioned, no plans to support this ability with multiple accounts support.

@BottlecapDave
Copy link
Owner

Speaking of multiple account support, has anyone had any issues with it?

@markcocker
Copy link
Contributor

markcocker commented Feb 7, 2024

Speaking of multiple account support, has anyone had any issues with it?

I have setup 3 accounts as below and 4 rate meters. Automated joining saving session for all 3. Getting electric + gas spins data for all 3.

  • Electric meter, electric meter export, gas meter, "charger" for Intelligent Octopus
  • Electric meter, gas meter, "charger" for Intelligent Octopus
  • Electric meter, gas meter

@rwbarrett
Copy link

rwbarrett commented Feb 7, 2024 via email

@BottlecapDave
Copy link
Owner

If there's no issues that are related to having multiple accounts, then yes the idea is to merge the feature into the main release.

@BottlecapDave
Copy link
Owner

New beta release which includes features/bugfixes from v10.0.4 and v10.1.0. This can be found at https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/releases/tag/multi-account-support-beta-2

@sandersr
Copy link

Will this integration work if I have two electricity meters on the same account? Recently I asked Octopus to add 2nd meter and rather than creating a new account, they've added it to my primary account. In their API I can see two meters:

https://api.octopus.energy/v1/electricity-meter-points/{METER_1_ID}/meters/{METER_1_SERIAL_NUMBER}/consumption/
and
https://api.octopus.energy/v1/electricity-meter-points/{METER_2_ID}/meters/{METER_2_SERIAL_NUMBER}/consumption/

@BottlecapDave
Copy link
Owner

@sandersr if both meters have a valid tariff associated with them, then both should be retrieved and populated.

@markcocker
Copy link
Contributor

markcocker commented Mar 2, 2024

I have an automation to join the saving sessions for multiple accounts when the octopus_energy_new_octoplus_saving_session event is fired. The first account is joined as expected, but the second one fails with Account ineligible to join Saving Sessions event.. I can go to the Octopus site for those accounts an manually sign up to the savings session.

I wondered if this is due to timing - perhaps Octopus does not make all accounts eligible at the same time and so the 2nd account fails?

Should this integration fire the same event for each account, so perhaps my automation needs to handle just one account per event?

alias: Octopus saving session - joiner
description: Automatically join Octopus Saving Session Events
trigger:
  - platform: event
    event_type: octopus_energy_new_octoplus_saving_session
condition: []
action:
  - service: octopus_energy.join_octoplus_saving_session_event
    data:
      event_code: "{{ trigger.event.data[\"event_code\"] }}"
    target:
      entity_id: event.octopus_energy_X_XXXXXXXX_octoplus_saving_session_events
    continue_on_error: true
  - service: octopus_energy.join_octoplus_saving_session_event
    data:
      event_code: "{{ trigger.event.data[\"event_code\"] }}"
    target:
      entity_id: event.octopus_energy_Y_YYYYYYYY_octoplus_saving_session_events
    continue_on_error: true

etc.

  - service: persistent_notification.create
    data:
      title: Octopus Saving Sessions Updated
      message: >
        Joined Octopus Energy saving session. It starts on
        {{trigger.event.data["event_start"].day}}/{{trigger.event.data["event_start"].month
        }} at {{trigger.event.data["event_start"].strftime('%H:%M') }}.
mode: single
Screenshot 2024-03-02 at 13 51 22

@alandrumo
Copy link
Author

alandrumo commented Mar 2, 2024 via email

@martindell
Copy link

Thanks @BottlecapDave. Works a treat with two Octopus accounts 👍

@RaoulSargent
Copy link

RaoulSargent commented Apr 5, 2024

PERFECT :-)

I have two accounts now working:

  1. Electric Export, Electric Import, Gas
  2. Electric Import, Gas

I will be adding a third account in the coming months.

Very easy to setup.

I was previously running version 10.1.4 with the 1) account mentioned above.
I went into HACS, re-downloaded the Beta-2, restarted HA
Then added a new instance of the Octopus plugin in HA Settings / Devices & Services / Add Integration
This gave me the new menu option to add account, which I did with the account ID for the 2) account
Bingo, all working as expected.

I also use the blueprint called "Octopus Energy - Join Saving Session" with account 1)
So I setup another instance of the blueprint for account 2)
Bingo, that too appears to have created the automation correctly.

So all-in-all a very smooth setup experience.

Well done and Thank you :-)

@BottlecapDave
Copy link
Owner

This feature has now been released as part of v10.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests