Entering keypad data into Basic UI and pass it to PaperUI-created thing/binding

Hi

I have a Powermax alarm which i have successfully connected to openHabian via serial connection using the Powermax binding, and everything is working tickety-boo.

To better the security of my system, I would like to create a keypad (much like this one: Basic UI Keypad) to enter the pin number and then pass this into the binding configuration as a variable string.

I can see that the pin code is already in the json thing file stored in plain text in /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json.

Before i start creating items/rules etc, i just wanted to test the theory, and was wondering if it is possible to update the information stored within json file with information generated in the sitemap? So changing the relevant entry in the json file with a variable obtained via sitemap/rules?

The basic plan is that i click Arm on the sitemap, this brings up the keypad, i enter the code and confirm, and the confirm then completes the command and arms the system.

If it is possible, i would be grateful for any help in pointing me in the right direction.

Thanks in advance

The json file cannot be changed manually when openHAB is running
However, you may be able to do this via the REST API:

1 Like

Thanks, i will give this a look. :slight_smile:

You solved? Could you help me? I can’t insert the code consecutively. For example, I would like to enter code 112233 and confirm the action. Then after the other functions and rules are clear to me.

Unfortunately I didn’t, REST API is a bit beyond my capabilities and with twin babies being born I never had the time to pursue this further.

The PaperUI is just for administration of OH. The Basic UI is for normal use. Why would the keypad be needed in PaperUI?

It wasn’t that the keypad that was in Paper UI, rather that it was how to create a keypad in Basic UI that interacts with a Paper UI binding, more specifically the PIN submission from the binding to the alarm system when it is required rather than having the PIN number permanently saved within the binding settings.

Does that make sense?

I believe OH is not designed to interact directly with bindings or Things in that manner.
If the code is at the Thing level perhaps the binding could expose that as a channel that could be linked to an Item and controlled that way.

Unfortunately it does appear to be at binding level and so is never actually exposed as s a channel.

I think you should make an enhancement request for the binding on github, to expose a channel for PIN.
I would imagine the alarm system is capable of exposing different features to different PIN codes, so you wouldn’t necessarily want a hard coded PIN, quite apart from any storage aspects.