{"id":26334358,"url":"https://github.com/rasmusrynell/ax-devil-mqtt","last_synced_at":"2025-07-07T07:33:46.188Z","repository":{"id":282539739,"uuid":"933893095","full_name":"RasmusRynell/ax-devil-mqtt","owner":"RasmusRynell","description":"Python package for working with Axis devices MQTT functionality.","archived":false,"fork":false,"pushed_at":"2025-06-25T19:50:41.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T20:34:43.648Z","etag":null,"topics":["api","ax-devil","axis","axis-communications","axis-scene-description","axis-scene-metadata","camera","cli","library","metadata","mqtt","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RasmusRynell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-16T23:05:13.000Z","updated_at":"2025-06-25T19:50:45.000Z","dependencies_parsed_at":"2025-06-25T20:37:34.541Z","dependency_job_id":null,"html_url":"https://github.com/RasmusRynell/ax-devil-mqtt","commit_stats":null,"previous_names":["rasmusrynell/ax-devil-mqtt"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RasmusRynell/ax-devil-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusRynell%2Fax-devil-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusRynell%2Fax-devil-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusRynell%2Fax-devil-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusRynell%2Fax-devil-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RasmusRynell","download_url":"https://codeload.github.com/RasmusRynell/ax-devil-mqtt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RasmusRynell%2Fax-devil-mqtt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264034854,"owners_count":23547290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ax-devil","axis","axis-communications","axis-scene-description","axis-scene-metadata","camera","cli","library","metadata","mqtt","python","python3"],"created_at":"2025-03-16T00:18:27.750Z","updated_at":"2025-07-07T07:33:46.178Z","avatar_url":"https://github.com/RasmusRynell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ax-devil-mqtt\n\n\u003cdiv align=\"center\"\u003e\n\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Type Hints](https://img.shields.io/badge/Type%20Hints-Strict-brightgreen.svg)](https://www.python.org/dev/peps/pep-0484/)\n\nPython package for retrieving analytics data from Axis devices over MQTT.\n\nSee also: [ax-devil-device-api](https://github.com/rasmusrynell/ax-devil-device-api) for device API integration.\n\n\u003c/div\u003e\n\n---\n\n## 📋 Contents\n\n- [Feature Overview](#-feature-overview)\n- [Quick Start](#-quick-start)\n- [Usage Examples](#-usage-examples)\n- [Disclaimer](#-disclaimer)\n- [License](#-license)\n\n---\n\n## 🔍 Feature Overview\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eFeature\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth align=\"center\"\u003ePython API\u003c/th\u003e\n      \u003cth align=\"center\"\u003eCLI Tool\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e🔌 Device Setup\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eConfigure Axis devices for analytics MQTT publishing\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ccode\u003eRawMQTTManager\u003c/code\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"#mqtt-connection\"\u003eax-devil-mqtt device monitor\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e📊 Analytics Streaming\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eStream analytics data from Axis devices with automated setup\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ccode\u003eAnalyticsManager\u003c/code\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"#analytics-streaming\"\u003eax-devil-mqtt device monitor\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e💾 Data Recording\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eRecord analytics MQTT data for later replay and analysis\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ccode\u003emanager.start(recording_file)\u003c/code\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"#data-recording\"\u003eax-devil-mqtt device monitor --record\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cb\u003e⏯️ Replay\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eReplay recorded MQTT data for testing and development\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ccode\u003eReplayManager\u003c/code\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"#data-replay\"\u003eax-devil-mqtt replay\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n---\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\npip install ax-devil-mqtt\n```\n\n### Environment Variables\nFor an easier experience, you can set the following environment variables:\n```bash\nexport AX_DEVIL_TARGET_ADDR=\u003cdevice-ip\u003e\nexport AX_DEVIL_TARGET_USER=\u003cusername\u003e\nexport AX_DEVIL_TARGET_PASS=\u003cpassword\u003e\nexport AX_DEVIL_USAGE_CLI=\"safe\" # Set to \"unsafe\" to skip SSL certificate verification for CLI calls\n```\n\n---\n\n## 💻 Usage Examples\n\n### Python API Usage\n\n🔌 MQTT Connection and Analytics Streaming\n\n```python\nimport time\nfrom ax_devil_mqtt import AnalyticsManager\nfrom ax_devil_mqtt.core.types import Message\nfrom ax_devil_device_api import DeviceConfig\n\n# Configure device\ndevice_config = DeviceConfig.http(\n    host=\"192.168.1.200\",\n    username=\"root\",\n    password=\"pass\"\n)\n\ndef message_callback(message: Message):\n    print(f\"Topic: {message.topic}\")\n    print(f\"Payload: {message.payload}\")\n    print(f\"Timestamp: {message.timestamp}\")\n\n# Create analytics manager\nmanager = AnalyticsManager(\n    broker_host=\"192.168.1.100\",\n    broker_port=1883,\n    device_config=device_config,\n    analytics_data_source_key=\"com.axis.analytics_scene_description.v0.beta#1\",\n    message_callback=message_callback\n)\n\nmanager.start()\n# or manager.start(recording_file=\"recordings/some_file_name.jsonl\")\ntime.sleep(10)\nmanager.stop()\n```\n\n⏯️ Replay\n\n```python\nimport time\nfrom ax_devil_mqtt import ReplayManager\nfrom ax_devil_mqtt.core.types import Message, ReplayStats\n\ndef message_callback(message: Message):\n    print(f\"Topic: {message.topic}\")\n    print(f\"Payload: {message.payload}\")\n    print(f\"Timestamp: {message.timestamp}\")\n\ndef on_replay_complete(stats: ReplayStats):\n    print(f\"Replay completed!\")\n    print(f\"  Total messages: {stats.message_count}\")\n    print(f\"  Average drift: {stats.avg_drift:.2f}ms\")\n    print(f\"  Max drift: {stats.max_drift:.2f}ms\")\n\n# Create a replay manager\nmanager = ReplayManager(\n    recording_file=\"recordings/device_recording.jsonl\",\n    message_callback=message_callback,\n    on_replay_complete=on_replay_complete\n)\n\n# Start the manager\nmanager.start()\ntime.sleep(10)\nmanager.stop()\n```\n\n### CLI Usage Examples\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003cb\u003e🔍 Discover Available Analytics Streams\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\nUsing ax-devil-device-api:\n```bash\nax-devil-device-api-analytics-mqtt sources\n```\n\nOr discover and list with ax-devil-mqtt:\n```bash\nax-devil-mqtt device list-sources --device-ip \u003cdevice-ip\u003e --username \u003cusername\u003e --password \u003cpassword\u003e\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003e\u003ca name=\"mqtt-connection\"\u003e\u003c/a\u003e\u003ca name=\"analytics-streaming\"\u003e\u003c/a\u003e\u003cb\u003e📊 Streaming Analytics Data Source\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nax-devil-mqtt device monitor \\\n    --device-ip \u003cdevice-ip\u003e \\\n    --username \u003cusername\u003e \\\n    --password \u003cpassword\u003e \\\n    --broker \u003cbroker-ip\u003e \\\n    --port 1883 \\\n    --stream \"com.axis.analytics_scene_description.v0.beta#1\" \\\n    --duration 3600\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ca name=\"data-recording\"\u003e\u003c/a\u003e\u003cb\u003e💾 Recording MQTT Data\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nax-devil-mqtt device monitor \\\n    --device-ip \u003cdevice-ip\u003e \\\n    --username \u003cusername\u003e \\\n    --password \u003cpassword\u003e \\\n    --broker \u003cbroker-ip\u003e \\\n    --port 1883 \\\n    --stream \"com.axis.analytics_scene_description.v0.beta#1\" \\\n    --record \\\n    --duration 3600\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ca name=\"data-replay\"\u003e\u003c/a\u003e\u003cb\u003e⏯️ Replaying Recorded Data\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nax-devil-mqtt replay recordings/device_recording.jsonl\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n### Example Scripts\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAnalytics Monitor Example\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\npython src/ax_devil_mqtt/examples/analytics_monitor.py --host \u003cbroker-ip\u003e\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eReplay Example\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\npython src/ax_devil_mqtt/examples/replay.py recordings/device_recording.jsonl\n```\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003e **Note:** For more examples, check the [examples directory](src/ax_devil_mqtt/examples) in the source code.\n\n---\n\n## ⚠️ Disclaimer\n\nThis project is an independent, community-driven implementation and is **not** affiliated with or endorsed by Axis Communications AB. For official APIs and development resources, please refer to [Axis Developer Community](https://www.axis.com/en-us/developer).\n\n## 📄 License\n\nMIT License - See [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasmusrynell%2Fax-devil-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasmusrynell%2Fax-devil-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasmusrynell%2Fax-devil-mqtt/lists"}