Closed Dimoon12 closed 2 years ago
It’s solved in a closed issue.
So it seems that there is different model types for model g2h. In Integration used code 'lumi.camera.gwagl02' instead of 'lumi.camera.gwag03',
I added 'lumi.camera.gwag03' to core/const.py and core/utils.py in every place near to 'lumi.camera.gwagl02' const.p:
SIGMASTAR_MODELS = [
'lumi.gateway.aqcn02',
'lumi.camera.gwagl02',
'lumi.camera.gwag03',
'lumi.camera.gwpagl01',
'lumi.camera.agl001',
'lumi.gateway.acn004'
]
utils.py
DEVICES = [{
'lumi.gateway.acn01': ["Aqara", "Gateway M1S", "ZHWG15LM"], # tested
'lumi.aircondition.acn05': ["Aqara", "AirCondition P3", "KTBL12LM"], # xStars tested
# 'lumi.aircondition.acn04': ["Aqara", "AirCondition P3", "KTBL12LM"],
# 'lumi.acpartner.acn04': ["Aqara", "AirCondition P3", "KTBL12LM"],
'lumi.gateway.aeu01': ["Aqara", "Gateway M1S", "HM1S-G01"],
# 'lumi.gateway.iragl01': ["Aqara", "Gateway M2", "ZHWG12LM"],
# 'lumi.gateway.iragl7': ["Aqara", "Gateway M2", "HM2-G01"],
'lumi.gateway.iragl5': ["Aqara", "Gateway M2", "ZHWG12LM"], # tested
'lumi.gateway.sacn01': ["Aqara", "Smart Hub H1", "QBCZWG11LM"],
'lumi.gateway.aqcn02': ["Aqara", "Hub E1", "ZHWG16LM"], # tested
'lumi.camera.gwagl02': ["Aqara", "Camera Hub G2H", "ZNSXJ12LM"], # tested
'lumi.camera.gwag03': ["Aqara", "Camera Hub G2H", "ZNSXJ12LM"], # tested
'lumi.camera.gwpagl01': ["Aqara", "Camera Hub G3", "ZNSXJ13LM"], # tested
'lumi.camera.gwpgl1': ["Aqara", "Camera Hub G3", "CH-H03"],
'lumi.camera.agl001': ["Aqara", "Camera Hub G2H Pro", "ZNSXJ15LM"],
'params': [
@staticmethod
def gateway_alarm_mode_supported(model: str) -> Optional[bool]:
""" return the gateway alarm mode supported """
# basic_cli not support
if model not in ('lumi.camera.gwag03','lumi.camera.gwagl02', 'lumi.camera.gwpagl01'):
return True
return False
@staticmethod
def gateway_is_aiot_only(model: str) -> Optional[bool]:
""" return the gateway is aiot only """
if model in ('lumi.camera.gwag03','lumi.camera.gwagl02', 'lumi.gateway.iragl5',
'lumi.gateway.iragl7', 'lumi.gateway.iragl01',
'lumi.gateway.sacn01', 'lumi.camera.gwpagl01',
'lumi.camera.agl001'):
return True
return False
@staticmethod
def get_info_store_path(model: str) -> Optional[str]:
""" return the path of zigbee info """
if model in ('lumi.camera.gwagl02','lumi.camera.gwag03'):
return '/mnt/config'
return '/data'
Also in login details in core/shell.py I changed
self.run_command("admin")
if self._password:
self.read_until(b"Password: ", timeout=1)
self.write(self._password.encode() + b"\n")
self.run_command("stty -echo")
self.read_until(b"/ # ", timeout=10)
to
self.run_command("root")
if self._password:
self.read_until(b"Password: ", timeout=1)
self.write(self._password.encode() + b"\n")
self.run_command("stty -echo")
self.read_until(b"/ # ", timeout=10)
After this go to telnet g2h
and run
mkdir /data/bin
cd /data/bin
wget -O /tmp/curl "http://master.dl.sourceforge.net/project/aqarahub/binutils/curl?viasf=1"; chmod +x /tmp/curl
/tmp/curl -s -k -L -o /data/bin/mosquitto https://raw.githubusercontent.com/niceboygithub/AqaraCameraHubfw/main/binutils/mosquitto; chmod a+x /data/bin/mosquitto
and than
rm /tmp/out/mosquitto
killall mosquitto
/data/bin/mosquitto -d
don't reboot camera because initial script on it will replace the public mosquitto (/data/bin/mosquitto -d) to predifined one (/tmp/out/mosquitto)
For fix boot modify /etc/normal.xml
instead:
<process name="/tmp/out/mosquitto">
<arg desc="foreground run"></arg>
put
<process name="/data/bin/mosquitto">
<arg desc="foreground run">-d</arg>
Some info from telnet. I don't know if it is normal.
mosquitto
1658305446: mosquitto version 1.6.10 starting
1658305446: Using default config.
1658305446: Opening ipv4 listen socket on port 1883.
1658305446: Binding listener to interface "lo".
1658305446: Error: Address already in use
ps | grep mos
142 root 2052 S /data/bin/mosquitto -d
905 root 0 Z [mosquitto]
907 root 1688 S grep mos
Devices work fine
If run mosquito without, it will run /tmp/mosquito first. So it is normal.
HomeAssistant logs:
Mosquitto logs on camera: