Hello,
I’m currently using the GlobalCache binding with an iTach Flex Serial to control my existing light system.
Every time I send a command, the light system respond with the state of all the scenes/items.
I then need to process all these responses and update my items accordingly.
It seems that there is too much informations sent back from my system to openhab for the rule to process all the state changes.
Here is the results on my current receiving Item on Openhab :
2020-01-27 17:29:49.238 [vent.ItemStateChangedEvent] - GC changed from LIGHTS_STAIRS_ON to LIGHTS_STAIRS_OFF
2020-01-27 17:29:49.355 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C63%2C0%0D to 0%2CITACH%2C1%2C0%0D
2020-01-27 17:29:49.367 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C1%2C0%0D to 0%2CITACH%2C2%2C0%0D
2020-01-27 17:29:49.380 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C2%2C0%0D to 0%2CITACH%2C3%2C0%0D
2020-01-27 17:29:49.390 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C3%2C0%0D to 0%2CITACH%2C4%2C0%0D
2020-01-27 17:29:49.402 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C4%2C0%0D to 0%2CITACH%2C5%2C0%0D
2020-01-27 17:29:49.416 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C5%2C0%0D to 0%2CITACH%2C9%2C0%0D
2020-01-27 17:29:49.421 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C9%2C0%0D to 0%2CITACH%2C10%2C0%0D
2020-01-27 17:29:49.426 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C10%2C0%0D to 0%2CITACH%2C11%2C0%0D
2020-01-27 17:29:49.503 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C11%2C0%0D to 0%2CITACH%2C13%2C0%0D
2020-01-27 17:29:49.518 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C13%2C0%0D to 0%2CITACH%2C17%2C0%0D
2020-01-27 17:29:49.536 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C17%2C0%0D to 0%2CITACH%2C18%2C0%0D
2020-01-27 17:29:49.556 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C18%2C0%0D to 0%2CITACH%2C19%2C0%0D
2020-01-27 17:29:49.572 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C19%2C0%0D to 0%2CITACH%2C20%2C0%0D
2020-01-27 17:29:49.589 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C20%2C0%0D to 0%2CITACH%2C21%2C0%0D
2020-01-27 17:29:49.599 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C21%2C0%0D to 0%2CITACH%2C22%2C0%0D
2020-01-27 17:29:49.613 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C22%2C0%0D to 0%2CITACH%2C23%2C0%0D
2020-01-27 17:29:49.621 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C23%2C0%0D to 0%2CITACH%2C24%2C0%0D
2020-01-27 17:29:49.627 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C24%2C0%0D to 0%2CITACH%2C26%2C0%0D
2020-01-27 17:29:49.631 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C26%2C0%0D to 0%2CITACH%2C27%2C0%0D
2020-01-27 17:29:49.636 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C27%2C0%0D to 0%2CITACH%2C28%2C0%0D
2020-01-27 17:29:49.643 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C28%2C0%0D to 0%2CITACH%2C29%2C0%0D
2020-01-27 17:29:49.648 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C29%2C0%0D to 0%2CITACH%2C33%2C0%0D
2020-01-27 17:29:49.654 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C33%2C0%0D to 0%2CITACH%2C34%2C0%0D
2020-01-27 17:29:49.658 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C34%2C0%0D to 0%2CITACH%2C39%2C0%0D
2020-01-27 17:29:49.661 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C39%2C0%0D to 0%2CITACH%2C40%2C0%0D
2020-01-27 17:29:49.665 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C40%2C0%0D to 0%2CITACH%2C45%2C0%0D
2020-01-27 17:29:49.669 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C45%2C0%0D to 0%2CITACH%2C50%2C0%0D
2020-01-27 17:29:49.674 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C50%2C0%0D to 0%2CITACH%2C51%2C0%0D
2020-01-27 17:29:49.710 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C51%2C0%0D to 0%2CITACH%2C52%2C0%0D
2020-01-27 17:29:49.727 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C52%2C0%0D to 0%2CITACH%2C53%2C0%0D
2020-01-27 17:29:49.738 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C53%2C0%0D to 0%2CITACH%2C60%2C0%0D
2020-01-27 17:29:49.747 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C60%2C0%0D to 0%2CITACH%2C61%2C0%0D
2020-01-27 17:29:49.758 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C61%2C0%0D to 0%2CITACH%2C62%2C0%0D
2020-01-27 17:29:49.763 [vent.ItemStateChangedEvent] - GC_RECEIVE changed from 0%2CITACH%2C62%2C0%0D to 0%2CITACH%2C63%2C0%0D
I created a rule like this one:
rule 'GC RECEIVE PROCESSOR'
when
Item GC_RECEIVE received update
then
var item_state = GC_RECEIVE.state.toString.replace("%2C", ",")
switch (item_state) {
case "0,ITACH,50,1%0D" : AC_LIVING.postUpdate(ON)
case "0,ITACH,50,0%0D" : AC_LIVING.postUpdate(OFF)
case "0,ITACH,51,0%0D" : AC_ROOMS.postUpdate(OFF)
case "0,ITACH,51,1%0D" : AC_ROOMS.postUpdate(ON)
case "0,ITACH,22,0%0D" : BOILER.postUpdate(OFF)
case "0,ITACH,22,1%0D" : BOILER.postUpdate(ON)
case "0,ITACH,23,0%0D" : FLOOR_HEAT_GREY_BATHROOM.postUpdate(OFF)
case "0,ITACH,23,1%0D" : FLOOR_HEAT_GREY_BATHROOM.postUpdate(ON)
case "0,ITACH,24,0%0D" : TOWEL_HEAT_GREY_BATHROOM.postUpdate(OFF)
case "0,ITACH,24,1%0D" : TOWEL_HEAT_GREY_BATHROOM.postUpdate(ON)
case "0,ITACH,27,0%0D" : FLOOR_HEAT_RED_BATHROOM.postUpdate(OFF)
case "0,ITACH,27,1%0D" : FLOOR_HEAT_RED_BATHROOM.postUpdate(ON)
case "0,ITACH,26,0%0D" : TOWEL_HEAT_RED_BATHROOM.postUpdate(OFF)
case "0,ITACH,26,1%0D" : TOWEL_HEAT_RED_BATHROOM.postUpdate(ON)
case "0,ITACH,45,0%0D" : LIGHTS_STAIRS.postUpdate(OFF)
case "0,ITACH,45,1%0D" : LIGHTS_STAIRS.postUpdate(ON)
default: logInfo("CMD","GC_RECEIVE " + item_state )
}
end
But the logInfo is always logging the latest state of the item (in my case 0%2CITACH%2C63%2C0%0D) for each of the values that are not defined in a case. Also every time my item GC_RECEIVE it seems to randomly drop (at last not process) some of the status changes.
I wonder if there a way to make my receiving item fast enough ?
Currently the “state” received by my global cache item is broken down into the different scene by the globalcache binding using the end of message Delimitier.
My lighting system sends a huge message with all the scenes, the global cache binding splits it into different message and update the item of each of these messages.
I might be able to remove the end of message delimiter from the globalcache rule, and split the message directly in the rule so that the item is updated only once when something changes instead of once for every scene in my lighting system.
Does someone have an idea to keep the current message delimiter and make my rule/OH process these state changes faster?
Thanks a lot