yi-hack_ha_integration
yi-hack_ha_integration copied to clipboard
Dome U Pro - Switch to enable / disable AI Human Detection and Face Detection
Hi, Would it be possible to provide the switches to activate / deactivate the AI Human Detection and Face Detection control present on the YI app for the U Pro Dome cam?
Thank you
I need to find a solution here https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/210 before.
Hi @roleoroleo
this is the data that is detected when I press AI human detection from the YIhome app
AI Humand Detect OFF IPC message. Len: 20. Status: No error information! Parsing message. 01 00 00 00 08 00 00 00 3c 10 01 00 04 00 00 00 00 00 00 00
AI Humand Detect ON IPC message. Len: 20. Status: No error information! Parsing message. 01 00 00 00 08 00 00 00 3c 10 01 00 04 00 00 00 01 00 00 00
Thanks
Ok, now try to send these messages.
1 - Save the binary code (20 bytes) into a file (use hxd if you are a windows user).
~~2 - Use the command ipc_cmd -x file.bin
~~
2 - Use the command ipc_cmd -f file.bin
3 - Refresh the app and check if the switch is changed.
ipc_cmd -x file.bin
Hi @roleoroleo
I installed HxD and pasted the code "01 00 00 00 08 00 00 00 3c 10 01 00 04 00 00 00 01 00 00 00" in a new file. Saving the AI.bin file, I saw that it takes up 20 bytes.
I copied the file to the root of the MicroSd
Through terminal I gave the command: killall ipc_multiplexer / tmp / sd / yi-hack / bin / ipc_cmd -x AI.bin
but the switch inside the YIhome app doesn't change
![Schermata 2021-07-07 alle 17 24 34](https://user-images.githubusercontent.com/63554131/124787756-0b4af300-df49-11eb-9d15-d4f5270b7b09.png)
![Schermata 2021-07-07 alle 17 24 51](https://user-images.githubusercontent.com/63554131/124787883-26b5fe00-df49-11eb-8d0b-3ba1cd2974d6.png)
Sorry, use -f parameter. -x is another feature.
Sorry, use -f parameter. -x is another feature.
@roleoroleo Good morning, thanks, i tried but i must have made a mistake using HxD (i had never used it).
The following error is returned with the - f command: killall ipc_multiplexer /tmp/sd/yi-hack/bin/ipc_cmd -f AI.bin Error opening file AI.bin
Opening the AI.bin file whit HxD (which I saved by manually adding the .bin extension), I see this:
Try to add the absolute path to the AI.bin The content of the file seems to be ok.
Try to add the absolute path to the AI.bin The content of the file seems to be ok.
Hi, The absolute path should be AI.bin, I put it in the root of the microSD. Or create a temporary file inside the tmp / sd folder?
It's not important where you copy the file.
If it's in the root of the microSD try:
/tmp/sd/yi-hack/bin/ipc_cmd -f /tmp/sd/AI.bin
It's not important where you copy the file. If it's in the root of the microSD try:
/tmp/sd/yi-hack/bin/ipc_cmd -f /tmp/sd/AI.bin
GREAT @roleoroleo
It works! AI.bin file manages to activate human detection in the official YI app!
After lunch I also try to create the file to deactivate it and I inform you.
Thanks again :-)
Hi @roleoroleo The code works to both activate and deactivate the AI Human Detect:
AI Human Detect ON: 01 00 00 00 08 00 00 00 3C 10 01 00 04 00 00 00 01 00 00 00
AI Human Detect OFF: 01 00 00 00 08 00 00 00 3C 10 01 00 04 00 00 00 00 00 00 00
This code enable the AI Face Detection:
Face detect ON 01 00 00 00 08 00 00 00 3d 10 01 00 04 00 00 00 01 00 00 00
Face detect OFF 01 00 00 00 08 00 00 00 3d 10 01 00 04 00 00 00 00 00 00 00
Would it be possible to create the switch from Home Assistant?
I need to add them to the fw before to add to ha.
I need to add them to the fw before to add to ha.
I look forward to! Thank you
I need to add them to the fw before to add to ha.
Hi @roleoroleo , maybe you will have to insert only face detection in the firmware because from further tests, I was able to ascertain that already currently, by modifying the "AI Human Detection" parameter from your web page YIHACK (camera setting), the YIhome app receives the command and synchronizes it. This only happens in one sense, WEBpage YIHACS> YIhome app and not vice versa. (Maybe integrating it into the firmware will be able to sync it both ways?)
Having already the AI Human Detection sensor in your WebPage, is it already possible to have this switch in Home Assistant or can you tell me how to create it manually?
Thanks
maybe you will have to insert only face detection in the firmware because from further tests, I was able to ascertain that already currently, by modifying the "AI Human Detection" parameter from your web page YIHACK (camera setting), the YIhome app receives the command and synchronizes it.
Ok.
This only happens in one sense, WEBpage YIHACS> YIhome app and not vice versa. (Maybe integrating it into the firmware will be able to sync it both ways?)
This is normal and I can't fix it at the moment.
Having already the AI Human Detection sensor in your WebPage, is it already possible to have this switch in Home Assistant or can you tell me how to create it manually?
Create a switch with a http request like this:
http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=yes
http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=no
maybe you will have to insert only face detection in the firmware because from further tests, I was able to ascertain that already currently, by modifying the "AI Human Detection" parameter from your web page YIHACK (camera setting), the YIhome app receives the command and synchronizes it.
Ok.
This only happens in one sense, WEBpage YIHACS> YIhome app and not vice versa. (Maybe integrating it into the firmware will be able to sync it both ways?)
This is normal and I can't fix it at the moment.
Having already the AI Human Detection sensor in your WebPage, is it already possible to have this switch in Home Assistant or can you tell me how to create it manually?
Create a switch with a http request like this:
http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=yes http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=no
THANK YOU!
I try to create a switch using restful
Create a switch with a http request like this:
http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=yes http://IP-CAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=no
Hi @roleoroleo ... sorry again, i was trying to make a switch with http, but it doesn't seem to work. If you managed to do this, could you fix my code please?
switch:
-
platform: rest resource: http://IPCAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=yes name: yi_switch_ai_human_detection_on username: "xxx" password: "xxx"
-
platform: rest resource: http://IPCAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=no name: yi_switch_ai_human_detection_off username: "xxx" password: "xxx"
-
platform: rest name: "yiswitchai" resource: http://IPCAM:8080/cgi-bin/camera_settings.sh?ai_human_detection body_on: "yes" body_off: "no" username: "xxx" password: "xxx"
Thanks in advance
Try a command line switch with curl. This service is not really rest.
Try a command line switch with curl. This service is not really rest.
Ok, I try
Try a command line switch with curl. This service is not really rest.
Hi @roleoroleo I have managed to create a switch, but I have seen that it does not always work as well as the switches you have directly integrated.
I believe, for everyone's sake, that you will also have to integrate the AI Human Detect switch directly into the integration when you update the firmware :-)
The best code of all the tests turned out this, if it were to be useful to someone:
shell_command: switch_1_on: curl -k "http://IPCAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=yes" switch_1_off: curl -k "http://IPCAM:8080/cgi-bin/camera_settings.sh?ai_human_detection=no"
switch:
- platform: template switches: ipcam_ai_switch: turn_on: service: shell_command.switch_1_on turn_off: service: shell_command.switch_1_off
Hi @roleoroleo I don't know where it is right to make the request, but in order not to let this request die, I only propose the link with the request made directly on yi-hack-Allwinner-v2 :-)
https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/210#issuecomment-911727758
https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/209#issuecomment-911742216
THANK YOU!!!
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.