Add-on for G3 camera or FP2 sensor
-
only Username/Password Aqara required
- the values in the "config" node will be generated from the username and password if valid
Goal: Replace Post request "Aqara Home" app on HomeAssistant
- note:
- this flow is example and was developed for Aqara G3 camera or FP2 sensor ( lumi1.xxxx )
-
GenerateToken username/password Aqara
thank you Wh1terat
-
Import JSON on Node-Red
-
Enter your values in the "config" node:
Token, AppId, UserId, Lumi1, Area
( require crypto on nodered [#28] )
I have an Aqara Hub G3 camera on HomeAssistant but I can't control it, with the homekit connection I only have the alarm function.
No modification to your device is required.
The FP2 flow queries /app/v1.0/lumi/res/query for the private sleep-monitor
resources exposed by the Aqara Home app:
These sleep-monitor values are only populated when the FP2 is configured in
Sleep Monitoring / bed mode (set_device_mode4 = 9). In other FP2 modes, such
as Zone Detection or Fall Detection, the same resources may be missing or empty.
| Resource | Meaning |
|---|---|
heartrate_value |
Heart rate, bpm |
respiration_rate_value |
Respiratory rate, breaths per minute |
sleep_state |
Sleep phase/state reported by Aqara |
body_movement_value |
Body movement level |
lux |
Illuminance |
device_offline_status |
Device online/offline status |
Known sleep_state values observed from the app/API:
| Value | State |
|---|---|
0 |
Out of bed |
1 |
In bed |
2 |
Fully awake |
3 |
REM sleep |
4 |
Light sleep |
5 |
Deep sleep |
-
add automation every 1 minute:
description: Update Aqara G3 mode: single trigger: - platform: time_pattern minutes: /1 condition: [] action: - service: button.press metadata: {} data: {} target: entity_id: button.camera_g3_logor change inject node:
- Turns the camera into an NGINX-cgi PHP server and much more...:
- HomeKit alarm function HomeAssistant:
-
Live video:
- hack G3 (delete authentication rtsp):
-
Manual downgrade firmware 3.3.4 (post_init.sh enable)
-
Open telnet QR method aQRootG3 (create post_init.sh)
-
Manual update firmware 3.3.9 (post_init.sh enable)
-
Update last firmware from command custom firmware
- hack done! (post_init.sh enable)
-
Add vi /data/scripts/post_init.sh ( from telnet )
killall -9 rtsp && rtsp >/dev/null 2>&1 &killall -9 rtsp && rtsp -a -u 'user' -p 'password' >/dev/null 2>&1 &or you can see rtsp user/pass (change every boot)
from telnet command:
agetprop sys.camera_rtsp_url # agetprop full (list all prop.)rtsp://USER:PASS@192.168.1.4:8554/ch3
rtsp://192.168.1.4:8554/ch3
["360p": "/ch3"] - ["720p": "/ch2"] - ["1296p":"/ch1"]
-
command_line: - sensor: name: aqara_rtsp_telnet command: "apk -q add inetutils-telnet && ( sleep 3; printf 'root\n'; sleep 1; printf 'clear\n'; sleep 1; printf 'agetprop sys.camera_rtsp_url\n'; sleep 1; ) | telnet 192.168.1.4 | sed '1,8d' | sed '$d'" value_template: "{{ value_json['720p'] }}" json_attributes: - 360p - 720p - 1080p - 1296p - hack G3 (delete authentication rtsp):
- Sensor telnet command:
- example "date"
command_line:
- sensor:
name: aqara_test
command: "apk -q add inetutils-telnet && ( sleep 3; printf 'root\n'; sleep 1; printf 'clear\n'; sleep 1; printf 'date\n'; sleep 1; ) | telnet 192.168.1.4 | sed '1,8d' | sed '$d'"
value_template: "{{ value }}"ko-fi.com https://ko-fi.com/davide70304
AqaraG3-armv7-binary AqaraG3 extra commands
AqaraCameraHubfw Firmware
m3u8-HLS-Homeassistant Player m3u,mpd,mp4 playlist
NginxReverse-Homeassistant ReverseProxy on HA
go2rtc RTSP Proxy (HomeKit supported)
WebRTC Card RTSP





