I new to openhab, and have watched videos and read through the documentation but im still struggling.
I see that by using Visual source code you can import items into your .items config file, can you do the same with .things?
I have a working configuration setup through paper ui, but when I try to write my .things I seem to struggle with it working. I get ther syntax wrong.
for example, when I try to add the gateway for my xiaomi gateway hub (which for some reason I have two in paper ui, one with
âXiaomi Gatewayâ with the
Mihome:bridge:MacAddress
and another with
Xiaomi Mi Smart Home Gateway
Mihome:gateway:MacAddress
in my .thing file do I just write all this out?
Bridge mihome:bridge:MACadd âXiaomi Gatewayâ [ serialNumber=âMACaddâ, ipAddress=â192.168.xxx.xxxâ, port=9898, key=âwhatever the key wasâ, pollingInterval=600 ] {
Things:
bridge Macaddy âXiaomi Gatewayâ [itemId=âMACaddâ]
gateway Macaddy âMi Smart Home Gatewayâ [itemId=âMACaddâ]
]
is that right? even though the MAC address is the same for both?
all things appear offline, and the original autodiscovered items still appear online in configuration/things.
but now the offline things have
mihome:gateway:MACaddress:MACaddress
which doesnât see right as the online autodiscovered things just have
mihome:gateway:MACaddress
Most of the videos out there are outdatedâŠbe rather carefulâŠ
by far your best source of accurate informationâŠand this forum of course, but watch for the timestamps, OH has developed over the years and older forum posts may not be applicable anymore.
As to your question: You need to use EITHER PaperUI OR text files to define a thing or an item. You can do 95% of all operations through PaperUI, so for now maybe that is easier. You do not want to have two identical things or items defined.
OH offers options and choices in many areas, so you can work in the ways most comfortable to you; unfortunately, this can be overwhelming and confusing to beginners.
If you have accepted your things through the PaperUI, do NOT configure them as well in text files. It may help at this point to simply delete your .things files and continue to work in PaperUI only. If you still have double-entries, it may be the easiest to start over with a new clean install.
Finally, there is one area, where there is only textual configuration possible: sitemaps. (And just in case: PaperUI is for admin only; for standard use, you will need to create a sitemap.)
I really want to use the configuration files, I have read many conversations that you can loose your entire configuration and the best way is to have configs.
I have many IoT devices, and I donât want to have to recreate them (and I believe once I understand how to use these config files I will get much better at the config).
do I need to delete all the autodiscovered devices once I use the addon.cfg and the .things/.items?
If you call it simply â.thingsâ then youâre making a hidden file (filenames that start with a dot), there should be a filename prefix such as âdefault.thingsâ.