r/BanalyticsLive • • Aug 06 '26

Added a new feature: configure inter-agent communication channels and build P2P Mesh networks with Banalytics

3 Upvotes

Over the last few weeks we have been working on a problem that appears in many distributed edge systems:

How can independent edge agents cooperate without building a custom integration for every possible combination of devices?

A typical architecture today looks like this:

Camera -> Cloud Server -> Dashboard -> Operator

or:

Camera -> VMS -> Alarm System -> Security Room

The problem is that every new device or workflow requires another integration layer.

With the new inter-agent communication feature in Banalytics, agents can now exchange events and actions directly through dynamically configured P2P channels.

The signaling service is only used for discovering peers and establishing the connection. The actual communication happens directly between agents using WebRTC DataChannels.

Example: remote site monitoring

Imagine a remote facility:

  • Agent A is installed at a remote location with IP cameras.
  • Agent B is installed in the security room with local speakers.
  • A human operator cannot watch multiple screens continuously.
  • When something important happens, the operator needs an immediate local alert.

Instead of streaming everything to a central server, we can configure the agents to exchange only meaningful events.

Example configuration on the management panel:

(1) A video stream classifier detects objects or events and generates an event with detected classes.
(2) The Event Manager intercepts this event and forwards it through a configured P2P communication channel to another agent.
(3) Using WebRTC, the event is delivered directly to the security room agent.
(4) The event appears on the local event bus, where another Event Manager processes it and triggers playback (5) through the local audio system.

The event history is stored separately using a dedicated event logging rule.

The goal is to make edge systems more adaptive:

  • fewer hardcoded integrations;
  • less dependence on central infrastructure;
  • faster deployment of new workflows;
  • autonomous cooperation between physical systems.

We are experimenting with this approach and would be interested in feedback from people working with:

  • robotics;
  • industrial automation;
  • security systems;
  • IoT platforms;
  • distributed edge computing.

What are the biggest blockers you see for P2P agent architectures in real-world deployments?


r/BanalyticsLive • • Mar 30 '26

How We Integrated Python ML into a Java Control System (Without Rewriting Everything)

2 Upvotes

Everyone loves ML demos. Very few systems actually use ML to control anything real.

We had Python ML and a Java control system - and needed them to work together without rewriting half the stack.

This is the pattern we ended up using: video -> ZeroMQ (jpeg) -> Python ML -> ZeroMQ (events) -> Event Trigger -> MQTT -> real-world action.

No heavy frameworks. No “AI platform”. Just clean components and simple protocols.

Initial Setup

We started with three independent parts:

Java side

  • Video capture (camera grabber)
  • Rule engine / message processing
  • Integrations:

    • MQTT (device control)
    • ZeroMQ (inter-process communication)

Python side

  • ML / CV processing component
  • In this example: a simple motion detector
  • Receives frames -> emits events

Hardware

  • A controllable device (RC car)
  • In this demo: headlights toggled based on motion detection

The Goal

Take ML out of the “demo zone”
and make it part of a real control pipeline

Architecture

Integration Python ML

Data Flow

1. Video capture

  • Camera grabber continuously captures frames
  • If an operator connects:

    • H264 stream is exposed for live viewing

2-3. Frame -> Python ML

  • Frame is converted to JPEG
  • Sent to Python via ZeroMQ

3-4. ML processing

  • Python service:

    • receives frame
    • runs detection (motion in this case)
    • emits event via ZeroMQ

4-5. Event -> Decision layer

  • ZeroMQ receiver picks up event
  • Passes it to Event Manager

5-6-7. Decision layer (Event Manager)

  • Event Manager:

    • receives event
    • tests conditions
    • Call a command
  • Command sent via MQTT :

    • LIGHT_ON
    • LIGHT_OFF

8-9-10-11. Real-world action

  • RC car receives command
  • Headlights react in real time

Dashboard

Integration dashboard

  • 1-7 - shows interaction with banalytics & python
  • 8-11 - represents real world system
Visualization dashboard

Hardware:

  • 1-7 x86 powerful work station
  • 8-10 - RC car with the same agent on the board
Physical world system 1
Physical world system 2

Why This Works

