TheGreydiamonds Blog

Month: June 2020

OpenHAB: Random time delay (Jitter)

OpenHAB is an opensource homeautomationsoftware. In this article, I will explain how to add a random delay to an action in openHAB using rules. The whole concept is known as Jitter.

My goal

My goal was it to turn on a device with a random delay using openHAB rules. It was pretty clear to me that I was unable to use openHAB’s GUI rule editor.

My solution

With a bit of knowledge of Java and a bit of reading I was able to create this solution:

rule "LampeVerzoegertAn"
when
	Time cron "0 54 20 1/1 * ? *"
then
        var int randomTime = (new java.util.Random).nextInt(20,125)
	    logInfo("org.openhab","Setting random lights timer to " + randomTime + "seconds.")
	    tRandomLights = createTimer(now.plusSeconds(randomTime)) [|
                MyLight.sendCommand(ON)
            ]
end

The line Time cron "0 54 20 1/1 * ? *" in the when-Block tells openHAB, that we’re creating a time-based rule. This rule will get triggered at 20:54, that means, that the earliest time the device will turn on is 20:54. The line var int randomTime = (new java.util.Random).nextInt(20,125) defines a variable called randomTime of the type int. In the brackets we can define the minimum delay (in this case 20 seconds) and the maximum delay(in this case 125 seconds, around two minutes). In the next step, the code will generate a log message. The line tRandomLights = createTimer(now.plusSeconds(randomTime)) [| creates a new timer with the delay of randomTime. After the [| bracket-block is the needed code. In this case, I will be turning on the Item (Attention, not a device!), called MyLight. In the last step, you will have to close the block with a bracket again.

With this code I was able to create the wanted behaviour.

OpenHAB: Zufällige Verzögerung (Jitter)

OpenHAB ist eine Quellen offene Hausautomationssoftware. In diesem Artikel erkläre ich kurz, wie es möglich ist Aktionen mit einer zufälligen Verzögerung auszuführen. Dieses Konzept nennt man auch Jitter.

Ziel

Mein Ziel ist es, ein Gerät mit einer zufälligen Verzögerung einzuschalten und dabei OpenHAB-Regeln zu nutzen. Es war von Anfang an klar, dass man den GUI Regel Editor von OpenHAB dafür nicht nutzen kann.

Die Lösung

Mit ein wenig Java-Verständnis und ein wenig lesen, kam ich auf die folgende Lösung:

rule "LampeVerzoegertAn"
when
	Time cron "0 54 20 1/1 * ? *"
then
        var int randomTime = (new java.util.Random).nextInt(20,125)
	    logInfo("org.openhab","Setting random lights timer to " + randomTime + "seconds.")
	    tRandomLights = createTimer(now.plusSeconds(randomTime)) [|
                MeineLampe.sendCommand(ON)
            ]
end

Im when-Block besagt die Zeile Time cron "0 54 20 1/1 * ? *", dass es sich um eine Zeitbasierte Regel handelt, welche um 20:54 ausgeführt wird. Das heißt, dass das Gerät frühestens um 20:54 eingeschaltet wird. In der Zeile var int randomTime = (new java.util.Random).nextInt(20,125) definieren wir die Variable randomTime des Types int (also eine Ganzzahl). In den Klammern wird der kleinste mögliche Wert (in diesem Fall 20 Sekunden) und der größte (längste) Wert angegeben(in diesem Fall 125 Sekunden, etwa zwei Minuten). Als nächsten wird eine Logausgabe erzeugt. tRandomLights = createTimer(now.plusSeconds(randomTime)) [|, erzeugt einen neuen Timer mit der Verzögerung von randomTime. Nach dem Klammerblock [| wird der passende Code eingegeben. In diesem Fall Schalte ich das Item (Aufpassen, nicht das Gerät!) ein. MeineLampe muss natürlich angepasst werden. Zuletzt wird der Block mit einer weiteren eckigen Klammer geschlossen.

Mit diesem Code habe ich erfolgreich eine Leuchte zufällig angeschaltet.

The short story about Christian Jacksons Discord server

Information

I do not want to hurt anyone with this article nor am I trying to make any seem bad. I tried to present all facts as neutral as for me possible

If you ask yourself now: “Who is Christian Jackson?”, here is the short answer: A YouTuber who makes vlogs about the event industry. For everyone else, this is the story about his Discord-fanserver. Link to his channel.

The beginning

On 21.03.2020 at about 21:00 I clicked the “Create new server” button in Discord. This is where it all began, me and a few others immediately “advertised” it in the YouTube livestream, after a while people started coming onto the server. From the beginning we had several language channels (German, English and later also Dutch) and wanted to build an open community. At that time the server was called “Christian Jackson Fanserver”. We created channels for different systems, like MA and similar.

The great master has appeared

…or something like that. Some afternoon Christian Jackson came on the server. But he wasn’t very active, Discord was “too complex” for him. In the time we created more channels so that everything had its own area and remained clear. Many people actually found the format quite good, new people joined the team and everything went very well. There were first conferences about the server and the bot was developed further. We lost the database of the bot once, well, mistakes happen.

The calm before the storm

On 31.05.2020 we briefly put the server into a “maintenance mode”, you could only see a few channels. At that time we sorted the server a bit and not much happened. The server was down for about five minutes.

On the first of June 2020, was the doomsday. I woke up with over 50 messages in Discord, which is not good. Without knowing it better, I open Discord, which was actually a bad decision. Christian (from now on CJ) had sent this message into one of the channels:

Thanks for the info and ping. I don’t visit discord except maybe once a month so I’m not usually aware of these issues. I do not have the time to moderate or check in on these sort of things usually and it was my mistake to let this all happen. 

Upon reviewing what you wrote, you’ve exactly detailed what I DID NOT want to happen here. Thank you for the thoughtful and detailed message. 

This is truly my mistake for letting this operate without supervision. I don’t know anything about discord, is there a way to completely pause the server and cease all channels until this is fixed?

And he had also left a message in the team channel:

Please make the following changes to the Discord server as soon as practicable.

Delete all bots and automation.

Delete all roles except for moderator and members. No special roles.

Delete all emotes.

No rules page that members have to agree to. Makes no sense. Anyone should be able to visit and be able to post or view the server immediately. 

Delete "Official" from the name of the server.

Any future changes must be emailed to me for approval christian@christian-jackson.com

Delete ALL channels except for the ones in the list below.  

Channels:

Lighting Design
Lighting Programming
Lighting General
Audio
Video
Other Tech
Off Topic Green Room - NSFW 18+
Off Topic Green Room - SFW All Ages
English Voice Chat
German Voice Chat
Mod/team 

Lastly, what was the comment from Josh | UK regarding explaining ways to exploit MA2 when the server was started?

Thanks.

One of the moderators just started without talking to us first. My first reaction was to take away his privileges as “damage control.” We were all very pissed off. Well, he just came out of nowhere and demanded changes after he told us that he didn’t want anything to do with the server guidance. Of course, we didn’t really like that. At this point it was almost too late because of the already mentioned moderator. We wrote a two pages long “letter” to him that we didn’t like that. After a few days we received a somewhat of a very short answer. It sounded something like this: “You have had bad luck. Your problem.” It wasn’t meant that way, but it was understood that way.

Now what?

The server is reduced to a few channels and one admin of our team has left and the moderator from before has been “dismissed”. On the picture below you can also see the admin and team areas. On 6.6.2020 I left the team finally. On 11.6.2020 there was a long discussion about the whole topic in the “off-topic-sfw-all-ages”-Channel.

The current state.

Nobody knows what will happen next. I will try to keep this article up-to-date. We created a new discord server, called GLS (General Lighting Server), come and check it out. Link

Just for this to be complete, I will append the letter we sent to Christian. You can read his answer here: http://christian-jackson.com/emails

Hey Christian,
there are a lot of changes happening on the discord that affect you, but mostly us.
We, the team, people that came here by watching your videos, gathered here to help you, with creating, growing and interacting with the community, we really put in effort and time.
The discord grew and so did our responsibilities. We try to catch up to them and since there were no guidelines from your side, we had to do what we thought was best. There were no individuals who made changes, There was always a team behind it. A team of people who put in the dedication to create that community discord. Not just for you, but also themselves and everyone else in this community.
It was a project that really caught our full attention and passion. We tried to make space for every single member in the community, so everyone feels welcome. From the small kid who wants to get into the industry to older guys already working there and need to use the discord to troubleshoot on their own projects.
That of course created a conflict in those interests, but since we didn’t want to bother you, we tried to make it work for everyone, so no one gets left behind. We tried our best to get rid of the image of being a "fan-boy" server and remodel it to a place where your community can come and talk about your videos, lighting , the industry and mostly having fun together.
As this became a small mess with different interest and demands inside the community, we even held up meetings, spent some evenings trying to figure out ways to enhance the discord and make it a friendly space for users and also getting another platform ready for u to interact with, by building up a whole structure behind it, that we felt was supported by the members and you didn’t have to take care about and would one day be running by itself.
Since we know that there is other stuff you have to focus on and discord not being your main platform, we always tried to act in your best interest and welfare of the community, even if we never got any input or suggestion from your side, so maybe one day this will grow to another platform that helps the community growing.
With that being said, we created a concepts which suits most demands of the community and started to work on that for days. We wanted to get a clean channel and server structure, so that when you want to interact with it, you always have a room for that. We wanted to make it look professional, so it gets taken serious. We wanted to help you interact with your community so that’s why we added certain roles on the discord, like „clipper“ for those who take the time and clip all your stuff that you enjoy watching later on, or „comedian“ for those who put in the time and kept the discord alive.
As we removed those roles on certain demands, we quickly got response from those who earned themselves the role as they felt like they got left behind now.
As your community not only consist of older people in the industry but also younger people, we added rules, so we can fulfill our whole responsibility in taking care of our „smaller guests“.
As you, having a big community we also wanted to support smaller guys and created a self-advertising channel and other ways for people to show off their work, since this community is all about getting connections.
We think that makes clear, that there weren’t just some people who created some channels on some discord, but humans who really took their time and try to figure out the best way throughout all those different demands.
We know that we’ve created a lot of channels, but nevertheless always kept track of them, so we don’t create unused channels. There was always someone who used the channels we created for them, we gave people a platform.
You did surprise us with your sudden list of demands. And to be frank a lot of us felt it like a slap in the face, because as said before we always did what was best for you and the community. We think it is fair before bringing the hammer down like that we could have the opportunity to introduce ourselves and work something out. Without you being mad, annoyed or having to put loads of your time in this. We are a team already in place to support you in this matter, just without any guidance or input from you.
We also didn’t want to limit ourselves on just the discord but further on create events inside the community like competitions or other stuff and help you with all your needs while traveling around in the online world.
Not to forget that we are all humans inside that team and have a personal life on our own, doing stuff at home or working on our next gig, as we are all people from different ages, different knowledge bases and countries. ...some more the event technician type, others more the programmer guy. Those weren't strict plans for events that we wanted to roll out without asking you, but ideas we were ready to put in work and effort, if u felt like those were good ideas.
Since we didn't had a real way to always contact you at any time, without bothering you, we wanted to create a finished package of ideas, which you just can agree on or dismiss and we would have taken care of the rest.
We don't want to change your opinion on how the discord should be laid out.
Now, there is just one big problem for us and that's the loss of all our work that went into the project, our whole effort on creating a space for your community. Our technicians set up a bot for your discord, although you probably didn't liked him, he was a good tool for us to keep track of everything and another safety insurance incase some causes trouble. A lot of time went into programming all those lines for the bot to work correctly and someone even bought a UPS so the safety is given 24/7.
We don't want to blame you on all those lines that have been lost or the price people paid for things they bought. We don't want to blame you for not spending much time on the discord and seeing all the things we do, all those little fights in between the community or all those kinds of support we gave other members of your community, but we also feel like all the time, effort and passion that went into everything just went down the drain.
Kind regards, your discord team.

Taking a step back

After over half a year ago this story unravelled. When I wrote this story, I was upset and annoyed. But I was able to take a step back from all of this. And I have to say that without CJ or this server, I would never have met with many amazing new people. After all, it wasn’t as bad as it seemed. I think that everyone made mistakes, and yes, I also made a few. It is great to be able to take a look at this from some distance. I have moved on with my life, it was a – frankly speaking short but interesting span of my life.

Welcome

Welcome to my new Blog! This blog is about tech, Arduinos and other stuff. I’m gonna post projects, ideas and tutorials on here, I hope you like the new content. I would be very happy to get feedback from you.

Die Geschichte um den Christian Jackson Discordserver

Wer sich jetzt fragt: “Wer ist Christian Jackson?”, hier die kurz Antwort: Ein englischsprachiger YouTuber welcher Vlogs von der Eventindustrie macht. Für alle andere geht es hier um die Geschichte um seinen Discordfanserver.

Der Anfang

Am 21.03.2020 um ca. 21:00 Uhr klicke ich den “Neuen Server erstellen”-Knopf in Discord. Hier hat alles angefangen, ich und ein paar andere haben sofort im YouTube-Livestream “Werbung” dafür gemacht, nach einiger Zeit kamen auch Leute auf den Server. Wir hatten von Anfang an mehrere Sprachkanäle (Deutsch, Englisch und später auch Niederländisch) und wollten eine offene Comunity aufbauen. Zu dem Zeitpunk hieß der Server noch “Christian Jackson Fanserver”. Wir haben Kanäle für unterschiedliche Systeme erstellt, also MA und ähnliches.

Der große Meister ist erschienen

…oder so ähnlich. An irgendeinem Nachmittag ist dann Christian Jackson auf den Server gekommen. Sehr aktiv war er aber nicht, ihm war Discord “zu komplex”. In der Zeit haben wir mehr Kanäle erstellt, damit alles seine eigenen Bereich hat und übersichtlich blieb. Das ging gut, viele fanden das Format eigentlich ganz akzeptabel, es kamen neue Leute ins Team. Es gab erste Konferenzen über den Server und der Bot wurde weiterentwickelt. Wir haben einmal die Datenbank des Bots verloren, naja Fehler passieren schonmal.

Die Ruhe vor dem Sturm

Am 31.05.2020 haben wir den Server kurz in einen “Wartungsmodus” versetzt, man konnte nur noch wenige Kanäle sehen. Zu der Zeit haben wir den Server etwas sortiert und viel ist nicht passiert. Der Server war etwa fünf Minuten nicht nutzbar.

Der 1.06.2020, war der “Doomsday”. Ich wache morgens auf, mit über 50 Nachrichten in Discord. Das heißt schonmal nichts gutes. Ohne Vorahung öffne ich Discord, eigentlich eine Fehlentscheidung. Christian (ab jetzt CJ) hatte in einen der Kanäle diese Nachricht gesendet:

Thanks for the info and ping. I don’t visit discord except maybe once a month so I’m not usually aware of these issues. I do not have the time to moderate or check in on these sort of things usually and it was my mistake to let this all happen. 

Upon reviewing what you wrote, you’ve exactly detailed what I DID NOT want to happen here. Thank you for the thoughtful and detailed message. 

This is truly my mistake for letting this operate without supervision. I don’t know anything about discord, is there a way to completely pause the server and cease all channels until this is fixed?

Und er hatte auch eine Nachricht in den Teamchannel hinterlassen:

Please make the following changes to the Discord server as soon as practicable.

Delete all bots and automation.

Delete all roles except for moderator and members. No special roles.

Delete all emotes.

No rules page that members have to agree to. Makes no sense. Anyone should be able to visit and be able to post or view the server immediately. 

Delete "Official" from the name of the server.

Any future changes must be emailed to me for approval christian@christian-jackson.com

Delete ALL channels except for the ones in the list below.  

Channels:

Lighting Design
Lighting Programming
Lighting General
Audio
Video
Other Tech
Off Topic Green Room - NSFW 18+
Off Topic Green Room - SFW All Ages
English Voice Chat
German Voice Chat
Mod/team 

Lastly, what was the comment from Josh | UK regarding explaining ways to exploit MA2 when the server was started?

Thanks.

Einer der Moderatoren hat einfach, ohne vorher mit uns zu sprechen, losgelegt. Meine erste Reaktion, war es ihm die Berechtigungen weg zu nehmen, als “Schadensbegrenzung”. Wir waren alle sehr angefressen. Warum? Nun ja, er kam einfach aus dem Nichts und hat Änderungen gefordert, nachdem er uns vermittelt hatte, dass er mit der Serverleitung nichts zu tun haben möchte. Wirklich gut fanden wir das natürlich nicht. An diesem Punkt war es fast schon zuspät wegen dem bereits genannten Moderator. Wir haben einen zwei Seiten langen “Brief” an ihn geschrieben, das wir das nicht gut finden. Wir haben nach einigen Tagen eine etwas sehr kurze Antwort bekommen. Diese klang etwas so: “Ihr habt Pech gehabt. Euer Problem.” So war das nicht gemeint, wurde aber so aufgefasst.

Und jetzt?

Der Server ist reduziert auf wenige Kanäle und ein Admin unseres Teams ist gegangen und der Moderator von zuvor wurde “entlassen”. Auf dem Bild hier drunter sieht man auch mal die Admin und Teambereiche. Am 6.6.2020 habe ich dann final das Team verlassen. Am 11.6.2020 gab es noch eine lange Diskussion um das ganze Thema im “off-topic-sfw-all-ages”-Channel.

Der aktuelle Zustand.

Wie es weiter geht weiß niemand. Ich werde diesen Artikel versuchen aktuell zu halten. Der englische Artikel ist meistens aktuelller.

Kurzbericht: QLC+

In diesem Artikel gehe ich auf meine Erfahrungen mit QLC+ ein, damit der Leser (oder die Leserin) nachher besser entscheiden kann ob QLC+ gut für den eigenen Zweck passt.

Kompatibilität

Da QLC+ Opensource ist, gibt es viele Interfaces und Protokolle welche kompatibel sind. Einige wenige Beispiele sind Artnet, MIDI und sACN. Die mitgelieferte Definitionsnbibliothek ist leider etwas mager, es gibt aber sehr ausgeweitet Bibliotheken zum download. Falls es doch mal ein Gerät nicht gibt ist es leicht diese selbst zu definieren. Falls man dazu nicht in der Lage ist, kann man auch im QLC-Forum fragen. QLC+ liefert eine Software mit, mit welcher es sehr leicht ist neue Geräte hinzuzufügen.

Der QLC+ Fixture Definition Editor

Die Oberfläche

Die Oberfläche sieht auf den ersten Blick etwas altbacken aus, wenn man sich mehr damit auseinander setzt sieht man aber, dass die GUI sehr übersichtlich ist. Aufgeteilt in sechs Tabs, Geräte, Funktionen, Shows, Virtuelle Konsole, Einfache Arbeitsfläche und Eingänge/Ausgänge. Die Namen der Tabs sind eigentlich selbst erklärend. Hervorheben möchte ich hier die “Virtuelle Konsole”, bei MA, beispielsweise kennt man diese als “Userdefined space”, man kann dort machen was man möchte.

Die Virtuelle Konsole ohne Inhalt.

Stabilität

QLC+ läuft in den meisten Fällen sehr stabil und hat keine Probleme. Unter Windows hatte ich einmal mit dem FX5-Interface ein Problem, dass sobald ein USB-Gerät eingesteckt wurde, QLC+ abgestürtzt ist, genauer gesagt die GUI. Einen DMX output gab es weiterhin. Sonst hatte ich keine Probleme mit QLC+.

Vor/Nachteile

Kein Timecode. Das ist der wohl größte Nachteil. Dafür kann man QLC+ im Headlessmodus nutzen, also ohne GUI. MIDI-Feedback ist ein weiterer Vorteil. Dafür hat QLC+ (Version 4) keinen 3D-Visualizer. Viele dieser Probleme sollen aber in Version 5 von QLC+ behoben werden, diese ist aber leider zum Zeitpunkt dieses Artikels noch nicht wirklich Reif.

© 2024 Thegreydiamond

Theme by Anders NorenUp ↑