Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Charging status sensor #422

Closed
1 task done
dbochicchio opened this issue Sep 15, 2023 · 12 comments
Closed
1 task done

Charging status sensor #422

dbochicchio opened this issue Sep 15, 2023 · 12 comments
Labels
enhancement New feature or request need-more-information Need more information stale

Comments

@dbochicchio
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and no issue is describing my feature request or idea

Is your feature request related to a problem?

No response

Suggested solution

In a large house with max power in some zones, the bot will need to come back to the base station to recharge itself before completing. In this scenario, the reported status is "paused", and I cannot detect if the pause was related to the bot that is lost somewhere or being charged.

A new attribute on the battery entity is enough.

Thanks for this fantastic integration!

Api example request

No response

Alternatives you've considered

No response

Additional information

No response

@dbochicchio dbochicchio added the enhancement New feature or request label Sep 15, 2023
@edenhaus
Copy link
Contributor

What is the Status of the bot in the app?

@dbochicchio
Copy link
Author

dbochicchio commented Sep 15, 2023

It's paused, but there should be a "ChargeState" event coming from the bot's API:
https://github.com/mrbungle64/ecovacs-deebot.js/blob/master/library/ecovacs.js#L80

I used this lib before and I had the charging state correctly reported (plus, the bot position). Thanks!

@edenhaus
Copy link
Contributor

Please activate debug logs and attach them here

@edenhaus edenhaus added the need-more-information Need more information label Sep 17, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 24, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2023
@dbochicchio
Copy link
Author

Sorry for the last response, I've been thru a crazy period lately.

Anyway, I turned on debug logs but there's nothing to see. From my understanding of the code, it's a completely different event.

Right now one of my bots is paused while charging, the app is reporting "paused" and I cannot determine if it's docked or lost somewhere. I'll probably just write some code on my own to determine if the battery is depleting or recharging to understand if the bot is lost or effectively recharging, but I think a couple of attributes/sensor to determine if it's docked or not could be used to anyone out there. Thanks!

@edenhaus
Copy link
Contributor

Anyway, I turned on debug logs but there's nothing to see. From my understanding of the code, it's a completely different event.

If you really turned on the debug logs there are a lot of log entries including all data coming from the bot....

Right now one of my bots is paused while charging, the app is reporting "paused"

When also the ecovacs app reports your bots as paused there is nothing that I can do...

It's paused, but there should be a "ChargeState" event coming from the bot's API:
mrbungle64/ecovacs-deebot.js@master/library/ecovacs.js#L80

it's a completely different event.

Not sure what you mean with these two comments but the charge state is handled https://github.com/DeebotUniverse/client.py/blob/dev/deebot_client/commands/json/charge_state.py

Right now one of my bots is paused while charging, the app is reporting "paused" and I cannot determine if it's docked or lost somewhere.

I can assure you that my bot is reported as docked in HA when it's docked and probably for the other ~10k users it is. It's probably an edge case of your bot. I'm willing to help, but you don't provide any data, the only thing you say it is not working...

I'll probably just write some code on my own to determine if the battery is depleting or recharging to understand if the bot is lost or effectively recharging, but I think a couple of attributes/sensor to determine if it's docked or not could be used to anyone out there.

Sure you can write your own code. Please feel free to open a PR so your code helps the community :)

@dbochicchio
Copy link
Author

I appreciate your hard work, and I didn't mean to upset you. I'm sorry, I was not my intention.

Regarding my request, let me clarify.
What I wanted to get was the charging state of the bot (so, docket and charging, or not docked and not charging). It is not related to my own situation, and I think everyone will benefit from it. In my case, it'd be used to understand if the bot has really finished its schedule, or it has come back to the dock because the battery is over, it needs to recharge and then start again.

There's no sign of this special case in logs. Of course, logs are generated, but there's no trace of the charging status. I could submit them anyway, but I doubt it will benefit you.

It's a request for a new attribute that, when using the JavaScript library, I was able to get. If you have no intention of adding it, I'm OK with that.

My code is mainly HA-related, so not very reusable. I'm not that proficient in Python, otherwise I'd have submitted a PR.

Thanks again!

@edenhaus
Copy link
Contributor

If you have really activated debug logs, there must be for each event sent by the bot a log entry.
Also, the library sends a StateEvent, so the information is already there.

Can you please add diagnostic information and the debug logs, so I can quickly check it myself.

@dbochicchio
Copy link
Author

Here we go. Logs attached.
deebot logs.txt

As I've said, the status is cleaning, because the requested job is not finished yet, but the bot is charging in its dock. So, the bot is docked trying to re-charge while the job is still pending. As I've said, I'm watching for battery events to understand if it's charging or discharging in order to determine if the job is really finished or not.

It took me a couple of weeks to be there because it is not common for the bot to be in this state and me at home to enable debug logs. Hope it helps.

Thanks for your time and help!

@edenhaus
Copy link
Contributor

Please attach the diagnostic information of the device, which has the problems.

Your bot is always returning "isCharging":0,, which means he is not charging at least in the submitted logs.
The logs contain only data of one minute, which is not enough. I need at least 1 minutes before the bot starts to returning to the docking station and 5 minutes after it started charging. Please write me also the time, when the bot reaches the docking station

@dbochicchio
Copy link
Author

Not easy to catch, I'll try my best. In the meanwhile, is the isCharging property available somewhere as an attribute? Thanks.

@edenhaus
Copy link
Contributor

Not easy to catch, I'll try my best.

Should be easy. Start debug logging and run a cleaning cycle and afterward cut the log file to include only the specified time.

is the isCharging property available somewhere as an attribute?

Nope as this is not required. If the property is equal to 1 the status will be reported as docked

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request need-more-information Need more information stale
Projects
None yet
Development

No branches or pull requests

2 participants