sdavides / AqaraPOST-Homeassistant

Aqara devices on Homeassistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goal: Replace Post request "Aqara Home" app on HomeAssistant

  • Requirement appid - userid - token value

note: this flow is example and was developed for Aqara Hub G3 camera (CH-H03 lumi.camera.gwpgl1)


Find your value from BurpSuite, replace your value:

appid (XXXXXXAPPIDXXXXXXXXXXX)

userid (XXXXXXUSERID.USERIDXXXXXXXXXXX) (autoconfig "userid" value, enter manual if not work)

token (XXXXXXTOKENXXXXXXXXXXX)

aqara_url ( example EU = rpc-ger.aqara.com )

lumi1.XXXXXXXXXXXX ( lumi1.MACADDRESS )


  • Requirement for find your data on BurpSuite software:

BurpSuite Software PC

“Aqara Home” mod network apk on Android Phone

( https://drive.google.com/file/d/1Wfn_ynyCGvPwldjbbNGvZmYBKj5csuMy/view?usp=sharing )


  • Method 1 RestFul (without NodeRed):

    1. Replace value Aqara_G3_without_nodered.txt

    2. Copy and paste Aqara_G3_without_nodered.txt on configuration.yaml

    3. Restart HomeAssistant


  • Method 2 NodeRed (recommended):

    1. Install NodeRed on HomeAssistant (with "node-red-contrib-config" palette)

    2. Install NodeRed Companion on HomeAssistant

    3. Import flow Aqara_G3_nodered.json

    4. Replace value "config" node

    5. Deploy

Note: access internet from HomeAssistant server (for aqara URL https)



  • Result

immagine immagine



  • Trick for Hub G3:

Alarm function ->

HomeKit device

Warning: the port change every reboot of device.

Scan and find with nmap, replace port into "/config/.storage/core.config_entries"

immagine

Live video ->

go2RTC with WebRTC ( required HomeKit connected )

https://github.com/AlexxIT/go2rtc

https://github.com/AlexxIT/WebRTC

Update: After many problems the best solution for live video:

hack G3:

  • open telnet

  • add post_init.sh:

    #delete auth rtsp

    sleep 40

    killall -9 rtsp

    rtsp >/dev/null 2>&1 &

  • card with webrtc-camera url: rtsp://192.168.1.52:8554/360p /720p /1080p /1296p

or you can see user and pass from agetprop sys.camera_rtsp_url command from telnet:

user=26

pass=83

(change every boot)

~ # agetprop sys.camera_rtsp_url

{"360p":"rtsp://26:83@192.168.1.4:8554/360p","720p":"rtsp://26:83@192.168.1.4:8554/720p","1080p":"rtsp://26:83@192.168.1.4:8554/1080p","1296p":"rtsp://26:83@192.168.1.4:8554/1296p"}

About

Aqara devices on Homeassistant


Languages

Language:Python 55.7%Language:Shell 44.3%