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

MotionEye integration not working with Motioneye addon #50409

Closed
omriasta opened this issue May 10, 2021 · 8 comments
Closed

MotionEye integration not working with Motioneye addon #50409

omriasta opened this issue May 10, 2021 · 8 comments

Comments

@omriasta
Copy link
Contributor

The problem

Trying to add the integration using the URL http://127.0.0.1:28765 as specified by the add on creator succeeds however the camera is not viewable. An error appears in the logs only after attempting to view the camera indicating a login error.
Possibly the integration is not expecting the use of ingress?

What is version of Home Assistant Core has the issue?

core-2015.5.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

motionEye

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:116
Integration: HTTP (documentation, issues)
First occurred: 10:49:23 AM (1 occurrences)
Last logged: 10:49:23 AM

Login attempt or request with invalid authentication from x.x.x.x (x.x.x.x). (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36)

Additional information

I am guessing that since the integration is detecting the install and does complete the flow, it even adds the camera device and entity, the issue is most likely with the URL of the camera stream which is probably presented using ingress or maybe because my camera uses rtsp with the user/password specified in the URL.

@probot-home-assistant
Copy link

Hey there @dermotduffy, mind taking a look at this issue as its been labeled with an integration (motioneye) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@omriasta
Copy link
Contributor Author

Sorry, forgot to mention and link, the add on in use is:
https://github.com/hassio-addons/addon-motioneye

@dermotduffy
Copy link
Contributor

dermotduffy commented May 11, 2021

Your theory would be my theory -- the integration seems to be working fine, but the stream URL is not accessible to HA as configured.

I'm the motionEye integration author (and author of the matching more feature-full custom component). Unfortunately, I don't use addons -- nor do I have any hardware available right now on which to experiment.

Related: Issue 1, Issue 2.

Since this seems to be a common stumbling block for motionEye add-on users, is there anyone who feels qualified to write-up the steps?

If so, you could either directly write a PR for Home Assistant Core documentation or the custom component -- or simply describe the steps in this bug and I could attempt to transcribe. In particular @basnijholt and @nmsousa76 both appear to have got this working, so may be willing to write it up...?

@omriasta
Copy link
Contributor Author

Actually, it's a bit more interesting. Looking at the other 2 issues i exposed port 8765 in the addon configuration and double checked to make sure that I was able to login from the LAN which worked. And again, since the config_flow works and adds the device it shows that it is able to communicate with the motioneye server. The problem only crops up when trying to view the camera. And from the error posted above it appears that when I try to view the camera, instead of providing the credentials to motioneye, the integration is trying to login to homeassistant instead of the motioneye server.
Also, Just because it isn't clear in the documentation, is it required to enable "Video Streaming" in motionEye?
I am just not sure what url is retrieved from motioneye and provided to homeassistant in order to view the camera.

@dermotduffy
Copy link
Contributor

@omriasta The integration uses the stream port that is configured on motionEye, and the same hostname the integration is configured with. This behavior is described more here: https://github.com/dermotduffy/hass-motioneye#camera-mjpeg-streams

@omriasta Your second question is answered here:

If the video streaming switch is turned off, the camera entity will become unavailable (but the rest of the integration will continue to work).

@omriasta
Copy link
Contributor Author

omriasta commented May 11, 2021

Yep, silly me...of course the streaming needs to be on to view the camera. My bad....didn't really think it through.
And as you mentioned the camera does show as unavailable when it is switched off. The one thing that still remains an issue is that when you try to view the "unavailable camera" instead of just not working it tries to login to homeassistant giving the error I pasted above....and if you have ip_bans setup, you will get locked out.
My guess is there should be some kind of way to avoid this so if the camera is unavailable you can't view it....though maybe that is something that needs to be fixed in Core.

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 9, 2021
@frenck
Copy link
Member

frenck commented Aug 9, 2021

This issue has actually been fixed, as the add-on & integration now auto-discover each other at this point.

@frenck frenck closed this as completed Aug 9, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants