Modbus TCP Dimmer slider jumps up to 100% OH3

Hello, I have a lighting control via DALI running on a Wago PFC100.
I have set up the connection via Modbus TCP, created Things and created Items via the Semantic model.
I created a test page for a dimmer, created a slider and configured it. The whole thing works so far. The correct values are sent to the controller and the lamps also dim to the appropriate value.
Now to my problem.
If I set the slider to a value, e.g. 5%, then the slider jumps back to 100% or 0% after about 4 seconds without me changing anything. I have also deactivated Auto-Update, but this did not bring any improvement.
Can someone help me how to get my jumping slider under control ?
I use openHAB 3.1.0.M3 on a Windows PC.
Here is another excerpt from the log.


clip0005 (2)

Then you’re looking at what your Wago says. I’ve no idea how you program that.

My Wago receives the values correctly and the dimmer also sets itself to the correct value. The set value also remains stored in the controller but in OH the value changes back to 100%.

Alright, your Item gets a state update that you don’t expect. There are a limited number of places that can come from - the events log doesn’t say. so we have to do work to find out.

Anyone can update the state of an Item over REST API. That’s not likely to be happening without your knowledge - “they” would need to know the Item name and suitable data. Just pointing out, in case you have any external scripting acting on this Item.

The UIs issue commands,not state changes. Assuming your events.log excerpt is complete, there is no sign of unexpected command and we can rule that out.

Leaving the most obvious candidate, the Modbus channel linked to your Item.
May we see your Item definition, any profile on the channel link, your data Thing configuration?

Have you linked your Item twice, to both a dimmer and a switch channel?

I have configured the item as a dimmer only. At the moment I did not use any scripts.
I have not created any switches for the item.

Here is an excerpt of the Item and Thing configuration:
Item
[
{
“members”: [],
“link”: “http://localhost:8080/rest/items/ModbusData32000”,
“state”: “NULL”,
“editable”: true,
“type”: “Group”,
“name”: “ModbusData32000”,
“label”: “Modbus Data 32000”,
“category”: “light”,
“tags”: [
“Equipment”
],
“groupNames”: []
},
{
“link”: “http://localhost:8080/rest/items/ModbusData32000_ValueasDimmer”,
“state”: “100”,
“editable”: true,
“type”: “Dimmer”,
“name”: “ModbusData32000_ValueasDimmer”,
“label”: “Value as Dimmer”,
“category”: “light”,
“tags”: [
“Point”
],
“groupNames”: [
“ModbusData32000”
]
}
]

