How to properly bind contact type

I am receiving this error:

Received update of a not accepted type (StringType) for item

Using these items:

Group All

Group gGroundFloor

Group GF_Laundry “Laundry Room” (gGroundFloor)

Contact washer “Washer [MAP(]” (ALL) {mqtt="<[mymosquitto:home/laundry/washer:state:default"}

this rule:

rule “Washer State”
Item washer changed
logInfo(“Washer”, "Washer state at beginning of rules: " + washer.state)
if (washer.state == OPEN)
logInfo(“Washer”, “Washer Off”)
//notifyMyAndroid(“e53b9ef413f5689a8240f8112abe0d594b25c01f378ee5b3”, “Washer”, “Load started” )

if (washer.state == CLOSED)
{	logInfo("Washer", "Washer Started")
    //notifyMyAndroid("e53b9ef413f5689a8240f8112abe0d594b25c01f378ee5b3", "Washer", "Yay! Clean clothes!")
    sendMail("", "Washer finished", "Yay! Clean clothes!")
logInfo("Washer", "Washer rule completed")


My MCU is reporting a binary value, then in C, I look for the value, then write OPEN or CLOSED (string) to the broker channel.

before, when I was using a number and published the state to the site, it worked fine, but now I get the error above.

Any ideas?



Make sure you have no leading or trailing spaces in the string sent to MQTT. Or add a transform that will trim the white space (search the forum for “,trim” and you should see some examples, often posted by watou).

I post “OPEN” and “CLOSED” to MQTT for some contacts so I know it can work with the string.