yi-hack-Allwinner icon indicating copy to clipboard operation
yi-hack-Allwinner copied to clipboard

HA integration

Open roleoroleo opened this issue 3 years ago • 14 comments

Please, take a look at this project:

https://github.com/roleoroleo/yi-hack_ha_integration

roleoroleo avatar Apr 21 '21 15:04 roleoroleo

this is amazing. i had just asked a buddy if he could try and make one as the current way of doing it was a pain in the ass. keep up the good work

pbanj avatar May 03 '21 00:05 pbanj

hmmm seems motion detection isnt working. their status states never seem to change

pbanj avatar May 03 '21 02:05 pbanj

Check if motion detection is on in your yi app and if you configured mqtt parameters. The integration requires mqtt.

roleoroleo avatar May 03 '21 06:05 roleoroleo

Check if motion detection is on in your yi app and if you configured mqtt parameters. The integration requires mqtt.

ah didnt know it needed mqtt. just turned it on and it's working now. one thing i noticed. turning on the ai detection makes it not send anything

pbanj avatar May 03 '21 07:05 pbanj

There is a know issue with ai. And it's not related to the hack.

roleoroleo avatar May 03 '21 08:05 roleoroleo

Hi, before my question, thanks for your amazing work, this integration is aswome for noobs like me. Now my question if you can help me. My camera has ptz support (r30gb with allwinner-v2 0.1.7), but i can't find where to "set" it inside home assistant. Can you give me some help? Thanks.

rickytugapt avatar May 19 '21 21:05 rickytugapt

ptz is a service. You can run it for testing purpose in the "Developer tools" page. If you want to use from lovelace, you have to add a button or something else. For example I use a picture-glance (after creating 4 switches):

camera_image: camera.kitchen
entities:
  - entity: switch.switch_cam_kitchen_left
    icon: 'mdi:arrow-left-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_up
    icon: 'mdi:arrow-up-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_down
    icon: 'mdi:arrow-down-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_right
    icon: 'mdi:arrow-right-bold-circle-outline'
tap_action:
  action: url
  url_path: 'rtsp://192.168.1.200'
title: Kitchen
type: picture-glance

roleoroleo avatar May 20 '21 06:05 roleoroleo

ptz is a service. You can run it for testing purpose in the "Developer tools" page. If you want to use from lovelace, you have to add a button or something else. For example I use a picture-glance (after creating 4 switches):

camera_image: camera.kitchen
entities:
  - entity: switch.switch_cam_kitchen_left
    icon: 'mdi:arrow-left-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_up
    icon: 'mdi:arrow-up-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_down
    icon: 'mdi:arrow-down-bold-circle-outline'
  - entity: switch.switch_cam_kitchen_right
    icon: 'mdi:arrow-right-bold-circle-outline'
tap_action:
  action: url
  url_path: 'rtsp://192.168.1.200'
title: Kitchen
type: picture-glance

That's it :) i didn't realise it was a service. Thank you very much.

rickytugapt avatar May 20 '21 14:05 rickytugapt

Hi again roleoroleo, I was testing it in Developer tools and realised that i can't use a travel time bigger then 1, or it won't move. Do you have any sugestion to implement some kind of presets? Or the only way is completely move to one side then start "counting" the time until the position i want?

rickytugapt avatar May 20 '21 14:05 rickytugapt

I don't know why you can't use a number bigger than 1. The max value is set to 5. Try to send a command from the shell.

ipc_cmd -m right
ipc_cmd -m stop

If it works, try to use the web service.

If I'm not wrong you can create presets using the original app. After you save them, you can call from the hack.

roleoroleo avatar May 20 '21 15:05 roleoroleo

I'm really a noob, i don't know how to send

ipc_cmd -m right ipc_cmd -m stop

I figured how to make a lovelace button to press and make the camera move, but if i set a travel_time bigger then 1 i get the following: image If i use 1 or less works great. But anyway, this isn't really important to me, i can live with that. Can you just point me how to create a switch to use with the picture glance?

Thanks one more time for your patience to a noob like me.

rickytugapt avatar May 20 '21 17:05 rickytugapt

I will check the problem about travel_time.

Try to create a switch with this syntax:

  - platform: template
    switches:
      switch_cam_kitchen_left:
        value_template: "off"
        turn_on:
          service: yi_hack.ptz
          data:
            entity_id: camera.kitchen
            movement: left
            travel_time: 0.3
        turn_off:

roleoroleo avatar May 21 '21 07:05 roleoroleo

Fixed error when travel_time > 1

roleoroleo avatar May 21 '21 10:05 roleoroleo

Updated but I'm getting the same error if travel_time >1. But finally i created the switchs and already have a nice picture glance with ptz.

Thanks a lot for your help :)

rickytugapt avatar May 21 '21 15:05 rickytugapt

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[bot] avatar Apr 05 '24 02:04 github-actions[bot]