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

feature: set various configurations #100

Closed
trombik opened this issue Nov 23, 2022 · 12 comments
Closed

feature: set various configurations #100

trombik opened this issue Nov 23, 2022 · 12 comments
Labels

Comments

@trombik
Copy link
Contributor

trombik commented Nov 23, 2022

as a user, i would like to configure cameras via HA, such as enabling or disabling motion detection so that i can enable motion detection when i am away using Automation.

the integration does not offer much when it comes to configuring cameras. only privacy switch is implemented.

async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Yi Camera media player from a config entry."""
async_add_entities([YiHackSwitch(hass, config_entry)], True)

with this feature, one can implement "Home and Away" feature found in the yi mobile app.

@trombik
Copy link
Contributor Author

trombik commented Nov 23, 2022

@roleoroleo
Copy link
Owner

Where do you want to receive motion messages?
HA (via mqtt) or Yi app?

@trombik
Copy link
Contributor Author

trombik commented Nov 26, 2022

both if possible. because it is backward compatible and probably many users expects the app works even when the hack is installed.

however, i personally do not like the app and i am happy with notifications from HA only (via MQTT) because:

  • the app is not very responsive in emergency (it needs at least two clicks, one to open the app by clicking the notification, and another to see the recorded video from the event list). i prefer my solution; my HA automation sends messages to telegram, and videos if available.
  • the notification from the app is not very alarming by default in most cases (very small sound)
  • I made a simple alarm device with esphome and a buzzer, and it works well with HA automation (i can notice the beep sound even when i'm sleeping)
  • with the app, you can change the configuration, but you cannot change it automatically (i'd like to increase the sensitivity of motion or human detection at night, but decrease it during daytime).

@roleoroleo
Copy link
Owner

"Home and Away" feature in the app and privacy option are very different.
AFAIK the 1st feature switches off all detections (notifications).
But the cam still working normally and continues to communicate with the cloud.
I'm not completely sure because I have not been able to identify the message used when you change the mode (the message sent from the app to the cam, if it exists). Maybe it's only a cloud feature, the cloud receives notifications but it doesn't route them to the app.

Privacy is a option that I added to switch off all stream/pictures features related to the hack.
So it kills rtsp server, snapshots and records. But it doesn't stop the stream from going to the cloud.

If you want to use the "Home and Away" feature by Yi, I have to detect this message and I don't know if it's possible.
Otherwise, I could send many messages, one for each dection to enable/disable them.
Or other possibilities like stop mqtt notification service (only ha side, not yi side).
Or...
I accept advice.

@trombik
Copy link
Contributor Author

trombik commented Nov 29, 2022

well, I do not need exactly same feature as "Home and Away" implements. I need to configure settings from HA. they would be building blocks to implements whatever feature users need.

@roleoroleo
Copy link
Owner

What switches do you need?
I could add to the integration the switches I implemented in the "Camera Settings" page:

  • Switch on/off the camera
  • Save video when a motion is detected
  • AI Human Detection
  • Face Detection
  • Motion Tracking sensor
  • Sound Detection
  • Status led
  • IR led
  • Rotate

@trombik
Copy link
Contributor Author

trombik commented Nov 30, 2022

@roleoroleo the list sounds great.

@roleoroleo
Copy link
Owner

Do you want to try this beta?
yi_hack_switches.tar.gz

The only problem is that when you change the configuration on the app, HA takes a long time to update.

@trombik
Copy link
Contributor Author

trombik commented Dec 2, 2022

@roleoroleo I will.

would you create a branch for that archive and push to GitHub? that would help others to understand the code.

@roleoroleo
Copy link
Owner

@trombik
Copy link
Contributor Author

trombik commented Dec 15, 2022

@roleoroleo it seems to work (i haven't tested all the switches). let me try to improve the diff (i need an input select to change the sensitivity of human detection) .

another reason why you should not use the yi app; the app failed to notify when human is detected sometimes while you can see the events in HA.

Copy link

github-actions bot commented Apr 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@trombik @roleoroleo and others