Problem with oh2 rule in oh3

I tried to use a rule from my oh2 setup in oh3, but nothing happens.

The rule should calculate a average temperature from all my sensors.

var Number C = BathroomFlatIndoor_Temperatur.state as DecimalType
var Number D = HauptIndoorModulFlatIndoor.state as DecimalType
var Number E = LivingareaFlatIndoor_Temperatur.state as DecimalType

	
var Number Z = C + D + E
var Number Y = Z / 3

postUpdate(home_temp, Y)
sendCommand(home_temp, Y)

also tried to give in the complete rule as a script

when
    Item BathroomFlatIndoor_Temperatur received update or
    Item HauptIndoorModulFlatIndoor received update or
    Item LivingareaFlatIndoor_Temperatur received update or
	System started
then
	var Number C = BathroomFlatIndoor_Temperatur.state as DecimalType
    var Number D = HauptIndoorModulFlatIndoor.state as DecimalType
    var Number E = LivingareaFlatIndoor_Temperatur.state as DecimalType

	
    var Number Z = C + D + E
    var Number Y = Z / 3

    postUpdate(home_temp, Y)
    sendCommand(home_temp, Y)

end

What clues doesyour openhab.log give you? (starting with xxx.rules file loading or refreshed)
Please show us a complete rule.
Use logInfo to find out if your rule runs.
Use logInfo to find out what your Item states are.
Expect that binding updates may result in new Item types in use e.g. with units of measurement.

the 2th is the complete rule.

how do I get a log on oh3, tried OH 3 Frontail / Log View at :9001 but didn’t show up.

What did not show up ? Frontail does not show any entry at all or an entry related to your rule is not being shown in the logs ?

See Logging | openHAB for logging in general.
There is also a section about create log entries from within rules:
Logging | openHAB

Frontail isn’t showing up - This site can’t be reached

192.168.86.195 refused to connect.

Try:

  • Checking the connection

ERR_CONNECTION_REFUSED

Do you use openhabian ?
Is frontail installed ?
Is it running ( sudo systemctl status frontail )?

You also can have a look to log files by checking it’s content in /var/log/openhab/openhab.log resp. using the karaf console.

Why don’t you create a group with the three items and set the average display?
This is possible in oh2.5.
I think this should work in oh3 too.

Then it’s broken, missing the obligatory
rule "your unique rule title"

I had this on oh2, but on oh3 I didn’t find it.

ah, OK.
I added this, but didn’t helped

Focus on getting your log access working, or you won’t be able to fix any snags you run into.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.