Moving Rules from version 2.1 to version 2.6 experience.

After a long struggle transferring my 5 years old OR implementation to version 2.6 I can point out few important things from my experience:

  1. There is a bug in the Designer while trying to correct some details in an image. If you keep the same name and erase the original one from the list and load a new one, it will load it from the cache the old one.
    You must change the name as well. In the name, the “_” are ignored so don’t add it to the name as you will end up loading the same image from cache of the designer server.

  2. I have moved the rule file from a Ubuntu machine to MAC OS. From some reason some of the " signs became " (itelic) which are not the same ASCII. This derives to an error all over the place as structure is not maintained.
    You will get an error on the last line.

  3. Rules files splitting is not working. I have to move all rules to the base rule file.

  4. As for rues emailing, the below link does not work as there is no eMail protocol in the basic 2.6 product.

https://openremote.github.io/archive-dotorg/forums/Emails,%20Text-to-Speech,%20Serial%20Port.html

Instead use the following link:

https://groups.google.com/forum/#!topicsearchin/openremotecommunity/email$20protocol;context-place=forum/openremotecommunity/openremotecommunity/knDgYx1BMtM

  1. Rules are no case sensitive to KNX - if you test a state in a rule to “ON” it must be “ON” command in the Designer as well as “on” will generate an error.

  2. Java 8 has changed its Time and Date class location so I guess this is why I got the following warning:

Warning: Could not get charToByteConverterClass!

I did not fix this one yet.

This is it for now.

Run into another issue - a big one.

All rules are loaded fine with no errors but nothing fires at all.

Under 2.1.4 it is till running fine.

So I have added 3 extra rules that shows something is basically wrong, probably under OS X.

//----------------------------------------------------------------------------------------
rule “Drools test on”
no-loop true
duration 900
timer(cron: 0/20 * * * * ?)
when
eval (true)
then
// execute.command(“Water Tank (ON)”);
execute.command(“V_Water_Tank_60M (ON)”); // Turn On 60 Minutes Button
System.out.println (_TimeStamp()+ “: #1 Water Tank Relay activated !!”);
end
//----------------------------------------------------------------------------------------
rule “Verify_Water_Tank_Manually_De-Activated”
when
Switch (source==“V_Water_Tank_60M (Sensor)”, value==“OFF”)
then
System.out.println(_TimeStamp()+ “: #4 Water Tank Test !!”);
end
//------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
rule “Drools test off”
timer(cron: 10/20 * * * * ?)
when
eval (true)
then
execute.command(“V_Water_Tank_60M (OFF)”); // Turn On 60 Minutes Button
System.out.println (_TimeStamp()+ “: #1 Water Tank Relay De-activated !!”);
end
//---------------------------------------------------------------------------------------
Only 2 rules fire OK and I get a message on the Terminal as expected. Since the Event (or Switch) use the same device, the mid rule should have fired but it does not.

The button of the panel that is linked to the device is working as per the rules with no problem.

It is true for all rules of my system.

This one was added just to prove the point.

It looks like a bug which prevents OS X from being used!!!

בתאריך יום ראשון, 25 בפברואר 2018 בשעה 18:21:30 UTC+2, מאת Nir Aviry:

Try to rewrite this to

rule “Verify_Water_Tank_Manually_De-Activated”
when
Switch (source==“V_Water_Tank_60M (Sensor)”, $value:value)
then
System.out.println(_TimeStamp()+ ": #4 Water Tank Test !! "+$value.toString()); end

This should trigger and show you the actual value of sensor. I suspect that it is lower case.

Kind regards,
Michal Rutka

It seems like the issue was “ON” instead of “on”.

Troubles are not over yet.

Going with the same logic, a rule I had that was working well under 2.1.4 is not working now and is not firing at all.

The CustomState is for Weather Station info readout.

rule “Get WT Factors”
no-loop true
timer(cron: 0 0/2 8-18 * * ?)
when
$wt_factors: Water_Tank_Factors(Acc_lock_reading==0)
CustomState( source == “Roof Temp (Status)”, $val_T: value)
CustomState( source == “Roof Brightness (Status)”, $val_L: value)
then
$wt_factors.setAcc_lock_reading( 1 );
update ( $wt_factors );
$wt_factors.setAcc_temp ($wt_factors.getAcc_temp() + Float.valueOf($val_T.toString()));
update ( $wt_factors );
$wt_factors.setAcc_light ($wt_factors.getAcc_light() + Float.valueOf($val_L.toString()));
update ( $wt_factors );
$wt_factors.setAcc_sigma (($wt_factors.getAcc_temp() * 1400 )+ $wt_factors.getAcc_light());
update ( $wt_factors );
System.out.println ( _TimeStamp()+ “: Daily Temp accomulation: " + $wt_factors.getAcc_temp());
System.out.println ( _TimeStamp()+ “: Daily Light accomulation: " + $wt_factors.getAcc_light());
System.out.println ( _TimeStamp()+ “: Daily Light + Temp accomulation: " + $wt_factors.getAcc_sigma());
System.out.println ( String.format(java.util.Locale.US,”%.1f”, $wt_factors.getAcc_sigma()));
execute.command ( _TimeStamp()+” :"+String.format(java.util.Locale.US,"%.1f", $wt_factors.getAcc_sigma()));
end

בתאריך יום שבת, 3 במרץ 2018 בשעה 12:32:42 UTC+2, מאת Michal Rutka:

I would first try to simplify the cron statement to trigger every second and check which line on the LHS is blocking (my guess would be $wt_factors: Water_Tank_Factors(Acc_lock_reading==0) ).
What I remember some time ago was that custom facts did not like underscores in field definitions. Maybe renaming Acc_lock_reading to AccLockReading would help?

I have discovereed two other issues I did not see any post on.

  1. When running Android console it works but I get an error on the terminal as follows:

ERROR [HTTP-Thread-3]: Failed to execute REST API call ‘http://10.0.0.39:8688/controller/rest/commands’ : Invalid URL format – expected format ‘/rest/devices/{device_name}/commands?name={command_name}’, got ‘/rest/commandsnull’.

  1. Although all rules are working each boot I get an error as follows:

Warning: Could not get charToByteConverterClass!

It appears just after the end of the rules engine load is done.

Any ideas?

בתאריך יום ראשון, 25 בפברואר 2018 בשעה 18:21:30 UTC+2, מאת Nir Aviry: