Hello! I know there are older solved postings about this problem, but none of them have helped.
We are on openhab 3.4.3. The task is to create a rule to send a Number (percentage) to the KNX bus to be displayed on a KNX MDT glass button.
Sending strings works fine, sending datetimes works fine, reading numbers from the KNX bus works fine, but sending numbers (from a rule or from the openhab cli with openhab:send) leads to an error message in openhab.log like:
[DEBUG] [.internal.handler.DeviceThingHandler] - None of the configured GAs on channel ‘knx:device:bridge:Tasterwerte:WR_battery_soc’ could handle the command ‘26 %’ of type ‘QuantityType’
Thing:
Thing device Tasterwerte [] {
Type number : WR_battery_soc [ ga="5.001:5/3/0" ]
}
Item:
Number:Dimensionless WR_battery_soc_fuer_Taster "Battery State of Charge (WR) [%d %%]" <batterylevel> {channel="knx:device:bridge:Tasterwerte:WR_battery_soc"}
Rule:
var temp = WR_battery_soc.state as Number
WR_battery_soc_fuer_Taster.sendCommand(temp)
What we have tried so far (all lead to the same error message; maybe with “the command ‘81 %’ of type ‘QuantityType’” or “the command ‘81’ of type ‘DecimalType’”, but the same underlying problem):
- Changes to the rule: manually casting the value to DecimalType or QuantityType, adding .intValue or .floatValue, postUpdate instead of sendCommand
- Changes to the item: Number:Dimensionless instead of Number, no label to avoid the %unit%
- Changes to the thing: removing the 5.001, number-control instead of number
Finally, looking at the code that produces the error message. That is “handleCommand()” in
/java/org/openhab/binding/knx/internal/handler/DeviceThingHandler.java:
withKNXType(channelUID, (selector, channelConfiguration) -> {
OutboundSpec commandSpec = selector.getCommandSpec(channelConfiguration, typeHelper, command);
// only send GroupValueWrite to KNX if GA is not blocked once
if (commandSpec != null
&& !groupAddressesWriteBlockedOnce.remove(commandSpec.getGroupAddress())) {
getClient().writeToKNX(commandSpec);
if (isControl(channelUID)) {
rememberRespondingSpec(commandSpec, true);
}
} else {
logger.debug(
"None of the configured GAs on channel '{}' could handle the command '{}' of type '{}'",
channelUID, command, command.getClass().getSimpleName());
}
});
→ and that doesn’t tell me anything. Why is
(commandSpec != null && !groupAddressesWriteBlockedOnce.remove(commandSpec.getGroupAddress()))
false and how can I change that?
Help please!