Android IP Webcam as a camera plus sensors!

image
Click open sensor graph


type amount of trigger for motion
click motion amount, reported - done :slight_smile:

@keithh666 even though I enabled motion detection within the app when going to the website it doesn’t give me any data. Running Android IP Cam on a Fire HD 8.

Not sure what i did but i’m now getting sensor data. Thanks for your help.

enable sensor log

Hey, does anyone else have a problem where the sensors off of the IP webcam will just stop? It seems to happen to all of my sensors at once. I’m running Hassio, and a restart of Hassio will always fix the problem and the sensor will update appropriately for a time. But sometimes it’s only like a day. I upgraded to 0.65.4 yesterday and it’s already stopped on me. Here’s a picture to show what it looks like. Not sure where else to look to try and fix it.

And here is my code:

android_ip_webcam:
  - host: !secret webcam_ip
    name: Webcam
    username: !secret camname_secret
    password: !secret campass_secret
    sensors:
      - audio_connections
      - battery_level
      - battery_temp
      - battery_voltage
      - light
      - motion
      - pressure
    switches:
      - exposure_lock
      - ffc
      - focus
      - gps_active
      - night_vision
      - overlay
      - torch
      - whitebalance_lock
      - video_recording

Wanted to make a security camera automation with telegram. after android_ip_webcam havent implemented the motion detection (see HERE )
i tryed it with the rest binary sensor… but:

Error parsing value: 'value_json' is undefined (value: , template: {{ value_json.motion_active.data[0][1][0] | round(0) }})

Ideas?

can you tell me how to take a snapshot? specifically when motion sensor is triggered

3 Likes

I am trying to set up a “Crossbar Cam” to take slow motion videos of pole vaulters going over the cross bar. I’m trying to use IP Webcam to do that but am having some issues with lag (it doesn’t start soon enough when a vaulter enters the frame), FPS (I want to use my Samsung Galaxy 9 at 240 fps), and consistency (sometimes it appears to record and other times it doesn’t). I’m looking for someone who can set this up for me. Any Suggestions?!!

Does anyone know a way to display http://xx.xx.xx.xx:8080/photo.jpg on the frontend in a picture card but not update until an automation is triggered similar to the ones for the telegram notification automation?

Not sure if anyone is still listening to this forum, but I have been trying to get the Android IP Webcam app to work.
I mostly want it just for the motion sensor (want to keep the screen of my kitchen tablet off unless motion is sensed) and the sensors are showing up (motion, lux, battery and proximity) but are showing up as unavailable in my Hassio setup. It says in the component writeup that logging must be enabled or the sensors will show up as unavailable. I’ve enabled logging, restarted the tablet, restarted the AIPWcam app, restarted Hassio to no avail.

My Hassio server is only available on my local network. Below is my yaml config and the corresponding error log:

> android_ip_webcam:
>   - host: http://10.0.1.196:8081
>     port: 8081
>     username: !secret IP_WEBCAM_USERNAME
>     password: !secret IP_WEBCAM_PASSWORD
>     scan_interval: 5
>     sensors:
>       - battery_level
>       - light
>       - motion
>       - proximity
> 
> binary_sensor:
>   - platform: rest
>     name: Neutab Motion
>     sensor_class: motion
>     resource: http://10.0.1.196:8081/sensors.json?sense=motion_active
>     value_template: '{{
>         value_json.motion_active.data[0][1][0]|round(0) }}'

Failed to communicate with IP Webcam: Cannot connect to host http:80 ssl:None [Name does not resolve]

I also added the binary sensor for the motion sensor (shown in yaml config).

Notice in the error log the host it’s trying to connect to…not sure why it’s showing https:80 when it has the full IP address in the yaml??

I’m using the free edition of the AIPWcam app (if that matters…not sure) but would happily pay for it if I can get this to work.

You may want to check to make sure the AIP is set up correctly first, enter this in your browser:
http://10.0.1.196:8081/sensors.json?sense=motion_active

You should get something like this back:
{“motion_active”:{“unit”:"",“data”:[[1553906320600,[1.0]]]}}

Thank you for your quick response.
When entering the mention IP address into a browser (after entering login credentials) I’m receiving the correct response.

Any other thoughts?

It may also be worth noting that the binary sensor shows up as well but only shows “Off” as it’s state even while dancing in front of the tablet where I can see myself in the image of the app

So, maybe something with hass.io then.
I don’t have hass.io, but when I debug AIP sensors, I used this to make sure HA is actually ‘seeing’ AIP:

sensor.yaml:

  - platform: rest
    name: Test AIP Motion
    resource: http://AIP_IP:port/sensors.json?sense=motion_active
    value_template: '{{ value_json.motion_active.data }}'

It should give you the same info after data: as in the browser:
[[1553906320600,[1.0]]]
The long number in front should change periodically. Make sure when testing, the tablet screen is on and AIP on top.

BTW, can you see that AIP camera in HA?

I’ll try this out today.

I can see the camera, but it says Image Not Available

I’m starting to think it may be the tablet itself being off brand and older Android.
NeuTab i7 running 7.1.2

Thanks. I’ll let you know how the test sensor works

So still getting the sensors and camera showing up as unavailable.
Also noticed the following errors that I hadn’t noticed before.

Failed to communicate with IP Webcam: Cannot connect to host http:80 ssl:None [Name does not resolve]

Error getting new camera image: Cannot connect to host http:80 ssl:None [Name does not resolve]

Error fetching data: <PreparedRequest [GET]> from http://10.0.1.196:8081/sensors.json?sense=motion_active failed with HTTPConnectionPool(host=‘10.0.1.196’, port=8081): Max retries exceeded with url: /sensors.json?sense=motion_active (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x6e12f470>: Failed to establish a new connection: [Errno 111] Connection refused’))

These errors are showing up pretty much constantly.

Seems like this may be an issue on the tablet side. Hassio keeps trying but is being refused. No means No! haha

Is it possible to get the audio streamed as well? I mean, if I click on the camera entity on the HomeAssistant UI, I can see the video, but I don’t hear the video of the device.

I tried using this for a similar purpose a couple months back, and the issue I ran into was that the app had to be in the foreground with the screen on for this to work.

So I worked on this a bit more this weekend and it seems like this app isn’t going to work for my hardware. Or I just don’t have the time to dive deeper into it at the moment.
I might try the motion detector app before I just by a zwave multi sensor. It says it may not work on my device, but if it does, then I only had to spend $3 instead of $30. I’ve seen a few other posts saying they are using that app for this use case.

Thanks for the help, JTPublic

Sorry, AIP didn’t work for you.
That’s hit-or-miss sometimes.

Has anyone written a simple step-by-step tutorial of how to use an old Android phone with Home Assistant?

1 Like