Skip to content

Commit

Permalink
Update amcrest2mqtt.py
Browse files Browse the repository at this point in the history
JSON structure seems to have changed in latest firmware. Updated the row 426 to use right json path for human detection.
  • Loading branch information
carefulcomputer committed Oct 30, 2022
1 parent 9917b41 commit 013e138
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/amcrest2mqtt.py
Expand Up @@ -423,7 +423,7 @@ async def main():
if (is_ad110 and code == "ProfileAlarmTransmit") or (code == "VideoMotion" and not is_ad110):
motion_payload = "on" if payload["action"] == "Start" else "off"
mqtt_publish(topics["motion"], motion_payload)
elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
elif code == "CrossRegionDetection" and payload["data"]["Object"]["ObjectType"] == "Human":
human_payload = "on" if payload["action"] == "Start" else "off"
mqtt_publish(topics["human"], human_payload)
elif code == "_DoTalkAction_":
Expand Down

0 comments on commit 013e138

Please sign in to comment.