Things
[
{
“statusInfo”: {
“status”: “ONLINE”,
“statusDetail”: “NONE”
},
“editable”: true,
“label”: “Modbus Data 32000”,
“bridgeUID”: “modbus:poller:00ece46b33:ff50be9a84”,
“configuration”: {
“readValueType”: “float32_swap”,
“readTransform”: “default”,
“writeType”: “holding”,
“writeTransform”: “default”,
“readStart”: “32000”,
“updateUnchangedValuesEveryMillis”: 1000,
“writeValueType”: “float32_swap”,
“writeMultipleEvenWithSingleRegisterOrCoil”: false,
“writeMaxTries”: 3,
“writeStart”: “32000”
},
“properties”: {},
“UID”: “modbus:data:ff50be9a84:af7feab4e6”,
“thingTypeUID”: “modbus:data”,
“channels”: [
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:number”,
“id”: “number”,
“channelTypeUID”: “modbus:number-type”,
“itemType”: “Number”,
“kind”: “STATE”,
“label”: “Value as Number”,
“description”: “Number item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:switch”,
“id”: “switch”,
“channelTypeUID”: “modbus:switch-type”,
“itemType”: “Switch”,
“kind”: “STATE”,
“label”: “Value as Switch”,
“description”: “Switch item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:contact”,
“id”: “contact”,
“channelTypeUID”: “modbus:contact-type”,
“itemType”: “Contact”,
“kind”: “STATE”,
“label”: “Value as Contact”,
“description”: “Contact item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [
“ModbusData32000_ValueasDimmer”
],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:dimmer”,
“id”: “dimmer”,
“channelTypeUID”: “modbus:dimmer-type”,
“itemType”: “Dimmer”,
“kind”: “STATE”,
“label”: “Value as Dimmer”,
“description”: “Dimmer item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:datetime”,
“id”: “datetime”,
“channelTypeUID”: “modbus:datetime-type”,
“itemType”: “DateTime”,
“kind”: “STATE”,
“label”: “Value as DateTime”,
“description”: “DateTime item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:string”,
“id”: “string”,
“channelTypeUID”: “modbus:string-type”,
“itemType”: “String”,
“kind”: “STATE”,
“label”: “Value as String”,
“description”: “String item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:rollershutter”,
“id”: “rollershutter”,
“channelTypeUID”: “modbus:rollershutter-type”,
“itemType”: “Rollershutter”,
“kind”: “STATE”,
“label”: “Value as Rollershutter”,
“description”: “Rollershutter item channel”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:lastReadSuccess”,
“id”: “lastReadSuccess”,
“channelTypeUID”: “modbus:last-successful-read-type”,
“itemType”: “DateTime”,
“kind”: “STATE”,
“label”: “Last Successful Read”,
“description”: “Date of last read”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:lastReadError”,
“id”: “lastReadError”,
“channelTypeUID”: “modbus:last-erroring-read-type”,
“itemType”: “DateTime”,
“kind”: “STATE”,
“label”: “Last Erroring Read”,
“description”: “Date of last read error”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:lastWriteSuccess”,
“id”: “lastWriteSuccess”,
“channelTypeUID”: “modbus:last-successful-write-type”,
“itemType”: “DateTime”,
“kind”: “STATE”,
“label”: “Last Successful Write”,
“description”: “Date of last write”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
},
{
“linkedItems”: [],
“uid”: “modbus:data:ff50be9a84:af7feab4e6:lastWriteError”,
“id”: “lastWriteError”,
“channelTypeUID”: “modbus:last-erroring-write-type”,
“itemType”: “DateTime”,
“kind”: “STATE”,
“label”: “Last Erroring Write”,
“description”: “Date of last write error”,
“defaultTags”: [],
“properties”: {},
“configuration”: {}
}
]
},
{
“statusInfo”: {
“status”: “ONLINE”,
“statusDetail”: “NONE”
},
“editable”: true,
“label”: “Modbus TCP Slave”,
“configuration”: {
“rtuEncoded”: false,
“timeBetweenTransactionsMillis”: 60,
“connectMaxTries”: 1,
“reconnectAfterMillis”: 0,
“port”: 502,
“timeBetweenReconnectMillis”: 0,
“host”: “192.168.178.25”,
“connectTimeoutMillis”: 10000,
“id”: 1,
“enableDiscovery”: false
},
“properties”: {},
“UID”: “modbus:tcp:00ece46b33”,
“thingTypeUID”: “modbus:tcp”,
“channels”: []
},
{
“statusInfo”: {
“status”: “ONLINE”,
“statusDetail”: “NONE”
},
“editable”: true,
“label”: “Regular Poll register 32000”,
“bridgeUID”: “modbus:tcp:00ece46b33”,
“configuration”: {
“start”: 32000,
“length”: 2,
“refresh”: 500,
“maxTries”: 3,
“cacheMillis”: 50,
“type”: “holding”
},
“properties”: {},
“UID”: “modbus:poller:00ece46b33:ff50be9a84”,
“thingTypeUID”: “modbus:poller”,
“channels”: []
}
]

I was concerned you had linked your Item to Modbus data Thing twice - once to the dimmer channel, once to the switch channel. That’s what the sidebar screenshot suggests. But there is no sign of that.

So far as I can see, the binding is receiving data 100 from your Modbus slave.

Your next move would be to put the binding to TRACE logging to see what it really receives.

Maybe before that, restart the binding in case you have lingering ghostly links from some editing?

Hmm this gives me strong deja vu

The Dimmer example in docs should at least work

Yes, here we have it Update Values in App and BasicUI - #23 by ssalonen

The automatic conversion happening with Dimmer items seems to prefer on/off = 0/100 interpretation. By having transformation, even that dummy identity transformation, it goes correctly.

This is buried in the docs Modbus - Bindings | openHAB

The default is to convert non-zero numbers to ON/OPEN, and zero numbers to OFF/CLOSED, respectively. If the item linked to the data channel does not accept these states, the number is converted to best-effort-basis to the states accepted by the item.

With Dimmer item the ON/OFF unfortunately takes precedence over the numeric value

And having autoupdate enabled completes the picture for what’s going on in the sidebar.

1 Like

Thank you guys!

The tip, transformation in percent, helped.
Of course, the dimmer item wants percent or on/off. The OH dimmer cannot do anything with the decimal values I have written or read

Great! Please mark the post as answer