Version: 2.5.9 (Build)
System: Host: rpi3ohv2 Kernel: 5.4.51-v7+ armv7l bits: 32 Console: tty 2 Distro: Raspbian GNU/Linux 10 (buster)
I am trying to migrate from mqtt v1 to mqtt v2 on OH2.
I would like to retain my textural configuration.
I have taken the advise to create Things and channels in PaperUI.
I have done that and created a broker thing (to the existing mosquitto); works.
I created a generic mqtt thing for a Gate Controller (the most simple controller I have amongst many).
The topic id is awful. Where can I change this to something meaningful?
I have created a channel:
… which has a MQTT state topic of:
ArgyleCourt/Property/MainGate/MAC
I have linked this channel to the item:
String MainGate_MAC "MAC address [%s]" <network> (gMainGate) //{mqtt="<[mymosquitto:ArgyleCourt/Property/MainGate/MAC:state:default]"}
… commented the v1 link out.
This works.
I have then deleted the linked item, and added the channel in the item file like so:
String MainGate_MAC "MAC address [%s]" <network> (gMainGate) {channel="mqtt:topic:56873dfe:mac"}
So it seems I grasped the very basic concept of this thing/channel business.
But still, that topic is awful… I have literally 100s of these. Is there a way to change that id into something legible?
The other issue is: I have unlinked the item from the MAC address channel in PaperUI, and then added the channel in the .items
file.
While I have created new channels (Temperature and Doorbell), these showed a linked item after I added the channels to the items.
Do I have to link the MAC address channel with the item again in PaperUI? It works as it is, but PaperUI does not represent the linkage that exists in the .items
file.
String MainGate_MAC "MAC address [%s]" <network> (gMainGate) {channel="mqtt:topic:56873dfe:mac"}
Number MainGate_Temperature "Temperature at gate [%.1f °C]" <temperature> (gMainGate, MainGate_Temp_Chart) {channel="mqtt:topic:56873dfe:temperature"}
Switch MainGate_DoorBell "Door Bell Gate" {channel="mqtt:topic:56873dfe:doorbell"}
Any hints appreciated.