OpenHab2 Migration no love.. Please help!

Hey all,

So I am slowly trying to migrate to OH2 (no real reason) and in my rules I have the following that no longer works. It crashes on “postUpdate(IndHeatSet, receivedCommand)”

//* Sync Setpoint with the set temp app *)
rule "Update Temp App"
when
Item IndHeat received command
then
postUpdate(IndHeatSet, receivedCommand)
end

Try the method:

IndHeatSet.postUpdate(receivedCommand)

:slight_smile:

Is this just a recommendation or do you know something about how OH 2 now handles the postUpdate/sendCommand actions? I know that OH 1 Rules are supposed to just work in OH 2 but if they don’t quite work the same any more I would like to know what to watch out for.

I think openHAB changed it’s behavior to cast the commands if using the action since ~ v1.7 (so it depends on the OH1 version jcid1 comes from) and in most cases for me the method works more reliable than the action, so it’s a recommendation :slight_smile:

I completely agree and always recommend using the method too. But the fact that it worked before and now doesn’t have me pause.

Hi Udo,

Yes that don’t work either. Thanks though.

This works,

//* Sync Setpoint with the set temp app *)
rule "Update Temp App"
when
    Item IndHeat received command
then
    postUpdate(IndHeatSet, 70)
end

This does not work in OH2. Only in 1x!

//* Sync Setpoint with the set temp app *)
rule "Update Temp App"
when
    Item IndHeat received command
then
    postUpdate(IndHeatSet, receivedCommand)
end

Which means “receivedCommand” is broken in 2.0.

I have switched back to 1.8 as there are way to many things not working correctly for a migration at this time. And due to the way they built 2.0 you cannot migrate anyway with the new zwave channel layout. Don’t really know why they would choose to completely redesign OH to the point that it breaks 1.8 and any possible migrations but it is what it is I guess… :frowning:

Current rules and code do not work in OH2.
Icons aren’t working correctly in OH2.
Zwave is problematic in OH2.
Still no RGB color in OH2.
Flakey GUI’s and Habmin2.

Zwave color is the only real reason I was migrating but since that don’t work anyway and my current sitemaps/items and rules dont work Ill wait until they roll out an official 2 in the repos etc…

rlk:

I think he was mentioning that as the 1.8 rules allow for item.sendCommand(ON) type rules. Shot in the dark :wink:

Please try
IndHeatSet.postUpdate(receivedCommand as DecimalType)
or
IndHeatSet.postUpdate((receivedCommand as DecimalType).intValue)
Which Version is OH1?

Hi Udo,

Thanks but I wiped OH2 for now. Way too many things not working still. Also I am running 1.8 currently. Rock solid and stable. :wink:

I’m using 1.8.0, too as there are a few bindings still missing under OH2.

Please be aware that item.postUpdate(value) is not identical to postUpdate(item, value) as the method has knowledge about the expected type, but the action has not and will therefore send always a string to the item.