From 013e13825496c46f6a33234cf731f6decaee0f2d Mon Sep 17 00:00:00 2001 From: carefulcomputer <3331518+carefulcomputer@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:25:19 -0700 Subject: [PATCH] Update amcrest2mqtt.py JSON structure seems to have changed in latest firmware. Updated the row 426 to use right json path for human detection. --- src/amcrest2mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amcrest2mqtt.py b/src/amcrest2mqtt.py index 31054dd..f664012 100644 --- a/src/amcrest2mqtt.py +++ b/src/amcrest2mqtt.py @@ -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_":