cdjackson / HABmin

A web admin console for openHAB home automation
http://www.cd-jackson.com/index.php/openhab/habmin
217 stars 51 forks source link

Unknown block from rule creator #176

Closed scoobydrvr closed 9 years ago

scoobydrvr commented 9 years ago

I've created a simple rule to change a text value on my sitemap that is triggered by a motion sensor. When the .rules file is generated by HABmin the it shows "postUpdate(Motion, *\ Unknown Block "text"). Did something get left out?

motion rule

// This rule file is autogenerated by HABmin.
// Any changes made manually to this file will be overwritten next time HABmin rules are saved.

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

// Global Variables

rule "Update Motion"
when
    Item Motion_Sensor changed
then
  if(Motion_Sensor.state == ON) {
    postUpdate(Motion, *** Unknown Block "text")
  }

  if(Motion_Sensor.state == OFF) {
    postUpdate(Motion, *** Unknown Block "text")
  }
end
cdjackson commented 9 years ago

Hmm - I’ve not used text block before - I think that might be unsupported, but I’ll see if I can add it quickly…

cdjackson commented 9 years ago

Hi, I’ve just updated the habmin JAR - give it a go and see if it solve the issue. I’ve done a quick test and it seems ok, but I don’t use text items like this so it would be good if you can confirm…

Chris=

scoobydrvr commented 9 years ago

Yup, that fixed it! Generated rule as follows below.

rule "Update Motion"
when
    Item Motion_Sensor changed
then
  if(Motion_Sensor.state == ON) {
    postUpdate(Motion, "DETECTED")
  }

  if(Motion_Sensor.state == OFF) {
    postUpdate(Motion, "OFF")
  }
end
cdjackson commented 9 years ago

Brilliant - thanks for the feedback.