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

Feature request - prevent from removing entities while rebooting HA #28

Closed
anybody84 opened this issue Mar 2, 2020 · 22 comments
Closed

Comments

@anybody84
Copy link

AS-IS behavior:
Each time when I reboot HA and the printer is off most of the entities disappear from HA (except of binary_sensor.xxx_status). Then it looks bad in the frontend:
image

TO-BE idea:
It would maybe make more sense to keep the entities, just with 'unknown' or 'unavailable' state.

@AdmiralRaccoon
Copy link

Same here, I´m voting for that, too

@kersten-lohmeyer
Copy link

kersten-lohmeyer commented Apr 10, 2020

yeah, sorry but this behaviour is really odd. Please keep the entities. Also my printer is off most of the time so I just need the addon to update the ink levels once in a while. It should cache the last known ink level and not show unknown or unavailable.

@elad-bar
Copy link
Owner

In latest version of HA new offical IPP component added,
I stopped maintaining that component since that component (HP) is for specific API of HP while IPP is a standard cross-brand.

the only lack in the offical component is number of pages printed, job cancelled and scanned documents.

thanks for the input

@Krocko
Copy link

Krocko commented Apr 10, 2020

For me this new IPP component don’t work.
With this component the state from my printer is always idle.

@anybody84
Copy link
Author

Yep, same here. It's always idle, no matter what.

elad-bar added a commit that referenced this issue Apr 24, 2020
**Implemented enhancements:**

- Added changelog
- Added ability to configure update entities interval in seconds (Integrations -> Integration Name -> Options)  [\#31](elad-bar/ha-edgeos#31)
- Added validation to add new integration, display error in case printer is unreachable or unsupported [\#15](elad-bar/ha-edgeos#15) [\#11](elad-bar/ha-edgeos#11) 
- Moved code to new file structure
- More logs added for easier debugging
- Removed service `hpprinter.save_debug_data`
- Added option to store debug files from Integration UI -> Option (more details in README)

**Fixed bugs:**

- Fix entities / device / device's area changing names is being reset after restart [\#24](elad-bar/ha-edgeos#24) [\#28](elad-bar/ha-edgeos#28) [\#39](elad-bar/ha-edgeos#39)
- Moved [Updating 2020-04-14 09:21...] to DEBUG [\#39](elad-bar/ha-edgeos#39)
@elad-bar
Copy link
Owner

Fixed entities / device / device's area changing names is being reset after restart

Please check

@kersten-lohmeyer
Copy link

Fixed entities / device / device's area changing names is being reset after restart

Please check

So you're going to further maintain this component?

@elad-bar
Copy link
Owner

yap, after checking the IPP component for the last few 2 weeks, I found out it lacks of information that important to me, in addition, when the printer is off (power saving) lots of errors are being thrown to the log

@SeLLeRoNe
Copy link

If I may add something, the toner status entities shouldn't disappear when the printer is off (during HA reboot), they still should be created as the status ones, but with maybe unavailable value or something like that. (same goes for the printed pages)
image

@SeLLeRoNe
Copy link

Or maybe store the old value would be even better :P

@elad-bar
Copy link
Owner

Yesterday I released new version with restore state feature, can you check if it works for you?
thanks

@SeLLeRoNe
Copy link

I have just tried and now it doesn't "connect" to the printer anymore, the binary sensor sais it is connected but all the other sensors do not exists.

In the integration all the "components" are gone beside the binary sensor.

I am now tring to reinstall and re-add the printer.

I'll update with the outcome

@SeLLeRoNe
Copy link

SeLLeRoNe commented Apr 27, 2020

I have this error in the logs:

2020-04-27 21:39:48 ERROR (MainThread) [custom_components.hpprinter.managers.entity_manager] Failed to update, step: Mark as created - binary_sensor -> HP LaserJet Pro CP1525NW Connectivity, Error: 'NoneType' object has no attribute 'disabled', Line: 201

And removing and adding back didn't fix, actually made it worse because now the integration is completely empty :D

@anybody84
Copy link
Author

For me it works. I have set up an integration, then I've turned off the printer and restarted HA and I still have all the entities:

Screenshot_20200427-222851_Home Assistant

Thank you!

@SeLLeRoNe
Copy link

That's odd, are you using the latest version (released about 2hours ago)?

@kersten-lohmeyer
Copy link

Works as expected now, thanks a lot!

@SeLLeRoNe
Copy link

Ok last commit fixed my issue and now is working.
There is one thing I would suggest, the "sensor.cp1525nw_status" which define On/Off should really be a binary_sensor rather than a simple sensor :)

Thanks

@elad-bar
Copy link
Owner

the status is not On/Off, available options are:
On, Scanning, Copying, Printing, Cancelling Job, Idle, Off

@SeLLeRoNe
Copy link

Oh ok, didn't know that :D

Thanks for clarifying and for implementing the new functionality

Bests
Andrea

@SeLLeRoNe
Copy link

I have the feeling the "On" shouldn't be in the sensor, it's fairly confusing :D
Instead, an "on" printer that is clearly doing nothing, should be set directly on Idle

@elad-bar
Copy link
Owner

Names are being takn from the printer's status, will try to find better name

@SeLLeRoNe
Copy link

I see, I find it confusing but I guess that's okay, no need for you to do any additional work, you did quite a lot already :)

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants