Got OpenHAB running on Ubuntu for a while now with KNX (basic stuff working) and I decided to dare go on the adventure of combining different systems.
First success was getting the Sonos and the Harmony to turn off when I press my central “all off” button when leaving home
Second success came when I was able to start the Apple TV activity when pressing a button on my KNX-system which sends a KNX scene number on the bus. OpenHAB sees the value, with a simple if number=20 it does the right actions.
For the more advanced part I thought it would be nice to control my ventilation system based on different use cases in my home. One of them is when we’re cooking and the hood/damper is switched on to measure the power usage and use this to determine the percentage for the ventilation unit but I am hitting some bumps.
Mind you, beginner here with rules and the IDE and the IDE is not the most helpful sometimes…
My items for this one:
Number number_Amps_Dampkap "Dampkap [%.0f mA]" <kitchen> (grp_Amps) { knx="7.012:2/6/16" }
My rule
rule "VentilationBasedOnHood"
when
Item number_Amps_Dampkap received update
then
switch {
case number_Amps_Dampkap.state >= 50:
// do stuff
break;
case number_Amps_Dampkap.state >= 200:
// do stuff
break;
case number_Amps_Dampkap.state >= 400:
// do stuff
break;
default: break;
}
end
I am in the assumption that to get a value I always have to use .state. However the IDE warns me about:
Hope somebody can clear this one up.