Using Sonoff in rules

Hi,

i am trying to use a Sonoff TH16 in a rule, but it seems i made some errors that i cant find.

I can display the temperature on my sitemap and also toggle the switch, but i fail to use it in rules.

Number sonoff1TemperaturKroeten "sonoffTemperatur [%s]" <temperature>	{mqtt="<[mosquitto:sonoff1/DHT/Temperatur:state:default]"}
  Text item=sonoff1TemperaturKroeten label="Temperatur bei den Schildis [%.1f C]" icon="temperature"

What i try to do is toggle some rules based on a change of the temperature and the actual temperature, something like this:

Rule "test regulate temperature"
when 
  Item sonoff1TemperaturKroeten Changed 
then
if (sonoff1TemperaturKroeten > 25) {
Tischlampe_Dimmer.sendCommand(50)
}
end

The dimmercommand is a HUE i use for testing, the command is working (tested with a simple cron-rule). instead of sonoff1TemperaturKroeten i also tried sonoff1TemperaturKroeten.state but had no luck. i think i have some basic error in my code but just cant find it :flushed:

Any ideas?

if(sonoff1TemperaturKroeten.state as Number > 25)
1 Like

Thanks!

And i should really pay more attention to upper/lower case :wink: