Coder Social home page Coder Social logo

Comments (22)

roleoroleo avatar roleoroleo commented on June 16, 2024 2

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

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024 2

I need to add them to the fw before to add to ha.

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024 1

I need to find a solution here
roleoroleo/yi-hack-Allwinner-v2#210
before.

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024 1

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

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024

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.

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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

Schermata 2021-07-07 alle 17 24 51

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024

Sorry, use -f parameter.
-x is another feature.

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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:
Schermata 2021-07-08 alle 10 17 18

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024

Try to add the absolute path to the AI.bin
The content of the file seems to be ok.

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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?

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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 :-)

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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?

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

I need to add them to the fw before to add to ha.

I look forward to!
Thank you

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024

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

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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:

Thanks in advance

from yi-hack_ha_integration.

roleoroleo avatar roleoroleo commented on June 16, 2024

Try a command line switch with curl.
This service is not really rest.

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

Try a command line switch with curl.
This service is not really rest.

Ok, I try

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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

from yi-hack_ha_integration.

SmartM-ui avatar SmartM-ui commented on June 16, 2024

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 :-)

roleoroleo/yi-hack-Allwinner-v2#210 (comment)

roleoroleo/yi-hack-Allwinner-v2#209 (comment)

THANK YOU!!!

from yi-hack_ha_integration.

github-actions avatar github-actions commented on June 16, 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.

from yi-hack_ha_integration.

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.