dzVents to read data from MQTT broker

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
sundansx
Posts: 10
Joined: Tuesday 30 May 2017 8:16
Target OS: Windows
Domoticz version:
Contact:

dzVents to read data from MQTT broker

Post by sundansx »

I have an MQTT broker setup and I have setup and "MQTT Client Gateway with LAN interface" setup to listen to topics from an MQTT device (frigate). I am seeing the MQTT messages in the log as:

2022-03-05 00:25:05.876 MQTT: Topic: frigate/events, Message: {"before": {"id": "1646468697.36655-yw8znn", "camera": "backdoor", "frame_time": 1646468699.373544, "snapshot_time": 1646468698.94389, "label": "person", "top_score": 0.76953125, "false_positive": false, "start_time": 1646468697.36655, "end_time": null, "score": 0.53515625, "box": [433, 568, 556, 872], "area": 37392, "region": [64, 88, 872, 896], "stationary": false, "motionless_count": 0, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": true, "has_snapshot": true}, "after": {"id": "1646468697.36655-yw8znn", "camera": "backdoor", "frame_time": 1646468699.373544, "snapshot_time": 1646468698.94389, "label": "person", "top_score": 0.76953125, "false_positive": false, "start_time": 1646468697.36655, "end_time": 1646468704.540655, "score": 0.53515625, "box": [433, 568, 556, 872], "area": 37392, "region": [64, 88, 872, 896], "stationary": false, "motionless_count": 0, "position_changes": 1, "current_zones": [], "entered_zones": [], "has_clip": true, "has_snapshot": true}, "type": "end"}

This message is obviouly a json structure. I want to be able to write a dzVents script to gather that data and process it. I am trying to glue a frigate (AI camera NVR) to domoticz to do some alerts and stuff. btw, frigate is really cool.
I know about node red, but did not want to install another piece of glue if the data is already coming into domotiz. I am not trying to tie this to a domoticz device, just get the data into a script
any ideas?
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzVents to read data from MQTT broker

Post by waltervl »

This MQTT message is not available for Domoticz DzVents. So you have to remove the "MQTT Client Gateway with LAN interface" and rewrite a Python Plugin like zigbee2MQTT or Shelly MQTT or use Node-Red or another external script that transforms MQTT messages into Domoticz API or Python API devices.
Or write a special frigate integration in C++ Source.
Or have the frigate write Domoticz compatible MQTT statements.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest