Coder Social home page Coder Social logo

HA integration about yi-hack-v5 HOT 34 CLOSED

alienatedsec avatar alienatedsec commented on June 8, 2024 4
HA integration

from yi-hack-v5.

Comments (34)

ping-localhost avatar ping-localhost commented on June 8, 2024 1

Upgrading my yi-hack integration right now. Will report back.

Seems to be working with my Yi Outdoor. Thank you very much (both @roleoroleo and @alienatedsec). 😄

from yi-hack-v5.

louulouu avatar louulouu commented on June 8, 2024 1

Tried it with two of my Yi Dome 1080p, (yi-hack-v5 and HA Integration) and it seems to be working. I'll test it out and keep an eye on bugs. Thank you so much for all the efforts @roleoroleo and @alienatedsec! Awesome work!

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024 1

The status entity always seems to say "Disconnected" for me even when I can access the cam through HA still. Additionally, sometimes on HA restarts, the integration seems to not be able to connect to the camera and then it just dies; HA never sees the camera again until another restart. The error in HA logs is:

Failed to get system configuration from device 192.168.x.x: error HTTPConnectionPool(host='192.168.x.x', port=80): Max retries exceeded with url: /cgi-bin/get_configs.sh?conf=system (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9407c7dbe0>: Failed to establish a new connection: [Errno 111] Connection refused'))

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024 1

Looks like updating to 0.3.1 works. The integration has survived several HA restarts. The status attribute still shows "Disconnected" though, even though everything is working. Not a huge deal for me though.

from yi-hack-v5.

ping-localhost avatar ping-localhost commented on June 8, 2024 1

@roleoroleo I meant the binary_sensor status, yes. Didn't know I actually had to turn on MQTT to use it, so I've done that now and it works for both mstar and v5. My apologies for wasting your time.

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024 1

I was also unaware the status sensor was related specifically to MQTT. I can confirm with MQTT up and running, it correctly reports "Connected" now.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024 1

I will add a note in the readme.
Thanks.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024 1

Reading the documentation, the option is supported.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Is the wifi connection good?

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

Should be... the "WiFi Strength" on the cam's web interface homepage shows 135% 😅 and it's in the room adjacent to the room with my AP; only a single interior wall between the two.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

I will check it.

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

It's almost as if the cam is a bit too slow on occasion to respond to the request, so it just times out. And sometimes it responds within that time and connects fine. Either way, it probably should have some sort of auto-reconnect ability I would think.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Please run the cgi manually.
http://IP-CAM:8080/cgi-bin/status.json

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

I get a response from that. I can always access the cam even when Home Assistant fails to, even though the web interface may be slow. Do you need the output?

from yi-hack-v5.

alienatedsec avatar alienatedsec commented on June 8, 2024

The status entity always seems to say "Disconnected" for me even when I can access the cam through HA still. Additionally, sometimes on HA restarts, the integration seems to not be able to connect to the camera and then it just dies; HA never sees the camera again until another restart. The error in HA logs is:

Failed to get system configuration from device 192.168.x.x: error HTTPConnectionPool(host='192.168.x.x', port=80): Max retries exceeded with url: /cgi-bin/get_configs.sh?conf=system (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9407c7dbe0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Is the port correct as I can see port=80?

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

Yes, I switched my HTTPD and ONVIF ports. Should I not have done that? I wasn't sure why that change was made, and I prefer being able to access the web interface without specifying the port so I swapped them. Was there a specific reason for the original swap that I missed?

from yi-hack-v5.

alienatedsec avatar alienatedsec commented on June 8, 2024

@thedeany maybe worth testing with default ports and see if it makes any difference

from yi-hack-v5.

ping-localhost avatar ping-localhost commented on June 8, 2024

I just checked my yi-hack-MStar camera (using port 8080) and it has the same issue, so I don't think this is a yi-hack-v5 only issue. That said, my yi-hack-v5 reports the same status, but I didn't notice it before.

image


Oh, by the way, I do get motion detected events from my yi-hack-MStar camera (never clears them though), but not from my yi-hack-v5 camera. 😅

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Do you need the output?

Yes, please.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Yes, I switched my HTTPD and ONVIF ports. Should I not have done that? I wasn't sure why that change was made, and I prefer being able to access the web interface without specifying the port so I swapped them. Was there a specific reason for the original swap that I missed?

Historical reasons when the wsdd service wasn't there.

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

Output from status.json:

{
"hostname":"yi-hack-v5",
"fw_version":"0.3.0",
"home_version":"2.1.0.0E_201809191630",
"model_suffix":"yi_home_1080p",
"hardware_id":"48US",
"serial_number":"[REDACTED]",
"local_time":"Wed Apr 22 19:40:33 UTC 2020",
"uptime":"1358.77",
"load_avg":"5.38 4.61 3.62",
"total_memory":"30760",
"free_memory":"12148",
"free_sd":"100%",
"local_ip":"192.168.x.x",
"netmask":"255.255.255.0",
"gateway":"192.168.x.x",
"mac_addr":"[REDACTED]",
"wlan_essid":"[REDACTED]",
"wlan_strength":"95" 
}

Again, just to reiterate, sometimes it does connect so it seems like a timeout or race condition or something.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Try to update status.json to the last version.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Please try the new code I pushed.
I changed timeout parameter from 5 to 10.

from yi-hack-v5.

PatrickR68 avatar PatrickR68 commented on June 8, 2024

I changed timeout parameter from 5 to 10.

Wouldn't it be better to make it configurable?

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

Wouldn't it be better to make it configurable?

Yes.

from yi-hack-v5.

ping-localhost avatar ping-localhost commented on June 8, 2024

Please try the new code I pushed.
I changed timeout parameter from 5 to 10.

Updated to the latest version, but it doesn't change anything for me. Both my cameras (yi-hack-MStar and yi-hack-v5) report disconnected (the RTSP camera works fine though). That is weird right? 😂

image

image. image

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

About mstar, is the cam updated with the last version?

from yi-hack-v5.

ping-localhost avatar ping-localhost commented on June 8, 2024

About mstar, is the cam updated with the last version?

It is:

image

image

from yi-hack-v5.

thedeany avatar thedeany commented on June 8, 2024

I'm currently having some trouble with a bootlooping camera, so I can't test the latest version just yet.

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

When you say status, do you mean the binary_sensor or media_player?
If you mean binary_sensor you need to configure mqtt because the status is related to the birth/will messages sent from the cam through mqtt.
If you mean media_player the status comes from the cgi I described above and it should work.

from yi-hack-v5.

alienatedsec avatar alienatedsec commented on June 8, 2024

I am going to refresh this issue.

@roleoroleo is this integration specific to any FFMPEG version? - I am asking mainly because of the below parameter
image

from yi-hack-v5.

roleoroleo avatar roleoroleo commented on June 8, 2024

ffmpeg is used to convert the audio file when you play a media (for example for the tts engine) and as a backup method when a snapshot is called (if the webapi fails).
The parameter you highlighted is used in the 2nd case and it's added to the cmdline to force tcp connection.
I don't know if this parameter is compatible with all ffmpeg versions.

from yi-hack-v5.

alienatedsec avatar alienatedsec commented on June 8, 2024

I recently discovered the latest v5.1.2 - not sure if its any good to you.
https://www.ffmpeg.org/download.html

from yi-hack-v5.

alienatedsec avatar alienatedsec commented on June 8, 2024

#232 for reference

from yi-hack-v5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.