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

Add cleaning start, end and duration attributes #10

Closed
Ekman opened this issue Aug 31, 2021 · 15 comments
Closed

Add cleaning start, end and duration attributes #10

Ekman opened this issue Aug 31, 2021 · 15 comments
Labels
enhancement New feature or request

Comments

@Ekman
Copy link
Owner

Ekman commented Aug 31, 2021

Add attributes to the vacuum, such as last cleaning. There are some base attributes that are defined in Home Assistant core. Start with them and work from there. Search _ATTR in entity and vacuum.

Originally suggested in #4.

@Ekman Ekman added the enhancement New feature or request label Aug 31, 2021
@Ekman
Copy link
Owner Author

Ekman commented Sep 9, 2021

Adding attributes:

  • Last cleaning start
  • Last cleaning end
  • Last cleaning duration (seconds)

@Phype
Copy link
Contributor

Phype commented Oct 16, 2021

Should work pretty easily with CloudRobot.getCleaningSessions() now.

@Ekman
Copy link
Owner Author

Ekman commented Nov 28, 2021

Added first attribute in #29 task. I'll look into adding the rest of the attributes with @Phype recommendation.

@Ekman Ekman changed the title Add attributes Add cleaning start, end and duration attributes Nov 28, 2021
@Ekman
Copy link
Owner Author

Ekman commented Dec 4, 2021

Hey @Phype . I'm calling CloudRobot.getCleaningSessions() but I get KeyError: cleaningSession. I've double checked that my robots actually responds with the data using Postman and it does respond with a cleaning session. Do you have any idea what it could be? Here's the code.

image

@Phype
Copy link
Contributor

Phype commented Dec 5, 2021

Hmm, i'll look into it. item is the object which comes from the cloud API, so probably there is a possibility that one of these JSON objects doesn't have a property because of some weird reason which never happened for me.

@Phype
Copy link
Contributor

Phype commented Dec 13, 2021

I've added a workaround, but you have to handle to incomplete data yourself. I guess this will never happen to newly created cleaningsessions from now on, so a simple fix to handle these incomplete objects would be to just ignore them, especially if you only want to display the data for the latest item anyway.

@Phype
Copy link
Contributor

Phype commented Dec 13, 2021

BTW, do you want access to the totalLifetimeCleanedArea attribute?

This lists the total area cleaned in m² since the last reset. I can just copy it to the cleaning session object, the only question is if this really makes sense. I'd think this is more a property of the robot, and it's quite unintuitive having to get this property from the last cleaning session instead of sth. like 'CloudRobot.getTotalCleanedArea()' or something.

[
    {
        "id": "obfuscated",
        "sessionId": 1337,
        "timeStamp": "2021-11-20T14:14:39",
        "cleanedArea": 18.87,
        "totalLifetimeCleanedArea": 10318.514
    }
]

@Ekman
Copy link
Owner Author

Ekman commented Dec 13, 2021

Thanks for the heads up! Yes, for now I'm only including the latest cleaning session. When/if demands exists I might add more.

If you include the property totalLifetimeCleanedArea in the library then I'll use it. I guess you can look at it from two perspectives:

  1. It's the total area cleaned - Makes more sense to have as a property on the robot and not on the cleaning sessions.
  2. It's the total area cleaned at that point in time - Then it makes sense to have it on the cleaning sessioon. If I'd want to know "what was the total area cleaned before last cleaning.

I don't really know when you'd use the second to be honest. I'll definitely only be displaying one total. 😅

@GitPetri
Copy link

GitPetri commented Jan 17, 2022

  1. It's the total area cleaned - Makes more sense to have as a property on the robot and not on the cleaning sessions.
  2. It's the total area cleaned at that point in time - Then it makes sense to have it on the cleaning sessioon. If I'd want to know "what was the total area cleaned before last cleaning.

I don't really know when you'd use the second to be honest. I'll definitely only be displaying one total. 😅

I could think at least one use-case for both options:

  1. I want to know what happened in past
  2. I want to know how the current on-going cleaning is proceeding.

Regardless, as just a dummy integration user, I'd be happy to see either of those. ;)

@Ekman
Copy link
Owner Author

Ekman commented Feb 28, 2023

Finally! 🎉

Better late than never. Just released version 1.4.0 that contains this data.

@Ekman Ekman closed this as completed Feb 28, 2023
@GitPetri
Copy link

GitPetri commented Mar 1, 2023

Umm, @Ekman little help? I updated the PureI integration via HACS, integration is showing release now as 1.4.0 but I can't see any new entities for my vacuum. Do I need to re-integrate the device?

@Ekman
Copy link
Owner Author

Ekman commented Mar 3, 2023

Weird @GitPetri !

Please add this to your configuration.yaml and then send me your logs Settings -> System -> Logs:

logger:
  default: warn
  logs:
    custom_components.purei9: debug
    purei9: debug
    homeassistant.components.purei9: debug

@GitPetri
Copy link

GitPetri commented Mar 4, 2023

Weird @GitPetri !

Please add this to your configuration.yaml and then send me your logs Settings -> System -> Logs:

logger:
  default: warn
  logs:
    custom_components.purei9: debug
    purei9: debug
    homeassistant.components.purei9: debug

Hmm, probably this: 2023-03-04 13:32:45.460 WARNING (SyncWorker_5) [custom_components.purei9.vacuum] DEPRECATED: Setup the integration using integration UI instead of configuration.yml.

@GitPetri
Copy link

GitPetri commented Mar 4, 2023

Yup, that was it. I had old

vacuum:

  • platform: purei9
    email: !secret electrolux_user
    password: !secret electrolux_password

in my configuration.yaml. Commented those out, re-integrated the vacuum via integration UI and now it works
S.U.E. - Stupid User Error.
image

@Ekman
Copy link
Owner Author

Ekman commented Mar 6, 2023

I'm glad to hear that! Just let me know if you have any more questions. 🙂

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
None yet
Development

No branches or pull requests

3 participants