- Platform information:
- Hardware: Raspberry Pi 4, openhab 2.5.0 via docker
- OS: raspian
- openHAB version:
- Issue of the topic:
Hi there,
After one year trying around with openhabian and gained knowledge I decided to create my setup from scratch. Furthermore I wanted to include my rollershutters to openhab.
The shutters are working using a REST interface, so I´m able to control them with my own UI since months. AFAIK the openhab rollershutter does not support http bining, so
I have per rollershutter:
- one rollershutter item
- one string item for command up
- one string item for command down
- one string item that reads back the rollershutter position
Then I have a group for rollershutters and a rule that reflects the rollershutter command to the corresponding string items.
My problem:
The first configured rollershutter does what it should, it displays the position and can be controlled via basic UI rollershutter item (UP and DOWN).
Sadly the subsequent can´t be controlled while they display their position.
I´m sure it is not a big deal to get it working, but I have no clue where to look now.
The rule is not triggered for all other rollershutters.
Items file: logo.items (truncated)
// shutter
Group:Rollershutter:OR(UP, DOWN) gShutters
Group:String gShutterCommands
Group:Number gShutterPosition
Rollershutter GF_LivingRoom_Shutter_E "Rolladen Wohnzimmer Ost [%d %%]" (gShutters)
String GF_LivingRoom_Shutter_E_Up "Rolladen Wohnzimmer Ost Up" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/east/up]" }
String GF_LivingRoom_Shutter_E_Dn "Rolladen Wohnzimmer Ost Down" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/east/down]" }
Number GF_LivingRoom_Shutter_E_Pos "Rolladen Wohnzimmer Ost Pos" (gShutterPosition) { http="<[http://127.0.0.1:5000/home/shutter/livingroom/east:10000:REGEX((.*))]", autoupdate="false" }
Rollershutter GF_LivingRoom_Shutter_SE "Rolladen Wohnzimmer Südost [%d %%]" (gShutters)
String GF_LivingRoom_Shutter_SE_Up "Rolladen Wohnzimmer Südost Up" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/southeast/up]" }
String GF_LivingRoom_Shutter_SE_Dn "Rolladen Wohnzimmer Südost Down" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/southeast/down]" }
Number GF_LivingRoom_Shutter_SE_Pos "Rolladen Wohnzimmer Südost Pos" (gShutterPosition) { http="<[http://127.0.0.1:5000/home/shutter/livingroom/southeast:10000:REGEX((.*))]", autoupdate="false" }
Rollershutter GF_LivingRoom_Shutter_SW "Rolladen Wohnzimmer West [%d %%]" (gShutters)
String GF_LivingRoom_Shutter_SW_Up "Rolladen Wohnzimmer West Up" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/southwest/up]" }
String GF_LivingRoom_Shutter_SW_Dn "Rolladen Wohnzimmer West Down" (gShutterCommands) { http=">[ON:GET:http://127.0.0.1:5000/home/shutter/livingroom/southwest/down]" }
Number GF_LivingRoom_Shutter_SW_Pos "Rolladen Wohnzimmer West Pos" (gShutterPosition) { http="<[http://127.0.0.1:5000/home/shutter/livingroom/southwest:10000:REGEX((.*))]", autoupdate="false" }
shutter.rules
rule "Rollershutter Up: Reflect command from rollershutter to string / http"
when
Member of gShutters received command UP
then
sendCommand(triggeringItem.name + "_Up", "ON")
end
rule "Rollershutter Down: Reflect command from rollershutter to string / http"
when
Member of gShutters received command DOWN
then
sendCommand(triggeringItem.name + "_Dn", "ON")
end
rule "Rollershutter Position: read position from number, convert range and set rollershutter position "
when
Member of gShutterPosition changed or
Member of gShutterPosition received update
then
val name = triggeringItem.name
val pos = (triggeringItem.state as Number)
val inv = 100 - pos
postUpdate(name.substring(0, name.lastIndexOf('_')), inv.toString)
end
2020-01-03 13:19:37.518 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E' received command DOWN
2020-01-03 13:19:37.537 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E_Dn' received command ON
2020-01-03 13:19:39.177 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E' received command DOWN
2020-01-03 13:19:39.181 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E_Dn' received command ON
2020-01-03 13:19:39.928 [vent.ItemStateChangedEvent] - GF_LivingRoom_Shutter_E_Pos changed from 100 to 93
2020-01-03 13:19:39.931 [GroupItemStateChangedEvent] - gShutterPosition changed from 100 to UNDEF through GF_LivingRoom_Shutter_E_Pos
2020-01-03 13:19:39.957 [vent.ItemStateChangedEvent] - GF_LivingRoom_Shutter_E changed from 0 to 7
2020-01-03 13:19:39.961 [GroupItemStateChangedEvent] - gShutters changed from 0 to 100 through GF_LivingRoom_Shutter_E
2020-01-03 13:19:40.743 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E' received command UP
2020-01-03 13:19:40.761 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_E_Up' received command ON
2020-01-03 13:19:46.365 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_SW' received command DOWN
2020-01-03 13:19:49.259 [ome.event.ItemCommandEvent] - Item 'GF_LivingRoom_Shutter_SW' received command UP
2020-01-03 13:19:50.539 [GroupItemStateChangedEvent] - gShutterPosition changed from UNDEF to 100 through GF_LivingRoom_Shutter_E_Pos
2020-01-03 13:19:50.543 [vent.ItemStateChangedEvent] - GF_LivingRoom_Shutter_E_Pos changed from 93 to 100
2020-01-03 13:19:50.557 [GroupItemStateChangedEvent] - gShutters changed from 100 to 0 through GF_LivingRoom_Shutter_E
2020-01-03 13:19:50.560 [vent.ItemStateChangedEvent] - GF_LivingRoom_Shutter_E changed from 7 to 0
As you can see in the logs the Shutter_E triggers the string item (http REST command) while the Shutter_SW does not triggers the command. I assume sonething with my groups or rules is wrong.
Do you have any pointers? Many thanks in advance!