MQTT Setup - did it change

yes it did change.

Did you just upgrade or are you doing a new install?

I did an upgrade and my old MQTT way of working still works.
I did not change any scripts.

(I will upgrade when I have time)

Did you just upgrade or are you doing a new install? - I am starting with a new install so that I have a new fresh system.
Ok some questions, forgive me if I am missing some stuff here -

  • As 99% of my system runs off MQTT , of witch most of them was from custom design thus generic, will I need to capture every device on its own or will I be able to do it via text?
  • I noted the example of the mqtt.thing file. Will I be able to create a file as per example and OH2 will be able to detect the item as per usual? I assume that I will need to place the file in the /etc/openhab2/things folder?

Don’t quite know what you mean by capture?
Only mqtt device following the homie convention and HASS can be detected and added as things automatically by the paperUI.

Yes or the paperUI both work

Both correct

Thank you for the response! I started from scratch - as the main system is still running so I can learn the new format.
I managed to add the new MQTT connection with the new switch added. I also managed to add the switch to a new sitemap. So atleast I have managed to get that part to work. :smile:

More questions :

  • Where are the files located that is created by the paper UI and can I edit them directly or should it be moved to the default OH2 folders.
  • How can I apply a transformation to a switch state, the switch that uses reports the state in reverse so 1 = off and 0 = on. Previously I would add it the MQTT item but I can find the way to do it via the Paper UI.

See binding documentation. All mentioned options are available in Paper UI.

At the bottom of the switch thing setup after clicking SHOW MORE


Put 1 for OFF and 0 for ON
It’s a bit like the MAP transformation but more efficient

I have a similar issue here.
I receive mqtt data {device: {status: { set: 1}}} (which i am not able to change)
postswitch


I have added JSONPATH:$.device.status.set
For the On/Open value I have added 1

Switch ErIsPost "Er is post" {mqtt="<[mqtt:topic:MQTTgeneric:postSchakelaar]"}

if I don’t add the 1 in the channel setting i get an error

2019-11-09 09:35:45.680 [WARN ] [eneric.internal.generic.ChannelState] - Command '1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.1

with a 1 in it there are no errors but the switch didn’t change.

Can someone help me out.

Many thanks in advance

Was it already ON? And that’s why it didn’t change
You didn’t put a Off/Closed Value

@vzorglub
It doesn’t matter if the switch is OFF or ON and it receives 1 nothing happens .
I am not using the Off value. The Switch Item is only visible if there is mail in my house-mailbox. With the switch I reset that the mailbox is empty and the switch disappear

Turn off the Is Command option

@vzorglub
I have turned off the Is command switch no difference
There is also nothing in the log receiving the MQTT message

What is the topic?
You did not show the topic part in your screen shot

@vzorglub
The topic on the device is openHAB/brievenbus


But on the channel it is different

Your channel set up looks correct
What is you item definition, please?

Can you show me this screen? Or your equivalent

@vzorglub
my item definition is at my first post

and this is my item in the item file

Switch ErIsPost “Er is post” {mqtt="<[mqtt:topic:MQTTgeneric:postSchakelaar]"}

It is working I forgot Linked Items. Thanks a lot your picture helpt me out

That should do it:

Switch ErIsPost “Er is post” { channel="mqtt:topic:MQTTgeneric:postSchakelaar" }

This was all in the docs by the way:

Remove the link in paperUI
And do it with the item file as in the post just above. It is easier to maintain

Just adding Linked item that made it work
When i remove it in the paperUI it is not working

Yes but that config is saved in the json database to which you have no direct access.
The only way to configure it is via the paperUI. (Unless you want to start fiddling with the json database manually)
So I recommend that you remove the link in the paperUI and create the link in your items file
as I have shown you above and again here:

Switch ErIsPost “Er is post” { channel="mqtt:topic:MQTTgeneric:postSchakelaar" }

I have copied your link in my items file.
Did a reset of the openHAB Raspberry

Now it is working perfect

Many thanks @vzorglub