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

Please do a release with serial & tcp support #11

Open
markbergsma opened this issue Aug 1, 2021 · 27 comments
Open

Please do a release with serial & tcp support #11

markbergsma opened this issue Aug 1, 2021 · 27 comments

Comments

@markbergsma
Copy link
Contributor

I'd be grateful if you could do a release with the Serial & TCP support that appears to have been present in the code for some time. :) Are there any remaining issues with it? Can I help test it?

I was looking into adding support for it to the Home Assistant integration, but then found that the version 0.4.2 release doesn't have it yet. My older projector (EH-TW3200) doesn't yet have a LAN port.

@markbergsma
Copy link
Contributor Author

Just found (closed) issue #1 which didn't see a lot of activity. I assume this was closed for lack of testing?

@pszafer
Copy link
Owner

pszafer commented Aug 1, 2021

there are 2 protocols tested by me and some users: HTTP and TCP.
As I found out most new projectors (if not all) doesn't support control over TCP, but support controlling via HTTP...
About serial control, nobody tested it so I don't know if it is working. It was 3 years ago, so I might forgot about something.
For sure now I need to retrieve serial number of projector before adding it to HA, I don't know if it's possible via serial.

@markbergsma
Copy link
Contributor Author

there are 2 protocols tested by me and some users: HTTP and TCP.
As I found out most new projectors (if not all) doesn't support control over TCP, but support controlling via HTTP...
About serial control, nobody tested it so I don't know if it is working. It was 3 years ago, so I might forgot about something.

I just cloned the repository, and after a few trivial fixes (e.g. loop parameter still there) I got test_serial.py working, and it turned on my projector.

For sure now I need to retrieve serial number of projector before adding it to HA, I don't know if it's possible via serial.

I'm not sure either. I just tried a modified version of the get_serial() method from ProjectorTCP, and that doesn't work so far. But I can experiment a bit more soon, and will let you know.

In case it turns out impossible to retrieve the serial number from the projector, perhaps we can use something else to set the entity unique_id - e.g. based on the serial device file path may just be sufficient.

@pszafer
Copy link
Owner

pszafer commented Aug 1, 2021

Try to find out if it's possible to retrieve serial number or anything which makes device unique.
As before all my attempts to make user provide serial number or model number were rejected by HA Core devs as uniqueness of entity id shouldn't rely on user input.

@markbergsma
Copy link
Contributor Author

The "SNO?" command appears to work - even when the projector is not turned on.

I implemented the following method in ProjectorSerial:

    async def get_serial(self):
        """Send request for serial to Epson."""
        if not self._serial:
            response = await self.send_request(timeout=DEFAULT_TIMEOUT, command=SERIALNO_COMMAND+CR)
            try:
                self._serial = response.split("=", maxsplit=1)[1]
            except:
                _LOGGER.error(f"Error parsing serial number from response {response}")
        return self._serial

Sample output from my projector: "NPCF210216L"

I'll experiment a bit more and send a PR your way once I'm confident enough it works reliably.

@pszafer
Copy link
Owner

pszafer commented Aug 2, 2021

sounds good! When I got this PR I will prepare custom_component of epson for you, so you can test it thoroughly and then I can create PR in HA Core.

@markbergsma
Copy link
Contributor Author

sounds good! When I got this PR I will prepare custom_component of epson for you, so you can test it thoroughly and then I can create PR in HA Core.

Thanks! I've tested the code for a couple of days in practice, and just submitted a PR: #12

I had already extended the HA component with support to be able to test it in my HA instance, and I'd be happy to send a PR for that as well once we're happy with it. See https://github.com/markbergsma/home-assistant-core/tree/epson-serial and let me know what you think.

@pszafer
Copy link
Owner

pszafer commented Aug 4, 2021

ok, I will check this. For now you can wait with PR to HA as I have to remove configuration.yaml. option in first place as it's should be removed in 2021.9 version.

@pszafer
Copy link
Owner

pszafer commented Aug 23, 2021

Can you test if polling would work for serial connection for your projector?
In TCP it sends IMEVENT message as far as I remember

@markbergsma
Copy link
Contributor Author

Can you test if polling would work for serial connection for your projector?
In TCP it sends IMEVENT message as far as I remember

I'm... not sure what you mean by polling here?

@pszafer
Copy link
Owner

pszafer commented Aug 27, 2021

sorry, no polling, but I meant subscription to events sent by projector

@markbergsma
Copy link
Contributor Author

I'm not aware of any support for push updates over the serial connection/protocol, so I think it's down to polling for now.

The serial code as well as my updated HA component appears to have been working well for the past few weeks here.

@martimarkov
Copy link

@markbergsma hey, is there a plan to merge your branch changes to HA?

@pszafer
Copy link
Owner

pszafer commented Nov 22, 2021

@martimarkov PR is merged, just HA component needs to be adapted to work with it.
In December I can create some custom component for tests, but I'd need someone help as I don't own projector with serial support.

@martimarkov
Copy link

martimarkov commented Nov 22, 2021 via email

@markbergsma
Copy link
Contributor Author

@markbergsma hey, is there a plan to merge your branch changes to HA?

Yes, I can try to update my custom HA component with the latest HA code soon, now this library code is published.

Unfortunately, I have less need for this code since I wrote it, as my old projector (EH-TW3200) has died in the mean time. But my new one (EH-TW9400) still has a serial port alongside LAN, so I suppose I can test it with that.

@daza67
Copy link

daza67 commented Apr 28, 2022

I'm fairly new to HA after coming over from years of using openhab. I have an older Epson serial projector that I was using successfully in openhab via a Tasmota Serial-to-TCP-Bridge. I've been struggling to get this working in HA and I stumbled upon this. It appears the Epson integration will only attempt to talk ESC/VP.net and not ESC/VP when using TCP which of course my serial only projector fails to respond to. Is there any way this code could be adapted to use a TCP bridge like in my case ?

@pszafer
Copy link
Owner

pszafer commented May 6, 2022

@daza67 are you able to write code in python? I'm missing somebody who can test and fix issues for serial connected device.

@daza67
Copy link

daza67 commented May 6, 2022 via email

@amosyuen
Copy link

I wrote a serial home assistant integration on HACS for my Epson Home Cinema https://github.com/amosyuen/ha-epson-projector-link. Feel free to refer to it if it's helpful.

@s0129
Copy link

s0129 commented Jun 8, 2024

I also have a Epson projector with only a serial port. Been using it with openhab using ser2net, now migrating to home assistant and trying to find a solution. Happy to test anything you have, I am familiar with python.

@s0129
Copy link

s0129 commented Jul 7, 2024

I have tested this library and it works great with my projector via serial. Are there still plans to extend the home assistant integration to have a serial option?

@pszafer
Copy link
Owner

pszafer commented Jul 7, 2024

If somebody would make PR to this lib and HA component I'd be happy to merge it.
I don't have such device so I won't do it myself.

@s0129
Copy link

s0129 commented Jul 9, 2024

If somebody would make PR to this lib and HA component I'd be happy to merge it. I don't have such device so I won't do it myself.

I have created a PR for this.
home-assistant/core#121630

@s0129
Copy link

s0129 commented Aug 1, 2024

@pszafer any chance you can have a look at the PR? I have been using it for a few weeks now without issue.

@pszafer
Copy link
Owner

pszafer commented Aug 1, 2024

I already told on discord that this pr looks good to me but I'm unable to test it. I added comment in PR as well

@s0129
Copy link

s0129 commented Aug 1, 2024

Excellent, 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