Android IP Webcam. Phone Motion Sensor

Hello, folks.
I’m using my old Android phone with Android IP Webcam setup as one of the home cameras. Works well.

The problem I’m getting is with the motion sensor response time. The graphs in the Android IP Webcam web UI show the response to motion, however, home assistant gets a trigger within (probably) 5s. I set it up using the following from the above link.

# Example configuration.yaml entry
binary_sensor:
  - platform: rest
    name: Garage Motion
    device_class: motion
    resource: http://IP_ADDRESS:PORT/sensors.json?sense=motion_active
    value_template: "{{ value_json.motion_active.data[0][1][0] | round(0) }}"

Any ideas on how to increase the refresh time to make it more real-time?

Thanks in advance.

Im using like this

binary_sensor:
  - platform: template
    sensors:
       tablet_motion:
         friendly_name: Tablet Motion Sensor
         device_class: motion
         value_template >-
           {% if states('sensor.tablet_motion') |int > '350' |int %}
           on
           {% else %}
           off
           {% endif %}

        

350 = my motion trigger. u can test it from ip webcam page then u change like yourself.

Very hard to write from android without copy paste. maybe u need check intent. I try my best. Hopes this help you. Also u can copy paste to devtools → template and play with it

2 Likes

Thanks. This responds alot quicker.
My code:

template:
    #garage motion detect via analog threshold
    - binary_sensor:
        - name: "Garage Motion"
          device_class: motion
          state: >
            {{states('sensor.mimix2_phone_motion') |int > 50}}
2 Likes