ok.. i changed both items from “Rollershutter” to “Switch”
2019-01-07 15:23:45.829 [ome.event.ItemCommandEvent] - Item 'Rollershutter_buero' received command DOWN
2019-01-07 15:23:45.843 [vent.ItemStateChangedEvent] - Rollershutter_buero changed from 0 to 100
2019-01-07 15:23:45.872 [ome.event.ItemCommandEvent] - Item 'Rollershutter_buero_down' received command ON
2019-01-07 15:23:45.882 [nt.ItemStatePredictedEvent] - Rollershutter_buero_down predicted to become ON
2019-01-07 15:23:45.897 [vent.ItemStateChangedEvent] - Rollershutter_buero_down changed from OFF to ON
2019-01-07 15:23:45.899 [INFO ] [rthome.model.script.STARTING TIMER :] - Rollershutter_buero_down
2019-01-07 15:23:46.156 [INFO ] [smarthome.model.script.TIMER EXECUTE] - Rollershutter_buero_down
2019-01-07 15:23:46.168 [vent.ItemStateChangedEvent] - Rollershutter_buero_down changed from ON to OFF
2019-01-07 15:23:46.358 [vent.ItemStateChangedEvent] - Rollershutter_buero_down changed from OFF to ON
2019-01-07 15:23:51.666 [vent.ItemStateChangedEvent] - Buero_Pos changed from 0.0 to 21.568628311157227
2019-01-07 15:23:56.914 [vent.ItemStateChangedEvent] - Buero_Pos changed from 21.568628311157227 to 43.52941131591797
2019-01-07 15:24:02.041 [vent.ItemStateChangedEvent] - Buero_Pos changed from 43.52941131591797 to 65.09803771972656
2019-01-07 15:24:07.192 [vent.ItemStateChangedEvent] - Buero_Pos changed from 65.09803771972656 to 86.66667175292969
2019-01-07 15:24:12.367 [vent.ItemStateChangedEvent] - Buero_Pos changed from 86.66667175292969 to 100.0
now the timer is triggered.. it turns it to off and after some milliseconds back to on?
Yes. What value does it take, OH wants a 0-100% for rollershutters, so you might need to scale it.
Is this the B_Pos modbus data thing? You should be able to link that channel directly to your Rollershutter_buero Item. Also use autoupdate="false" to prevent commands messing it up.
rule "reset rollershutter commands"
when
Item Rollershutter_buero_up received command ON or
Item Rollershutter_buero_down received command ON
then
logInfo("STARTING TIMER :", triggeringItem.name.toString)
createTimer(now.plusMillis(250), [ |
logInfo("TIMER EXECUTE", triggeringItem.name.toString)
triggeringItem.postUpdate(OFF)
])
end
triggeringItem.postUpdate(OFF)
I changed this entry to triggeringItem.sendCommand(OFF)
rule "reset rollershutter commands"
when
Item Rollershutter_buero_up received command ON or
Item Rollershutter_buero_down received command ON
then
logInfo("STARTING TIMER :", triggeringItem.name.toString)
createTimer(now.plusMillis(250), [ |
logInfo("TIMER EXECUTE", triggeringItem.name.toString)
//triggeringItem.postUpdate(OFF)
triggeringItem.sendCommand(OFF)
])
end
now it turns correctly to false in my Wago SPS!
but one thing is open now… i tried to integrate the Buero_pos (status of my rollershutter) to the item Rollershutter_buero like this:
Add autoupdate="false" to Rollershutter_buero to make that go away.
As I said, you may have to do some scaling of shutter position to fit into an openHAB Rollershutter Item type, That expects a value between 0-100.
Looking at your logs from earlier, Beuro_Pos is taking values 0-100 , and 100 appears to mean “down”. All good so far.
But it fails!
My guess is that the OH Rollershutter Item wants its 0-100 value as an Integer.
Maybe that’s a change you can make in the Wago ?
Or you can use a javascript transform to do that neatly.
Or just to try it out -
(remove the modbus binding from Rollershutter_buero for this test)
rule "copy shutter position"
when
Item Buero_pos updated
then
Rollershutter_buero.postUpdate( ((Buero_pos.state) as Number).intValue )
end
ok.. i added autoupdate=“false” to Rollershutter_buero!
I´ve added the rule you mentioned and i get following error in the logfile.
2019-01-09 14:07:19.581 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'modbus.rules' has errors, therefore ignoring it: [17,4]: no viable alternative at input 'updated'
This is the line “Item Buero_pos updated” of the rule
rule "copy shutter position"
when
Item B_Pos updated
then
Rollershutter_buero.postUpdate( ((B_Pos.state) as Number).intValue )
end
I still get following errors in the Logfiles:
2019-01-10 10:16:02.359 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'modbus.rules' has errors, therefore ignoring it: [18,4]: no viable alternative at input 'updated'