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


I have the following item defined:

Switch switch99 "switch node 99 sensor 3: [%s]" { mqtt="<[mysensors:sensor-gw1-out/99/3/1/0/16:state:default]" }

Updating this items results in:

Dez 20 23:27:10 autohome[25211]: 23:27:10.821 [INFO ] [runtime.busevents             :26   ] - switch99 state updated to 1
Dez 20 23:27:10 autohome[25211]: 23:27:10.827 [DEBUG] [ore.internal.items.ItemUpdater:73   ] - Received update of a not accepted type (PercentType) for item switch99

Any idea whats wrong here?

Yes; the 1.7* and previous MQTT binding has a hard-coded set of state types that it runs through, trying to parse the message into the first type that parses correctly. The problem is that the receiving item for the update may not accept that kind of state. The 1.8 version of the binding instead knows the data types that are accepted for the intended item, so there is no chance that an incoming subscribed message will result an in incompatible type.

You can grab a replacement MQTT binding JAR from a link in the pull request that fixes the issue, or from the latest CI build.

hmm not really at all :smiley:

There is new error now:

Dez 21 01:40:59 autohome[3103]: 01:40:59.849 [WARN ] [   ] - given new state is NULL, couldn't post update for 'switch99'

mqtt broker still states:

sensor-gw1-out/99/3/1/0/16 1

maybe the result of mixing the versions?

A Switch item must receive an ON or OFF message. Replace the default with MAP(toOnOff.MAP) and make a map like


now it works. Thanks. Is there a way to map this again for the frontend in order to translate off to another language?

mqtt 1 => openhab: OFF => frontend: AUS

0=OFF results in OFF in the frontent too, but there I want another string.

You can add a map to the labeltext. This only affects display. You can add to the file that comes with openHAB or make a new map file.

Your item would look something like this:

Switch switch99 "switch node 99 sensor 3: [MAP(]" { mqtt="<[mysensors:sensor-gw1-out/99/3/1/0/16:state:MAP(toOnOff.MAP)]" }
1 Like

thx 4 your (fast) supoprt!

1 Like