Skip to content

Convert Farenheit to Celcius

pgfeller edited this page Dec 21, 2014 · 2 revisions

The example can be used to convert a fahrenheit temperature value to celcius:

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule "Convert_Temp_EG"
when
	Item ZwaveTemperatureEGF changed 
then
    var tempFahrenheit = (ZwaveTemperatureEGF.state as DecimalType).doubleValue
	var tempCelsius = (tempFahrenheit -  32)  *  5/9
	postUpdate(ZwaveTemperatureEG, tempCelsius)
end

Installation

###Linux / OS X

###Windows


##Configuration

User Interfaces


Community

(link to openHAB forum)

Development



Misc


Samples

A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Collections of Rules on a single page

Single Rules

Scripts


Release Notes

Clone this wiki locally