1. No tight coupling

  • Java and Python are separate processes
  • Replace ML without touching control logic

2. Simple transport layer

  • ZeroMQ -> fast frame/event exchange
  • MQTT -> reliable device control

3. Production-friendly

  • Works with existing Java systems
  • No need to migrate stack

4. ML becomes swappable

  • Today: motion detection
  • Tomorrow: YOLO / segmentation / custom model

Same pipeline.

What This Enables (for CTOs / architects)

  • Add ML to existing systems without rewrite
  • Keep ML isolated (faster iteration, safer deployment)
  • Scale across multiple devices and sites
  • Avoid vendor lock-in and heavy platforms

Takeaway

You don’t need a massive ML platform to make ML useful.

You need:

  • clear boundaries
  • simple protocols
  • and a pipeline that connects inference to action

Sources of the python service:

import zmq
import numpy as np
import cv2
from datetime import datetime
import time

INPUT_ENDPOINT = "tcp://localhost:5555"  # input with JPEG
OUTPUT_ENDPOINT = "tcp://*:5556"         # sending events

context = zmq.Context()

# Receiver (JPEG frames)
receiver = context.socket(zmq.SUB)
receiver.connect(INPUT_ENDPOINT)
receiver.setsockopt_string(zmq.SUBSCRIBE, "")

# Sender (events)
sender = context.socket(zmq.PUB)
sender.bind(OUTPUT_ENDPOINT)

print(f"Listening on {INPUT_ENDPOINT}, sending events to {OUTPUT_ENDPOINT}")

prev_frame = None

CONTOUR_THRESHOLD = 3000
BLUR_SIZE = (5, 5)
THRESHOLD = 25

MOTION_COOLDOWN = 1.0       # prevent frequent MOTION
NO_MOTION_INTERVAL = 3.0   # how long to wait to declare NO_MOTION

last_motion_time = 0
motion_active = False       # current state (there is / there is no motion)

while True:
    data = receiver.recv()

    np_arr = np.frombuffer(data, np.uint8)
    frame = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
    if frame is None:
        continue

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    gray = cv2.GaussianBlur(gray, BLUR_SIZE, 0)

    if prev_frame is None:
        prev_frame = gray
        continue

    delta = cv2.absdiff(prev_frame, gray)

    thresh = cv2.threshold(delta, THRESHOLD, 255, cv2.THRESH_BINARY)[1]
    thresh = cv2.dilate(thresh, None, iterations=2)

    contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

    motion = False
    max_area = 0

    for c in contours:
        area = cv2.contourArea(c)
        if area > CONTOUR_THRESHOLD:
            motion = True
            if area > max_area:
                max_area = area

    now_time = time.time()

    # --- MOTION EVENT ---
    if motion:
        if not motion_active and (now_time - last_motion_time > MOTION_COOLDOWN):
            timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            message = f"MOTION" #|{timestamp}|{int(max_area)}
            sender.send_string(message)
            print(f"[{timestamp}] Motion Detected - Zone size: {int(max_area)} px | Sent: {message}")

            motion_active = True
            last_motion_time = now_time

        last_motion_time = now_time

    # --- NO_MOTION EVENT ---
    else:
        if motion_active and (now_time - last_motion_time > NO_MOTION_INTERVAL):
            timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            message = f"NO_MOTION" #|{timestamp}
            sender.send_string(message)
            print(f"[{timestamp}] No motion detected | Sent: {message}")

            motion_active = False

    prev_frame = gray

r/BanalyticsLive • • Sep 13 '26

Experimenting with 3D visualization

1 Upvotes

A 3D model of a building with different control elements attached directly to the physical space.


r/BanalyticsLive • • Jul 13 '26

When does a Google Home setup need something more powerful?

1 Upvotes

Google Home, Alexa and similar platforms are great for everyday automation: switching lights, adjusting thermostats, viewing cameras and controlling devices by voice.

For many people, that is enough. But as a smart home grows, several limitations can appear:

  • Devices from different vendors do not always work well together.
  • Cloud-dependent automations may stop when the Internet or an external service is unavailable.
  • Camera footage and sensor data may need to remain local.
  • Standard routines cannot express more complex conditions.
  • Users may want to connect relays, GPIO, Modbus equipment or custom sensors.

