Rule with power measurement

Before i moved to Openhab 2 thi rule worked good:

rule "Wohnzimmerlicht vorne aus"
when
Time cron "0 46 22 * * ?"
then
if (SteckdoseTV_2_Power <= 22)
{
sendCommand(LampeWZ_1_State, OFF)
sendCommand(VitrineTV_1_State, OFF)
sendCommand(VitrineRechts_1_State, OFF)
}
end

Does anybody know how to migrate this to openhab2?

If SteckdoseTV_2_Power is an Item you need to use SteckdoseTV_2_Power.state as Number <= 22.

I’m not sure this would have worked in OH 1. It shouldn’t have as written assuiming it is a Number Item.