twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
391 stars 78 forks source link

Doesnt fully support Arlo Baby #4

Closed collse closed 5 years ago

collse commented 5 years ago

I have installed it and it seems to work well except for the Arlo Baby Cam - it seems to pull a few entities though:

binary_sensor.aarlo_motion_nursery | off | attribution: Data provided by arlo.netgear.com brand: Netgear Arlo friendly_name: Motion Nursery device_class: motion

camera.aarlo_nursery | unknown | access_token: [removed] model_name: ABC1000 brand: Netgear Arlo battery_level: 100 signal_strength: 3 unseen_videos: 5447 attribution: Data provided by arlo.netgear.com friendly_name: Nursery entity_picture: /api/camera_proxy/camera.aarlo_nursery?token=[removed] supported_features: 0

sensor.aarlo_battery_level_nursery | unknown | attribution: Data provided by arlo.netgear.com brand: Netgear Arlo friendly_name: Battery Level Nursery model: ABC1000 unit_of_measurement: % icon: mdi:battery-50

sensor.aarlo_captured_today_nursery | 4 | attribution: Data provided by arlo.netgear.com brand: Netgear Arlo friendly_name: Captured Today Nursery model: ABC1000 icon: mdi:file-video

sensor.aarlo_last_nursery | 2019-02-11 08:41:59 | attribution: Data provided by arlo.netgear.com brand: Netgear Arlo friendly_name: Last Nursery model: ABC1000 icon: mdi:run-fast

sensor.aarlo_signal_strength_nursery | unknown | attribution: Data provided by arlo.netgear.com brand: Netgear Arlo friendly_name: Signal Strength Nursery model: ABC1000 icon: mdi:signal

I also no longer get a separate alarm_panel for the Arlo Baby as previously

I installed this in VENV

source /srv/homeassistant/bin/activate
pip uninstall pyarlo
pip uninstall sseclient-py
pip install py-0.3.tgz

config as per examples - at the moment I excluded the monitored conditions to see if its picks the others up from the Arlo Baby

/// hass_aarlo.yaml
aarlo:
  username: !secret arlo_hass
  password: !secret arlo_pass

camera:
  - platform: aarlo
    ffmpeg_arguments: '-pred 1 -q:v 2'

alarm_control_panel:
  - platform: aarlo
    home_mode_name: Home
    away_mode_name: Armed

binary_sensor:
  - platform: aarlo
    monitored_conditions:
    - motion
    - sound
    - ding

sensor:
  - platform: aarlo
#    monitored_conditions:
#    - last_capture
#    - total_cameras
#    - battery_level
#    - captured_today
#    - signal_strength 
twrecked commented 5 years ago

Noted. The base station is a simple fix. The monitoring is more complicated - the code has to pick apart some binary data - so I'll need to be more careful bringing that across.

twrecked commented 5 years ago

Can you try now? I added the code back into create the arlo base for the baby cam.

I added some experimental code for the humidity, temperature and air quality but it's a bit of a 'leap of faith'. The original pyarlo decoded a history log but the new code just checks for real time updates the same way the battery level works.

If the temperature/humidity/air quality doesn't work I'll look to get the pyarlo code in later this week.

danieledwardgeorgehitchcock commented 5 years ago

@twrecked Hi Steve,

I have just tried using your latest version with my Arlo Baby and temperature, humidity and air quality are coming back as unknown. Also, there is no Sound binary sensor created for the Arlo Baby which caused some confusion when adding the custom card to my Lovelace instance. The camera definitely supports Sound as an activation source... As for the control panel, I am now able to add that to my HomeAssistant instance!

Thanks,

Dan

twrecked commented 5 years ago

The sound was because I didn't add the baby arlo as having that capability. Should be fixed now.

I'm going to have to port the history code from pyarlo for temp/humidity... which might take a day or two.

danieledwardgeorgehitchcock commented 5 years ago

Sound binary sensor confirmed as working.

Thanks!

If you need any raw dumps of Arlo Baby activity, I am happy to share!

collse commented 5 years ago

just downloaded and installed - as previously mentioned some sensors show unknown - sound is however working on the Baby ...

twrecked commented 5 years ago

I've just created a branch - baby-arlo - that will possibly (hopefully) support baby arlo ambient sensors. The code is ported from pyarlo but modified to make it all happen in the background. It's here:

https://github.com/twrecked/hass-aarlo/tree/baby-arlo

@danieledwardgeorgehitchcock if this doesn't work I'll definitely take you up on that packet dump offer!

collse commented 5 years ago

@twrecked just installed the code but same results - what do you need? regular pcap is obviously encrypted with TLS so there is nothing to see - SSL decryption breaks the connection completely ...

twrecked commented 5 years ago

Thanks for trying and appreciate your patience. We can turn on event stream dumping for a start, add packet_dump to your configuration.yaml.

aarlo:
  username: !secret arlo_username
  password: !secret arlo_password
  packet_dump: True

This will output all the event packets received into /config/.aarlo/packets.dump. /config should be where configuration.yaml is. Restart HA and you'll see all sorts of packets arrive, for example, motion detection looks like:

{ 'action': 'is',
  'from': 'XXXXXXXXXXXXX',
  'properties': {'motionDetected': True},
  'resource': 'cameras/XXXXXXXXXXXXX',
  'transId': 'XXXXXXXXXXXXX!4def0e15!1550696029077'}

What I'm looking for is any packet mentioning ambientSensors in the resource field but this packet is what I'm really interested in. I try getting this data from my cameras and they just come back with syntax errors.

Later tonight I'll tweak the code to dump outgoing packets.

twrecked commented 5 years ago

@collse Actually, can you update and try again. I don't think I was noticing the ambient data packet correctly.

collse commented 5 years ago

@twrecked we are go - working now ... awesome work! much appreciated. Can be merged!

twrecked commented 5 years ago

That's excellent news and thanks for the update!

collse commented 5 years ago

No mate thank you for addressing the issues!!