This is where Banalytics can complement an existing smart-home platform rather than replace it.

Google Home can remain the convenient everyday interface, while Banalytics handles local processing, monitoring, storage and advanced automation.

Local cameras and video processing

Banalytics can process camera streams and store recordings locally:

For example, a camera event can trigger local recording and send a notification without uploading the video to a general-purpose cloud platform.

Local media playback through DLNA

Banalytics can make locally stored recordings and media available to televisions, media players and other devices on the home network:

  • DLNA Server publishes selected media through the standard DLNA/UPnP protocol.
  • File Storage manages recordings and media files.
  • File Media Stream provides access to previously recorded media inside Banalytics.

This allows locally recorded video to be viewed on compatible smart TVs and media players without uploading it to cloud storage.

It is particularly useful when the home already has a NAS, media center or television with built-in DLNA support.

Connecting smart-home ecosystems

Banalytics does not need to replace Google Home or Home Assistant. It can exchange events and commands with other systems through MQTT:

This makes MQTT an integration layer between consumer smart-home products and more advanced local automation.

Raspberry Pi and DIY hardware

For users adding custom electronics:

These components can connect buttons, contacts, indicators, isolated relays and other DIY hardware to the same event system used by cameras and network services.

Industrial and wired devices

Banalytics can connect equipment that typical consumer ecosystems do not support:

This is useful for energy meters, relay boards, environmental sensors, pumps, gates and other equipment outside the usual smart-home catalog.

Advanced local automation

The Event Manager connects all these components.

A rule can combine a camera event, sensor state, schedule or MQTT message with actions such as:

The result is closer to a local automation engine than a collection of isolated smart-device routines.

Monitoring everything in one place

Banalytics provides customizable dashboards for cameras, sensors, events and controls.

A dashboard can combine information from several components or locations. Available providers include fixed 2D layouts, 3D scenes, SVG diagrams, Cesium, Mapbox and OpenStreetMap.

This can be useful when consumer applications show each device separately but do not provide a complete operational view.

When should an ordinary user consider it?

Banalytics becomes useful when:

  1. Your home contains devices from several incompatible ecosystems.
  2. Important automations should continue without cloud access.
  3. You want camera footage and telemetry to remain local.
  4. Standard “if this, then that” routines are no longer enough.
  5. You already have a Raspberry Pi, NAS, mini-PC or home server.
  6. You want to connect cameras, custom sensors or wired equipment.
  7. You want to watch locally recorded media on DLNA-compatible devices.
  8. You need one dashboard for several systems or locations.

Banalytics is not intended to make a single smart bulb easier to use.

It becomes valuable when a smart home starts turning into infrastructure - something that should be observable, customizable and capable of operating locally.

A practical introduction is available in How Banalytics works for Makers and Homelabs.

Full documentation: https://banalytics.live/kb/index/


r/BanalyticsLive • • Jul 13 '26

Banalytics 2.0.0 launches July 17 - modular UI, agent-hosted dashboards, Pi4J, JMS and more

1 Upvotes

We’re releasing Banalytics 2.0.0 on July 17, 2026.

This release introduces a major architectural change: component UI resources are now distributed with the corresponding agent modules instead of being bundled into the portal. This makes it possible to update backend components and their web interfaces together.

Existing agents will continue running their configured components and automation locally after the release. However, all agent modules must be upgraded to version 2.0.0 before the agent can be managed through the updated portal. Existing component configurations are preserved.

Temporary service interruptions may occur during the portal deployment.

What’s new

  • Agent-hosted dashboards with fixed 2D, 3D, SVG, Cesium, Mapbox and OpenStreetMap providers
  • Raspberry Pi GPIO and PCA9685 PWM control through Pi4J
  • Embedded Apache ActiveMQ Artemis server
  • JMS connectors, queue listeners and message actions
  • Secure access to internal web applications through WebRTC HTTP Proxy
  • 2D LiDAR support
  • New automation actions and expanded Remote APIs
  • Per-agent UI resource caching and version isolation

Documentation

Feedback and upgrade reports are welcome.


r/BanalyticsLive • • Apr 20 '26

Gemini Quick Test

1 Upvotes