[SOLVED] PaperUI: possible to clone items?

Hey everybody,

Search so far has mostly yielded results of people having problems with duplicate items showing up. But I actually want to duplicate something.

Ok, background:

So far I only had a very basi openhab2 Installation that I was using with the mqtt legacy binding to controll my sonoff devices. Since I’m renovating a few rooms now, I want to do more with openhab and migrate my other hardware. I also want to use more of a graphical UI, so I decided to set up a new installation and with the new mqtt binding, move everything to Paper UI. Thanks to the excellent guides in this forum I figured it all out (although I set up mosquito again, the internal broker just kept crashing) and have my sonoff 4chan now running with all the channels in paper ui - neat!

Now, I have 5 more sonoff devices that I want to integrate.

I am looking for a funtionality like this:
clone/duplicate a thing, create a new ID and it would be best if it is disabled after cloning.

Then I want to change the name and edit the mqtt channel to adapt it for the new device, enable the thing again … and done.

But it doesn’t seem possible in paper ui? Or am I missing something, can you really not clone items? That was very easy with the config files. Is it possible for paper ui items to do this on the console?

Correct

No, you can’t clone things either

You can still do this with the config files
For some bindings where you have lots of things, it mights be useful to use the text things files instead of the paperUI. This way you can copy and paste your things and just change the names and topics as required.

For MQTT currently I have:

Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [ 
  host="192.168.0.34",
  secure=false,
  port=1883,
  qos=0,
  retain=false,
  clientid="Oh2Mqtt2Thing",
  //certificate="",
  //certificatepin=false,
  //publickey="",
  //publickeypin=false,
  keep_alive_time=30000,
  reconnect_time=60000,
  //lastwill_message="",
  //lastwill_qos=1,
  //lastwill_topic="",
  username="username",
  password="password"
]
{
    //*****************
    //** THERMOSTATS **
    //*****************

    // *** PORCH ***
    Thing topic PorchThermostat "Porch Thermostat" {
        Channels:
            Type string : Mode "Mode" [
                stateTopic="House/Porch/Thermostat/Mode",
                commandTopic="House/Porch/Thermostat/Mode",
                allowedStates="off,heat"
            ]
            Type number : Target "Target" [
                stateTopic="House/Porch/Thermostat/Target"
            ]
            Type number : Ambient "Ambient" [
                stateTopic="House/Porch/Thermostat/Ambient"
            ]
            Type number : Humidity "Humidity" [
                stateTopic="House/Porch/Thermostat/Humidity",
                min=0,
                max=100
            ]
            Type number : Battery "Battery" [
                stateTopic="House/Porch/Thermostat/Battery",
                min=0,
                max=100
            ]
    }

    // *** HALLWAY ***
    Thing topic HallwayThermostat "Hallway Thermostat" {
        Channels:
            Type string : Mode "Mode" [
                stateTopic="House/Hallway/Thermostat/Mode",
                commandTopic="House/Hallway/Thermostat/Mode",
                allowedStates="off,heat"
            ]
            Type number : Target "Target" [
                stateTopic="House/Hallway/Thermostat/Target"
            ]
            Type number : Ambient "Ambient" [
                stateTopic="House/Hallway/Thermostat/Ambient"
            ]
            Type number : Humidity "Humidity" [
                stateTopic="House/Hallway/Thermostat/Humidity",
                min=0,
                max=100
            ]
            Type number : Battery "Battery" [
                stateTopic="House/Hallway/Thermostat/Battery",
                min=0,
                max=100
            ]
    }

    // *** KITCHEN ***
    Thing topic KitchenThermostat "Kitchen Thermostat" {
        Channels:
            Type string : Mode "Mode" [
                stateTopic="House/Kitchen/Thermostat/Mode",
                commandTopic="House/Kitchen/Thermostat/Mode",
                allowedStates="off,heat"
            ]
            Type number : Target "Target" [
                stateTopic="House/Kitchen/Thermostat/Target"
            ]
            Type number : Ambient "Ambient" [
                stateTopic="House/Kitchen/Thermostat/Ambient"
            ]
            Type number : Humidity "Humidity" [
                stateTopic="House/Kitchen/Thermostat/Humidity",
                min=0,
                max=100
            ]
            Type number : Battery "Battery" [
                stateTopic="House/Kitchen/Thermostat/Battery",
                min=0,
                max=100
            ]
    }

    // *** SMALL BEDROOM ***
    Thing topic SmallBedroomThermostat "Small Bedroom Thermostat" {
        Channels:
            Type string : Mode "Mode" [
                stateTopic="House/SmallBedroom/Thermostat/Mode",
                commandTopic="House/SmallBedroom/Thermostat/Mode",
                allowedStates="off,heat"
            ]
            Type number : Target "Target" [
                stateTopic="House/SmallBedroom/Thermostat/Target"
            ]
            Type number : Ambient "Ambient" [
                stateTopic="House/SmallBedroom/Thermostat/AmbientTemp"
            ]
            Type number : Humidity "Humidity" [
                stateTopic="House/SmallBedroom/Thermostat/Humidity",
                min=0,
                max=100
            ]
            Type number : Battery "Battery" [
                stateTopic="House/SmallBedroom/Thermostat/Battery",
                min=0,
                max=100
            ]
    }

    // *** LARGE BEDROOM ***
    Thing topic LargeBedroomThermostat "Large Bedroom Thermostat" {
        Channels:
            Type string : Mode "Mode" [
                stateTopic="House/LargeBedroom/Thermostat/Mode",
                commandTopic="House/LargeBedroom/Thermostat/Mode",
                allowedStates="off,heat"
            ]
            Type number : Target "Target" [
                stateTopic="House/LargeBedroom/Thermostat/Target"
            ]
            Type number : Ambient "Ambient" [
                stateTopic="House/LargeBedroom/Thermostat/AmbientTemp"
            ]
            Type number : Humidity "Humidity" [
                stateTopic="House/LargeBedroom/Thermostat/Humidity",
                min=0,
                max=100
            ]
            Type number : Battery "Battery" [
                stateTopic="House/LargeBedroom/Thermostat/Battery",
                min=0,
                max=100
            ]
    }
}

Dang! Thanks for the confirmation. So that’s 1:0 for the config files so far.

If I properly create the config files, they should show up in paper ui as well . right? Or does it only show stuff from the internal files?

Correct, you will see the things in the paperUI with the channels and items links.
BUT your won’t be able to edit them in the paperUI.

1 Like

Thanks again!

So I have now converted to v3, using the ui only and now I need to re-instate my things and config files as I cannot clone an item? This is a little restrictive, as I have 6 of some devices and just keeping the naming convention the same is so tedious.
Is there a better solution when I introduce a new device that is identical to an existing device?
Cheers

1 Like