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://forumtest.velbus.eu/

Time Line points

Odroid C2 Kit unwrapped HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Download DietPi HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Download Etcher HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Assemble Odroid C2 HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Booting up and access via PuTTY HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

DietPi software setup HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Installing openHAB2 manually HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Installing VelServ and Velbus Binding HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Starting openHAB2 HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding the Serial Binding HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Creating the Velbus Network Bridge HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding Items via PaperUI HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding Items with a Text file HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Simple DSL rule HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding Node-RED to dashboard and openHAB2 nodes HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding an LCD screen to the Odroid C2 HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Adding a 7 Inch HDMI touch screen to the Odroid C2 HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Configuring Chromium autostart HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

Thank you for watching HowTo setup an Odroid C2 with DietPi, openHAB2, Node-RED, VelServ and Velbus - YouTube

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…

https://forumtest.velbus.eu/t/possibilities-with-openhab/16069/9

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.

For anyone that is interested, you might like to know that the latest version of DietPi (V8.17) now has an installation option in the dietpi-software menu for OpenHAB

With this in mind, I’ll create another video showing the required steps.

Also showing the adjustments that have had to be made to fit in with the DietPi ecosystems

Such as moving the default port and adding the logs to the journalling system.

1 Like