home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.75k stars 28.91k forks source link

IPP integration forgets ink data #110369

Open jkufner opened 4 months ago

jkufner commented 4 months ago

The problem

The IPP integration shows correctly the information how much ink is remaining in the cartriges of my printer; however, when the printer is offline of several days, it forgets the data, including history. It would be really nice to see how much ink was there last time the printer was online, even if it is a week old information, so that I don't have to turn the printer on to check. The data are loaded correctly once the printer is online again, but the historical data are still missing.

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ipp

Link to integration documentation on our website

https://www.home-assistant.io/integrations/ipp/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 4 months ago

Hey there @ctalkington, mind taking a look at this issue as it has been labeled with an integration (ipp) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `ipp` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign ipp` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


ipp documentation ipp source (message by IssueLinks)

NateEaton commented 4 months ago

I ran into this issue quite a while back and set up entities based on MQTT persistent messages to avoid the issue but that really shouldn't be necessary.

I don't know whether it is related but I came here checking for a possible explanation for why my ink sensors keep dropping out to -2 and sometimes stay that way even if the printer had been on.

jman311 commented 3 months ago

For integrations like this that have sensors that go unavailable when the device is not reachable or offline, I suggest creating a Helper variable in HA for each sensor that you want to maintain the "last known good" value for. Then create an automation to update the value of the Helper variable to equal the value of the sensor, but only when the sensor is NOT unavailable.

I do this for each of my printer ink levels and I always have the last known value regardless of the status of the integration and related sensors.

JackboyPlay commented 2 months ago

Yeah, I am having the same problem. Maybe an option for the sensors to remember the last ink percentage instead of dropping to -2% would be nice.

GSzabados commented 2 months ago

I love the comments about how to hack around the integration to get some useful data of it, but lets be honest, HA is a HOME automation system. People do not keep printers on all the time, because they generally consume power. Even business level printers go to sleep or shut down to do not consume power. People at home do not print ever day, or every week, but it worth to have the data kept according the last seen value, without any hacky solution.

jman311 commented 2 months ago

It would be nice if HA entities could remember last known good values across the board. This can be an issue for any device that reports "unavailable" or "unknown" when off or unreachable.

I have to use the helper "hack" I mentioned earlier for thermostats, pool/spa sensors, vehicle data, device battery levels, etc.