HomeAssistant-OctopusEnergy icon indicating copy to clipboard operation
HomeAssistant-OctopusEnergy copied to clipboard

Redemption of Octoplus Points automatically

Open Nurgus opened this issue 11 months ago • 1 comments

Describe the feature

Is it possible to redeem Octoplus Points? If not, is it possible to add this feature? I don't see any point in holding them, just redeem them automagically.

Expected behaviour

A service call to redeem some or all Octoplus Points

Use Case

Octoplus Points redeemed automatically.

Confirmation

  • [X] By submitting this feature request, you agree that you have read the documentation and confirmed it does not already exist
  • [X] I am willing/able to help contribute to the solution of this feature

Nurgus avatar Mar 27 '24 09:03 Nurgus

Hello and sorry for the late response.

This should be possible. There are limitations on number of points that are redeemable (number has to be divisible by 8). Therefore when added it should include the following

  1. The points sensor should be updated to include an attribute which determines the number of redeemable points.
  2. A new service (octopus_energy_redeem_all_redeemable_points) which takes the applicable points sensor and calls the api endpoint providing the value of the above attribute. 2a. If there are no redeemable points available, an error should occur 2b. Upon success, should remove the number of redeemed points from both the attribute and state.
  3. Unit and integration tests for the above
  4. Blueprint which calls the service if the redeemable points attribute goes over a configurable threshold.

Example API call

mutation redeem_points($accountNumber: String!) { 
  redeemLoyaltyPointsForAccountCredit(input: {
    accountNumber: $accountNumber,
    points: 8
  }) {
    pointsRedeemed
  }
}

BottlecapDave avatar Apr 06 '24 17:04 BottlecapDave

This has now been included as part of v10.3.0

BottlecapDave avatar Apr 15 '24 08:04 BottlecapDave

Awesome! Thanks!

Nurgus avatar Apr 15 '24 09:04 Nurgus

Hi, how do I go about setting this up, I can see the entity but how do I setup the blueprint.

I tried using the install blueprint option you have but it gives an unknown error.

maddogspeighty avatar Apr 15 '24 12:04 maddogspeighty

Sorry there was a slight bug in the docs around the installation of the blueprint, which should now be fixed.

BottlecapDave avatar Apr 16 '24 07:04 BottlecapDave

That fixed it, thanks.

maddogspeighty avatar Apr 16 '24 07:04 maddogspeighty