core: Epson Projector regularly switching to "unavailable"
The problem
I have connected an Epson 5040UB projector via the Epson integration with intent to automate things based on “on” vs “off” status. However I’m noticing that the projector is frequently turning to “unavailable” status, both when in the “on” or “off” configuration. This is impacting my attempts to automate based on turning the projector on or off, as I see many extra spurios transitions from “off” to “unavailable” back to “off” etc. I see it switching to “unavailable” many times each hour, every few minutes judging by the entity history.
I see there was previous discussion of the issue here with some suggested ways to override timeout values to increase them, however with my raspberry pi using HA supervised, I cannot find the usr/local/lib/python3.7/site-packages/epson_projector/main.py file to override the timeout values.
What is version of Home Assistant Core has the issue?
2021.7.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Epson
Link to integration documentation on our website
https://www.home-assistant.io/integrations/epson/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
2021-07-13 17:15:43 ERROR (MainThread) [epson_projector.projector_http] Error request
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 38 (12 by maintainers)
I will create PR with timeout option again, we will see if it’d be accepted this time.
@Icexist it’s not possible in official version as it was rejected, but I rewrote lib and there were no people till now which reported any timeouts. @RonSpawnson for power on projector timeout to response is 40 seconds, and for power off is 10 seconds. What hardware do you use? As I tried to investigate similar issue before, it was mostly on rpi < 3 with usb devices stick in it (shared same bus).
Anyway is it becoming unavailable while it is working or during command sent to device?
Download repo from PR, and copy epson directory into custom_components directory of your HA, then it should use custom epson as integration.
Well my projector started doing the same old same old on me today… seemed very much out of the blue.
Then I checked the history and
so I guess I was just lucky and didn’t notice it was happening.
I applied the same fix as before and I’m back in business.
/usr/local/lib/python3.9/site-packages/epson_projector/main.py - inside docker remember!
When I did this in the past I had no idea what 6000 was (sec, ms, xs) I just chose a large number, it worked, so I left it at that value.
@frenck would love to know why “a 6000 seconds timeout will lead you to a whole new world of problems and is just wrong.”
I have used this for ages and it has not led me to anything other than a working projector. ¯_(ツ)_/¯
You can try to increase timeout in HA Core for testing purposes but as ping shows there is something wrong with connectivity of this device. You might try to create router on your phone and connect some PC to it as well, ping projector, then maybe it will give some hints if it’s problem with AP or projector
This issue hasn’t been closed in the meantime, so that is expected to persists.
A quick look, the upstream package
epson_projector, defines the timeouts, not Home Assistant. The suggestion in the linked previous/old discussion is something I would not recommend. Setting a 6000 seconds timeout will lead you to a whole new world of problems and is just wrong.Currently, it seems to be using a 3-second timeout for most commands, which is low, but for a local network… if it takes more than 3 seconds, you might have different issues :S A 10-second timeout might be more realistic and would probably solve the problems as well.
That said, this is an upstream issue in the library used by Home Assistant.