RF Button with Paper UI

I am trying to use RF buttons in the Paper UI.

I can create channel under RF bridge with;
tele/rf_bridge/RESULT
and set the Custom On/Open Value to
4065D4
and, Incoming Value Transformations
JSONPATH:$.RfReceived.Data

this actaully works fine.
I can then add my item, and bingo, the item update when i get the RF message.

However, should a press any other button, that the one in the channel, I get a message in the logs, like;

2020-09-29 16:32:28.557 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command ‘4065D1’ not supported by type ‘OpenCloseValue’: No enum constant org.eclipse.s

this starts to fill the logs very quick with spam the more RF things I have. For each one the is right I get a message in the logs complaining for every other RF that doesn’t match the ID… it feels very messy.

Is there a cleaner way to get an RF button to work when configured in paperUI? so an RF button changes a Item… cleanly.?

I think you’re going to have to show us your Thing, Channel and Item definitions, and the incoming JSON strings. If they’re from configuration files please use code fences

```
like this
```

Here (above) is the MQTT thing in paper UI.

==> /var/log/openhab/openhab.log <==
2020-09-29 18:07:41.345 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.4065D1
2020-09-29 18:07:41.346 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.4065D1
2020-09-29 18:07:41.346 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.4065D1
2020-09-29 18:07:41.346 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.4065D1
2020-09-29 18:07:41.346 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.4065D1
2020-09-29 18:07:41.346 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.4065D1
2020-09-29 18:07:41.347 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '4065D1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.4065D1

And above is the log file. I get something in the log for every Channel item configured as above, which WASN’'T the 4065D1 channel.

The issue appears to be that you need to create a channel that gets ALL the RF messages, rather than being able to create a channel for just the one you are interested in. You can filter it to work because only message you are interested in will match, but then, the thing complains about all the ones that done match the filter…

You really need to be able to create a channel ONLY for 4065D1. Which this does kinda, but it just complains about any that don’t match.

these are what comes from the RF bridge as different buttons are pressed on the RF remote

18:20:52 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-29T18:20:52","RfReceived":{"Sync":12460,"Low":410,"High":1230,"Data":"4065D1","RfKey":"None"}}
18:20:53 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-29T18:20:53","RfReceived":{"Sync":12490,"Low":420,"High":1230,"Data":"4065D8","RfKey":"None"}}
18:20:54 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-29T18:20:54","RfReceived":{"Sync":12460,"Low":420,"High":1230,"Data":"4065D1","RfKey":"None"}}
18:20:54 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-29T18:20:54","RfReceived":{"Sync":7170,"Low":430,"High":1220,"Data":"4065D8","RfKey":"None"}}
18:20:56 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-29T18:20:56","RfReceived":{"Sync":12470,"Low":440,"High":1210,"Data":"4865D1","RfKey":"None"}}

The DATA part is different based on which button was pressed

I hope that’s clearer.

Recent similar post -

Thanks,

That looks very promising :slight_smile:
But what is this character??
image
I dont see how to enter it??

I cut and paste it inot my config, but it just gets reverted to a ? (unknown) …
image

Never ever seen it before!! :slight_smile:

The first time I save it it works (after cut&paste the funny char) but if i save it again, it goes back to a ? and doesn’t work. Same if I save another channel, it will break the one that’s working… I’m guessing it’s some kind of encoding issue when it writes the json config file, then reloads it?? I can’t use a more standard char?? btw… I dont something similar with the ‘o’ char in degrees centigrade. I can cut&paste that from the example page, but it never gets saved right, end appears as ? in habpanel and such…

Explanation is right there in the words underneath the box you paste it into in PaperUI.
Also in the binding docs, keyword “chained”

I think you are correct, some kind of encoding issue with your character set.
This seems closely related -

Thank you all, after getting to the bottom of those few things, that is all working a treat now :slight_smile:

Much apprecaited!

Can you spell out how you fixed it? It’d be useful for the next person.

Of course.

Firstly, these are the messages I get from my RF Bridge, as buttons are pressed or other sensors activate. The only thing that changes for a different device is the value for Data;

12:16:43 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-30T12:16:43","RfReceived":{"Sync":12480,"Low":420,"High":1230,"Data":"4065D4","RfKey":"None"}}
12:16:46 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-30T12:16:46","RfReceived":{"Sync":12520,"Low":420,"High":1230,"Data":"4065D8","RfKey":"None"}}
12:16:48 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-30T12:16:48","RfReceived":{"Sync":12160,"Low":440,"High":1220,"Data":"4065D1","RfKey":"None"}}
12:16:51 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-30T12:16:51","RfReceived":{"Sync":12490,"Low":410,"High":1230,"Data":"4065D1","RfKey":"None"}}
12:16:54 MQT: tele/rf_bridge/RESULT = {"Time":"2020-09-30T12:16:54","RfReceived":{"Sync":12490,"Low":420,"High":1230,"Data":"4065D4","RfKey":"None"}}

Setting a channel for each RF event was done like this;
image

Because each device sends the same topic, all the channels get all the event for each button/sensor.

Originally, I used this at the Transformation;

JSONPATH:$.RfReceived.Data

This functionally worked, but the logs filled with errors for all the channels which received the topic, but were not the correct ID number.

To fix this, the Transformation was changed to;

REGEX:(.*4065D4.*)∩JSONPATH:$.RfReceived.Data

This filtered out the messages that were not for the correct device, without leaving errors in the logs.

I had 2 errors getting this to work. Firstly ensure you have the following bindings installed to make this work;
image

Secondly, I had issues with the “∩” which is required to get this to work
image
I was able to paste it correctly and it worked for a while but the character reverted to a ? when I changed any other channel for the thing. This seem to be because of the encoding used to write the json config files back.

To fix this I needed to edit the file on the server called;

/openhab/runtime/bin/setenv

and make this change;
image

Then restart openhab.

After this, the config files were saved correctly and all worked.

I hope this might be useful to someone else. And special thanks to @rossko57 for doing such a good job at pointing me to relevant threads of help.

1 Like