OpenHab 2.4 MySensors Binding: string: Off, from gateway could not be used as OnOff state

OpenHab 2.4 and MySensors Binding

Hi, I’m having a problem with a couple of my MySensors (Light actuators) that send “On” and “Off” messages (i.e. 5;0;1;0;2;Off) while the Light thing for the MySensors binding seems not to accpet those strings as valid OnOff states. Is there anything I can do to pre-transform the incoming strings to something valid or I will have to update my sketches on the MySensors devices for it to work?

This is what I can see in the log:

2019-06-10 09:56:09.430 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 5/4 to 2019-06-10T09:56:09.000+0200
2019-06-10 09:56:09.430 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 5;0;1;0;2;Off
2019-06-10 09:56:09.430 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 5 found in gateway
2019-06-10 09:56:09.432 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 5
2019-06-10 09:56:09.432 [ERROR] [nternal.event.MySensorsEventRegister] - Event broadcasting throw an exception
java.lang.IllegalArgumentException: String: Off, could not be used as OnOff state
	at org.openhab.binding.mysensors.converter.MySensorsOnOffTypeConverter.fromString( ~[?:?]
	at org.openhab.binding.mysensors.converter.MySensorsTypeConverter.stateFromChannel( ~[?:?]
	at org.openhab.binding.mysensors.handler.MySensorsThingHandler.handleChildUpdateEvent( ~[?:?]
	at org.openhab.binding.mysensors.handler.MySensorsThingHandler.sensorUpdateEvent( ~[?:?]
	at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.lambda$4( ~[?:?]
	at java.lang.Iterable.forEach( ~[?:?]
	at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.notifyNodeUpdateEvent( ~[?:?]
	at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.handleSetReqMessage( ~[?:?]
	at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.handleIncomingMessage( ~[?:?]
	at org.openhab.binding.mysensors.internal.gateway.MySensorsGateway.messageReceived( ~[?:?]
	at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.lambda$1( ~[?:?]
	at java.lang.Iterable.forEach( [?:?]
	at org.openhab.binding.mysensors.internal.event.MySensorsEventRegister.notifyMessageReceived( [233:org.openhab.binding.mysensors:]
	at org.openhab.binding.mysensors.internal.protocol.MySensorsAbstractConnection$ [233:org.openhab.binding.mysensors:]
	at java.util.concurrent.Executors$ [?:?]
	at [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]

Any idea of what can I try?

Thank you!

You can only use “ON” and “OFF” with a Switch. You will need to transform the “On” to “ON” and “Off” to “OFF”. I don’t know the binding, but if it supports transforms the Map transform is what you want. If not, you will either have to set up proxy Items and Rules which would be ugly, or fix your devices to send all caps.

Thanks Rich,

I was fearing this could happen, as the binding seems not to care about getting the messages transformed before evaluating them. So it looks like I’ll have to go the reflashing-devices way (they’ve been working for 3 years now, attached to a basement wall that gets wet when it rains, encased in a waterproof electric box (with openings for thermo/higro sensors and long range antenna)… so it’s gonna be fun going there with a laptop (wish me luck, I could be not returning!) :smile:

It doesn’t help you now, but I really really like some of the newer firmwares like Tasmota and ESP Easy with their OTA updates.