Tools: openHAB Item file generator

Thanks guessed! That worked. It said no duplicate Items names requiring manual fixes. Now on to the next step in getting this up and running.

Where can I download all the mapping/transformation files. I can’t get them off of github

They’re still on github, they’ve been moved to:
openhab1-addons/features/openhab-addons-external/src/main/resources/transform at main · openhab/openhab1-addons · GitHub

In preparation for openHAB 2.0 “compatibility mode”, they were moved so OH2 users could “install” and get all the dependent components (including these transformations)

Thank you, I had found them, but is there an easier way to download then. I have to right click on raw and save link as on each individual file.

I just updated the version I keep on Box.net, it relies upon the 1.8.x version of the MiOS Binding:

https://app.box.com/s/foa7qxmerytjag2wwujmr1vpc1dlk6st

I also posted a quick way to get them here:
MiOS, where in Openhab.cfg? - #4 by RHINESEL - Bindings - openHAB Community

and updated the first page of this thread to include the same information.

How do we handle additions/deletion of devices from Vera? Deletion is simple I guess, delete the item in OpenHab. For additions though, do we have to create it or is there a way to use the generator?

Since my only devices are on the Vera I guess I could just run the script again and replace the items file with the newly generated one. But for people who have other items should they run it and copy the new items from the generated item file into the existing item file?

Sorry, thinking while typing and probably answered my own question.

Yup. openHAB supports multiple item files, so keep the generated file separate from any hand built stuff.

Then you can replace the relevant files when you need to regenerate.

[quote=“guessed, post:68, topic:185623”]Yup. openHAB supports multiple item files, so keep the generated file separate from any hand built stuff.

Then you can replace the relevant files when you need to regenerate.[/quote]

Ohhhh… didn’t realize I could have multiple item files. That makes things easier. So I can have a homeMiOS.item file and a home.item file. Then I can just keep creating a new MiOS one and switch them out when I make changes on Vera.

You can’t see it but I’m doing a little happy dance. :o

Ok. Something strange happened. Initially my items all came up… Great. Started putting items in my site map.

Opened up my site map today in Habmin and ALL the items widgets were loaded automatically in the room group widgets. Sounds good but when each device create 5, 10, or 15 (almost all you don’t care about) it’s nuts. I started deleting them from the site map but it’s taking forever. Is there a way to delete a batch of them? Is this going to happen if I run the scripts again after changes in Vera?

Probably best to ask that level of question on the openHAB Community itself. I don’t use HABmin, as I hand-crafted my UI bits, but there are a number of other users there that do use it and should be able to guide you in that component.

I’d recommend using the [tt]CATEGORIES[/tt]: “Setup, Configuration and Use”, “Beginners” and then the [tt]TAG[/tt]: “habmin”.

Thanks you actually gave me a good hint though. I just went into the sitemap file and started cutting out the text lines of all the unwanted items. Much easier to hit Control-X (Nano) a bunch of times then doing it in Habmin.

Great job with this binding Guessed!

I’ve had this working great for a while but after adding some new devices i needed to update the items file and ran into some problems.

./miosTransform.sh house
Transforming MiOS Unit Metadata from user_data.xml…
./miosTransform.sh: line 14: xsltproc: command not found
Failed to Transform, Check for bogus XML in user_data.xml.

How to fix? I transfered whole “script” folder to the pi and run it from the folder… ???

edit: Im running this from a raspberry pi that already has Openhab, and this binding working.

Hello!

I’ve installed OH2 on my RPi3 and have the mios binding working great. However, I’ve recently added a couple of new zwave sensors to my Vera and need to regenerate a new mios items file to capture the new devices.

I’ve verified the miosLoad.sh and miosTransform.sh scripts are in the /etc/openhab2/scripts directory on the Pi.

I tried to run ./miosLoad.sh and I receive the error:

-bash: ./miosLoad.sh: /bin/bash^M: bad interpreter: No such file or directory

Do the scripts run with the new OH2 setup?

Thanks in advance!

Your “miosLoad.sh” is probably in the DOS format with the CR/LF. You need to convert it to the standard LF only.

I would use Vim to change the format, but you can do it with tr as well. Sample below:

tr -d ‘\015’ <orig.sh >new.sh

I’ve never opened the script file in Windows, but I tried your command below just to be safe

tr -d ‘\015’ miosLoad.sh nmiosLoad.sh

I get the error - tr: extra operand ?miosLoad.sh?

You are missing the < and >. The < says get it from this input file, and the > says put the output into the named file.

tr -d '\015' < miosLoad.sh > nmiosLoad.sh

There are many, many ways to do this. Search Google for ‘dos2unix’ or CR/LF to LF. Your RPI3 may have dos2unix loaded or you can install it. Most text editors will also do this for you. Here’s one sample: https://www.cyberciti.biz/faq/howto-unix-linux-convert-dos-newlines-cr-lf-unix-text-format/

Getting closer, thanks SO much for helping me! I ran the tr command on both Load and Transform files. The Load ran successfully and created a user_data.xml file in my scripts directory.

I’m now getting this error when I try to run the command below:

./miosTransform.sh house

INFO: Transforming MiOS Unit Metadata from user_data.xml…
./miosTransform.sh: line 15: xsltproc: command not found
ERROR: Failed to Transform, Check for bogus XML in user_data.xml.

sudo apt-get update sudo apt-get install xsltproc

Thank you, thank you, thank you!!! That worked perfect!!