Searching for cause of error from logfile

I am getting an error in the logs, but can not find the cause. I’m sure it is from one of my rollershutters (SONOFF DualR2). As far as I can see, the bindings, things, and items are no different for the suspect shutter when compared to the 10 other shutters. I’ve checked and rechecked the config files.

The error is…

2021-02-18 14:04:08.010 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command ‘56’ not supported by type ‘OnOffValue’: No enum constant org.eclipse.smarthome.core.library.types.OnOffType.56

The first clue is that the suspect shutter is at “position:56”
The second clue is that there are times when the position is “-” (basicUI) when all other shutters show a numeric value (usually 0).

I’d be glad to include snippets of my config files, but I don’t know how to format them in the post. I see the phase “code fence” but that leaves me clueless. Help? TIA.

That suggests this is coming from a switch or contact type channel.
That may have been defined via PaperUI/MainUI in the past, and not visible in xxx.things files.

Just to make it clear, in case the detail is missed.

This error is coming from a Generic MQTT Thing Switch type Channel. The message received on the topic is a number instead of something that the Channel can transform/convert to an ON/OFF or OPEN/CLOSED.

rikoshak –

thanks for the direction to look for the error. yes, the rollershutter switch is what gets placed in sitemap. of the 14 rollershutters, only 1 is acting up. still not sure why the position value is not behaving the same as the other 13 shutters. i’ll keep looking for that and the source of the error.

I started with paperUI but finally figured out how to work the config files. I much prefer files over UI, being a linux / command line person. There appears to be a lot of cruft left behind by paperUI. Dead stuff…IMHO, those JSON files are a mess of prior definitions of things, etc. Am I correct that this might be where the error is being triggered?

On a side note, I’ve read LOTS of your postings. Thank you so much for what you do and the hours you put into helping others. Some day I hope to know enough to help other folks.

I’ll be entering a question related to processing members of a group. I hope you have time to read and guide.

regards…

I couldn’t say. OH doesn’t make a distinction between JSONDB defined Things and .things file defined Things. You’ll have to look at all your Switch Channels (no matter where they are defined) and see which one(s) is subscribed to a topic that has numbers published to it.

If all your Things have transitioned to .things files you can just delete the whole JSONDB Things file.

NOTE: be careful not to leave orphaned Links which are saved in a different JSONDB file.

Look at Design Pattern: Working with Groups in Rules for a start.

I’ve been researching for several days, ice/snow storms and all…lots of time available. Only then did I decide to enter a question. Thanks for the link, been there, lots of good stuff. And, I found so much that for all I know, I read and forgot the answer to my question.

Here are configs…

Shutter “thing”. I suspect this is the shutter with the errors.

