How to setup DietPi Debian Linux with openHAB, Node-RED and Velbus

Hello everyone

As part of the series of videos I’m creating to help everyone with their Velbus setup, I have created a video that very briefly touches on all the points needed to get an Odroid C2 SBC up and running with DietPI, Node-RED, openHAB2, VelServ and Velbus binding.

If you choose a different SBC, I think the principles remain the same if you choose DietPi as your Debian OS flavor.

I welcome your feedback.

I apologise in advance for the length of this video, my only defence is that I think it contains everything you need to know to get a fresh Odroid C2 up and running with :-
DietPi OS
Java
Node-RED
openHAB2
VelServ
and Velbus

I have created an accompanying PDF guide with download links and code snippets, which can be found here -

To make navigating this video even easier, there is a list of time markers so that you can skip to the parts that are of interest to you at the end of this text.

Thank you for watch, if there are any parts that you would like more information on, please comment below or get in touch via any of the forums.

https://forum.velbus.eu/

Time Line points

Odroid C2 Kit unwrapped https://youtu.be/TqZquvxN_aQ?t=18

Download DietPi https://youtu.be/TqZquvxN_aQ?t=77

Download Etcher https://youtu.be/TqZquvxN_aQ?t=119

Assemble Odroid C2 https://youtu.be/TqZquvxN_aQ?t=142

Booting up and access via PuTTY https://youtu.be/TqZquvxN_aQ?t=286

DietPi software setup https://youtu.be/TqZquvxN_aQ?t=329

Installing openHAB2 manually https://youtu.be/TqZquvxN_aQ?t=440

Installing VelServ and Velbus Binding https://youtu.be/TqZquvxN_aQ?t=576

Starting openHAB2 https://youtu.be/TqZquvxN_aQ?t=668

Adding the Serial Binding https://youtu.be/TqZquvxN_aQ?t=724

Creating the Velbus Network Bridge https://youtu.be/TqZquvxN_aQ?t=810

Adding Items via PaperUI https://youtu.be/TqZquvxN_aQ?t=900

Adding Items with a Text file https://youtu.be/TqZquvxN_aQ?t=999

Simple DSL rule https://youtu.be/TqZquvxN_aQ?t=1323

Adding Node-RED to dashboard and openHAB2 nodes https://youtu.be/TqZquvxN_aQ?t=1613

Adding an LCD screen to the Odroid C2 https://youtu.be/TqZquvxN_aQ?t=1957

Adding a 7 Inch HDMI touch screen to the Odroid C2 https://youtu.be/TqZquvxN_aQ?t=2208

Configuring Chromium autostart https://youtu.be/TqZquvxN_aQ?t=2301

Thank you for watching https://youtu.be/TqZquvxN_aQ?t=2426

5 Likes

For anyone wanting to delve deeper into openHAB2, there is this series of videos

Hi MDAR,

Thanks for this manual, tried it (on a raspberry) and it works like a charm.
The rules are also great but I cannot find a description of existing commands.
By example I would like to program the feedback led from a vmb2pb.
This works on the paperui where i can choose between on, off, slow, fast or very fast blinking.

I tried this rule but this doesn’t work:

rule “Feedback”
when
Channel “velbus:vmb2pbn:VelbusNetworkBridge:03:input#CH1” triggered PRESSED // Could be RELEASED or LONG_PRESSED
then
VMB2PBNdemo_Feedback_PushButton2.sendCommand(FAST_BLINK_LED) //ON, OFF, FAST_BLINK_LED, CLEAR_LED, SLOW_BLINK_LED?, VERY_FAST_BLINK_LED?
//GF_Toilet_Light.sendCommand(GF_LivingDining_Light.state)
end

This gives the following error on the log:
2020-05-12 18:49:14.546 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Feedback’: The name ‘FAST_BLINK_LED’ cannot be resolved to an item or type; line 39, column 47, length 14

1 Like

Hi

Thanks for the compliment, it’s always great to get some feedback.

It took me a few minutes to see what the issue was in your rule, I hunted around for the correct states for the LED feedback…

But just as I was about to go into some serious head scratching, I saw what the issue is

in your rule, you have entered

VMB2PBNdemo_Feedback_PushButton2.sendCommand(FAST_BLINK_LED)

So the DSL engine is looking for a Variable named “FAST_BLINK_LED” to extract a value from and push into the String item.

If you just add some quotes, DSL will take the text you have entered as the required command / String.

VMB2PBNdemo_Feedback_PushButton2.sendCommand("FAST_BLINK_LED")

you could do this, but why bother…

rule “Feedback”
when
Channel “velbus:vmb2pbn:VelbusNetworkBridge:03:input#CH1” triggered PRESSED // Could be RELEASED or LONG_PRESSED
then

 var LED_STATE = "VERY_FAST_BLINK_LED" // SET_LED, SLOW_BLINK_LED, FAST_BLINK_LED, VERY_FAST_BLINK_LED, CLEAR_LED

VMB2PBNdemo_Feedback_PushButton2.sendCommand(LED_STATE) 
//GF_Toilet_Light.sendCommand(GF_LivingDining_Light.state)
end

FYI

to keep the LED in sync, it might be better to split your rules…

   rule “Action”
when
Channel “velbus:vmb2pbn:VelbusNetworkBridge:03:input#CH1” triggered PRESSED // Could be RELEASED or LONG_PRESSED
then

if ( GF_Toilet_Light.state == ON) {
GF_Toilet_Light.sendCommand(OFF)
}
else { // Triggered by any other state than OFF, IE this will include the dreaded NULL state
GF_Toilet_Light.sendCommand(ON)
}

end



rule “Feedback”
    when

Item GF_Toilet_Light changed
or Item GF_LivingDining_Light changed
    then
    if ( GF_Toilet_Light.state == ON && GF_LivingDining_Light.state == ON ) {
               // Do something if both lamps are ON
    var LED_STATE = "VERY_FAST_BLINK_LED"
    }

       if ( GF_Toilet_Light.state == ON || GF_LivingDining_Light.state == ON ) {
      // Do something if either lamp is ON
   var LED_STATE = "FAST_BLINK_LED"
    } 

    else {

    var LED_STATE = "CLEAR_LED"
   }
    

VMB2PBNdemo_Feedback_PushButton2.sendCommand(LED_STATE) 
   end

That way, if the light state changes due to any other action, the LED feedback will be correct :wink:

Hi,

Thanks for the quick reply. And for the tips…
Got a lot to learn but step by step I come to solutions…
Will try this later and keep you informed.

1 Like

Commands for the led feedback working fine. Thanks!

1 Like

My apologies.

I’ve just realised that I forgot to add the .state part to the IF statement in those rules.