Skip to content

Instantly share code, notes, and snippets.

View MDAR's full-sized avatar

MDAR Ltd MDAR

View GitHub Profile
@MDAR
MDAR / #{Velbus} [openHAB] Text files README.md
Last active December 31, 2025 12:11
{Velbus} [openHAB] Text based configuration for Velbus modules.

Text files for adding www.velbus.eu modules and channels to www.openhab.org instances While the MainUI is the prefered way of adding Things and Items, I have found that for Bulk editing, Text based Items files are the fastest to create, debug and update.

I method of adding Things to openHAB is always in the MainUI, as updates in the Binding can be easily accommodated by deleting the Thing, and adding it again so that it uses the new profile (Bug are corrected and new features added)

Bulk editing the Items files is easy with a find and replace.

simply replace the velbus:vmbgpod:VelbusNetworkBridge:05 parts with the correct ID for the Thing

@MDAR
MDAR / # {Node-RED} DateTime README.md
Last active December 31, 2025 11:48
Function node to add Time and Date to payload

Having looked at the forums for solutions, based on these posts I created this Function node to add a Date & Time to a payload.

I thought that by adding it here, others can adapt it to suit their own needed.

You can set the timezone Use or ignore the part in the msg.date

This sample contains

@MDAR
MDAR / # {node-RED} [VISCA] README.md
Last active December 31, 2025 11:49
VISCA protocol for camera control

Having looked around for weeks without any success, I decided to create a very rough flow to package VISCA controls for cameras.

By using TCP out or Serial out nodes, it is possible to route the VISCA packets wherever you want them.

This flow is not pretty and I'm sure someone could make a much nicer job of the function nodes, but it works.

The attached flow is Warts and All, all the test injection nodes and my notes, please feel free to do with it whatever you like.

I did try Pelco-D protocol if anyone wants that flow

@MDAR
MDAR / # {Node-RED} [Joystick] README.md
Last active December 31, 2025 17:54
HID / Joystick / GamePad events via C App

I created a Flow for the basics of Visca control for PTZ cameras, but it soon became apparent that I really needed a joystick for a more human feel to the camera movements.

Having looked for a few hours, I came across a bit of C Code written by Jason White some years ago.

It took me less than 30 seconds to get the code up and running on an Odroid C4, running Diet-Pi and Node-RED, installed from the dietpi-software menu.

Starting the app from within Node-RED gave me all the events I needed.

When connected with a basic Thrustmaster joystick, this flow takes the event data from a slightly tweaked version of Jason's code and turns it into :-