Thing mqtt:topic:eab2edb0:RS_LRw_Window "RS_LRw_Window" (mqtt:broker:eab2edb0) @ "Living Room" { Channels: Type rollershutter : rschannel "Shutter" [ commandTopic="cmnd/RS_LRw_Window/shutterposition1", stateTopic="stat/RS_LRw_Window/SHUTTER1", up="up", down="down", stop="stop" ] Type switch : reachable "Available" [ stateTopic="tele/RS_LRw_Window/LWT", on="Online", off="Offline" ] Type switch: position "Shutter Position" [ stateTopic="tele/RS_LRw_Window/SENSOR", transformationPattern="JSONPATH:$.Shutter1.Position" ] Type number:rssi "RSSI" [ stateTopic="tele/RS_LRw_Window/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ] Type switch: uppower "Shutter Up" [ stateTopic="stat/RS_LRw_Window/POWER1" ] Type switch: downpower "Shutter Down" [ stateTopic="stat/RS_LRw_Window/POWER2" ] }

Shutter “items”

Rollershutter Shutter_LRw_Window "LR West Window Shutter" (gLivingDome, gAllShutters) { channel="mqtt:topic:eab2edb0:RS_LRw_Window:rschannel", channel="mqtt:topic:eab2edb0:RS_LRw_Window:position" }

Switch Shutter_LRw_Window_Available “LR West Window Shutter Status” { channel=“mqtt:topic:eab2edb0:RS_LRw_Window:reachable” }

Switch Shutter_LRw_Window_DownPower “LR West Window Shutter Down” { channel=“mqtt:topic:eab2edb0:RS_LRw_Window:downpower” }

Switch Shutter_LRw_Window_UpPower “LR West Window Shutter Up” { channel=“mqtt:topic:eab2edb0:RS_LRw_Window:uppower” }

Number Shutter_LRw_Window_RSSI “LR West Window Shutter Signal” { channel=“mqtt:topic:eab2edb0:RS_LRw_Window:rssi” }

Sitemap

Switch item=Shutter_LRw_Window icon="Rollershutter" label="LR West Window Shutter [%.0f]" visibility=[Shutter_LRw_Window_Available==ON] Text item=Shutter_Unavailable icon="Rollershutter" label="LR West Window Shutter [%s]" visibility=[Shutter_LRw_Window_Available==OFF,Shutter_LRw_Window_Available==NULL] valuecolor=["red"]

BasicUI screen shot

Why didn’t code fence make those configs horizontally scrollable??

As far as I can tell you didn’t use code fences.

```
code goes here
```

You used inline code markings

Some text `code` some more text.

That looks pretty suspicious. Whatever “Position” is, you are trying to stuff it into a switch type channel expecting ON or OFF.

OK, I see that, yet I’m doing the same thing on all of the other shutters without throwing errors. Let me move one of them to a non-zero position and see if that generates a similar error.

Let me explain why I did that. On a UI page with several shutters, I would find one of them where the position number (56 in the example) did not populate, there would be a dash only. All of the other rollershutter switches DID populate. I added the 2nd channel and then the one shutter switch with the dash began showing a position number.

I’ll undo that 2nd channel, and try that. Will report back by tomorrow.

Thanks.

OH, BTW, I used stuff per the tutorial, for my code segments. Here is the section… Use 3 backticks (```)… Or use

For the sake of clarity, a “switch” widget on a UI need not be linked to a Switch type Item.
It’s quite usual to use a “switch” widget with a RollerShutter type Item. Just so we know what we’re talking about.

When using a switch item for a rollershutter on BasicUI…there is the up / down arrow buttons as well as the center stop button. To the left of those 3 buttons is a numeric value (a dash if no value is available).

Do you know how that number (shutter position) is populated on this widget? The value is available from the SONOFF message shown below…

09:44:18 MQT: tele/RS_LRw_Window/SENSOR = {"Time":"2021-02-19T09:44:18","Shutter1":{"Position":56,"Direction":0,"Target":56}}

extracted using the following portion of the ‘thing’ / ‘channel’

	Type switch: position "Shutter Position" [
	    stateTopic="tele/Shutter1_DualR2/SENSOR",
	    transformationPattern="JSONPATH:$.Shutter1.Position"
	]

That’s a Rollershutter element on the sitemap. That element usually corresponds with a Rollershutter Item. A Rollershutter Item stores it’s state as a number between 0 and 100 (PercentType). It can also receive UP/DOWN/STOP as commands.

You’ve configured your MQTT Channel as a Switch type Channel. That can only be linked to a Switch or a Contact type Item. Neither of those can accept a number as a command or update and neither of those can store a Number.

hmm, that looks numeric to me.
I think I’d use channel type number -

Type number: position "Shutter Position" [ ...

so that I could link it to a Rollershutter type Item, which have numeric states.

OK, guys… I’ve made some changes. Removed the 2nd channel from the rollershutters items.
They no longer have the “position” included as it continues to throw that error even after changing the incorrect type from “switch” to “number”, on the position channel.

Rollershutter Shutter_LRw_Window "LR West Window Shutter" (gLivingDome, gAllShutters) { channel="mqtt:topic:eab2edb0:RS_LRw_Window:rschannel" }

Rollershutter Shutter_LRe_Window "LR East Window Shutter" (gLivingDome, gAllShutters) { channel="mqtt:topic:eab2edb0:RS_LRe_Window:rschannel" }

The rollershutter things follow…

Thing mqtt:topic:eab2edb0:RS_LRw_Window "RS_LRw_Window" (mqtt:broker:eab2edb0) @ "Living Room" {
    Channels:
        Type rollershutter : rschannel "Shutter" [ 
	    commandTopic="cmnd/RS_LRw_Window/shutterposition1", 
	    stateTopic="stat/RS_LRw_Window/SHUTTER1",
	    up="up",
	    down="down",   
            stop="stop"     
	]
        Type switch : reachable "Available" [
	    stateTopic="tele/RS_LRw_Window/LWT",
            on="Online",
	    off="Offline"
        ]
	Type number: position "Shutter Position" [
	    stateTopic="tele/RS_LRw_Window/SENSOR",
	    transformationPattern="JSONPATH:$.Shutter1.Position"
	]
	Type number:rssi "RSSI" [
	    stateTopic="tele/RS_LRw_Window/STATE",
	    transformationPattern="JSONPATH:$.Wifi.RSSI"
	]
	Type switch: uppower "Shutter Up" [
	    stateTopic="stat/RS_LRw_Window/POWER1"
	]
	Type switch: downpower "Shutter Down" [
	    stateTopic="stat/RS_LRw_Window/POWER2"
	]
}


Thing mqtt:topic:eab2edb0:RS_LRe_Window "RS_LRe_Window" (mqtt:broker:eab2edb0) @ "Living Room" {
    Channels:
        Type rollershutter : rschannel "Shutter" [ 
	    commandTopic="cmnd/RS_LRe_Window/shutterposition1", 
	    stateTopic="stat/RS_LRe_Window/SHUTTER1",
	    up="up",
	    down="down",   
            stop="stop"     
	]
        Type switch : reachable "Available" [
	    stateTopic="tele/RS_LRe_Window/LWT",
            on="Online",
	    off="Offline"
        ]
	Type number: position "Shutter Position" [
	    stateTopic="tele/RS_LRe_Window/SENSOR",
	    transformationPattern="JSONPATH:$.Shutter1.Position"
	]
	Type number:rssi "RSSI" [
	    stateTopic="tele/RS_LRe_Window/STATE",
	    transformationPattern="JSONPATH:$.Wifi.RSSI"
	]
	Type switch: uppower "Shutter Up" [
	    stateTopic="stat/RS_LRe_Window/POWER1"
	]
	Type switch: downpower "Shutter Down" [
	    stateTopic="stat/RS_LRe_Window/POWER2"
	]
}

The BasicUI is shown next. Notice that the two rollershutter switches fail to show a value for shutter position (0-100), but rather a dash mark.

And finally, from the console, you can see that the LRw shutter has a position of 56, LRe has a position of 0, yet they do not display.

openhab> smarthome:status Shutter_LRw_Window_Position
58
openhab> smarthome:status Shutter_LRe_Window_Position                                                                   
0
openhab>  

I have been chasing this for weeks with no progress. Any help or direction would really be great. Thanks.

You have

stateTopic="stat/RS_LRw_Window/SHUTTER1"

For the rollershutter channel, what does this return? Could you use:

stateTopic="tele/RS_LRe_Window/SENSOR"

For that channel istead? (With the transformation as well of course)

1 Like

Not all the bindings are very graceful about dealing with in-flight edits. Sometimes it comes right after a bundle restart.

As you’ve kept the position channel, you can temporarily link that to a number Item to see if you get the position reports that you expect.
Then follow Anders lead, and do this directly on the rollershutter channel.

Maybe your device reports position under two topics? That’s okay, we can use two channels linked to one Item technique,once you’ve sorted the channels as to topics and transforms.

OK, so the “stat” topic is only generated when the shutters are moved up or down. The “tele” topic is generated every 5 minutes.

Here is the “stat” after I moved the shutter. It contains the shutter position as SHUTTER1

10:58:41 MQT: stat/RS_LRw_Window/SHUTTER1 = 68

This console entry is immediately followed by a RESULT

10:58:41 MQT: stat/RS_LRw_Window/RESULT = {"Shutter1":{"Position":68,"Direction":0,"Target":68}}

The 5 minute “tele” looks like this.

11:02:24 MQT: tele/RS_LRw_Window/SENSOR = {"Time":"2021-02-20T11:02:24","Shutter1":{"Position":68,"Direction":0,"Target":68}}

Basically, I get the shutter position in all of these entries. Unfortunately when using the “tele” sensor channel to get position, it is throwing the error that started this discussion thread. That error goes away when I stop using the 2nd channel.

That error is very specifically about trying to shovel a numeric into an on/off state.
But we can’t be sure which channel is complaining.
If you are sure you no longer have any of those topics associated with a switch type channel
and
the binding has been restarted since the last time that you did have a switch channel
then
you’ve probably got an orphaned ghostly link in your system.