openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

Issue with Hue things -- Missing name, showing Description instead #79

Closed EdgarM73 closed 6 years ago

EdgarM73 commented 6 years ago

Hue Things are not handled proper, item creation and thing usage is not possible.

I have several Hue items, and have tham named proper in my Hue.things file.

0220 BadFenster [ lightId = "4" ] 0220 BadMitte [ lightId = "5" ] 0220 BadTuer [ lightId = "16" ]

but in VS it is shown like vs

and item creation is not really possible via automation:

Dimmer DimmbareLampeWei_Brightness "Helligkeit" {channel="hue:0100:0017882b8525:Schuhstrahler:brightness"} String DimmbareLampeWei_Alert "Alarm" {channel="hue:0100:0017882b8525:Schuhstrahler:alert"}

Dimmer DimmbareLampeWei_Brightness "Helligkeit" {channel="hue:0100:0017882b8525:Schlafzimmer3:brightness"} String DimmbareLampeWei_Alert "Alarm" {channel="hue:0100:0017882b8525:Schlafzimmer3:alert"}

any chance, this might be fixed?

regards

kubawolanin commented 6 years ago

Hi,

Could you post a formatted fragment of your http://openhab/rest/things JSON? Don't forget to format your code with code fences (```)

fab33 commented 6 years ago

@EdgarM73 : your thing file is not correct. In your things files BadFenster for exemple is the OpenHab ID you define for the thing (lightId is not an Id for openhab but a parameter for the binding). And items are created from the name and you don't define a name. Correct syntax of you things file to create items :

0220 BadFenster "BadFenster" @ "Room1"  [ lightId = "4" ]
0220 BadMitte   "BadMitte" @ "Room2" [ lightId = "5" ]
0220 BadTuer    "BadTuer" @ "Room3" [ lightId = "16" ]

After when right click on "BadFenster", it should create

Dimmer BadFenster_Brightness "Helligkeit" {channel="hue:0100:0017882b8525:Schuhstrahler:brightness"}
String BadFenster_Alert "Alarm" {channel="hue:0100:0017882b8525:Schuhstrahler:alert"}

But take care about this issue (#78) if you want to create items directly from channels.

EdgarM73 commented 6 years ago

Hi fab33,

thanks for your answer, you are totally right with your answer.

Only one thins, has nothing to do with my issue: The @ Room is not possible if i can believe VS Code here.

anyway, thanks for your help.

Issue can be closed

EdgarM73 commented 6 years ago

Issue was due to my wrong things file.