Max_Bec
(Max Beckenbauer)
September 22, 2019, 10:35am
1
Hey guys,
i am searching for a tool (would be the best if it is a VSC Extension) which can align my items file in columns. How are you guys handeling the problem? And do you know a tool for it?
Fixed it myself:
Hey guys,
i just released the second major version of my openHAB Alignment Tool extension for Visual Studio Code. V2
You can find it in the Visual Studio Code Marketplace or directly in VSC. Here is the link:
https://marketplace.visualstudio.com/items?itemName=max-beckenbauer.oh-alignment-tool
The tool can only format .item-files and .sitemap files at the moment. But the other file-types will follow. You can choose between three formatting styles for items. Column, ChannelColumn or Multiline …
Thanks!
Here my problem:
Switch Sonoff_CLAS20004 "TV-Licht" <light> (Lights_ClaudiusZimmer, Lights) {channel="mqtt:topic:Sonoff_CLAS20004:switch"}
Number Sonoff_CLAS20004_RSSI "TV-Licht RSSI [%d %%]" <signal_p> (RSSI_Group) {channel="mqtt:topic:Sonoff_CLAS20004:rssi"}
Switch Sonoff_CLAS20004_Unreach "TV-Licht Offline" <siren> (Unreach_Group) {channel="mqtt:topic:Sonoff_CLAS20004:unreachable"}
String Sonoff_CLAS20004_FW "TV-Licht Firmware [v%s]" <settings> (Firmwares) {channel="mqtt:topic:Sonoff_CLAS20004:firmware"}
String Sonoff_CLAS20004_IP "TV-Licht IP [%s]" <playlist-check> (IPs) {channel="mqtt:topic:Sonoff_CLAS20004:ip"}
Should look like:
Switch Sonoff_CLAS20004 "TV-Licht" <light> (Lights_ClaudiusZimmer, Lights) {channel="mqtt:topic:Sonoff_CLAS20004:switch"}
Number Sonoff_CLAS20004_RSSI "TV-Licht RSSI [%d %%]" <signal_p> (RSSI_Group) {channel="mqtt:topic:Sonoff_CLAS20004:rssi"}
Switch Sonoff_CLAS20004_Unreach "TV-Licht Offline" <siren> (Unreach_Group) {channel="mqtt:topic:Sonoff_CLAS20004:unreachable"}
String Sonoff_CLAS20004_FW "TV-Licht Firmware [v%s]" <settings> (Firmwares) {channel="mqtt:topic:Sonoff_CLAS20004:firmware"}
String Sonoff_CLAS20004_IP "TV-Licht IP [%s]" <playlist-check> (IPs) {channel="mqtt:topic:Sonoff_CLAS20004:ip"}
Thank you guys! I hope you have some tips for me!
Kind Regards, Max
vzorglub
(Vincent Regaud)
September 22, 2019, 11:08am
2
I use the space bar…
// *********************************************
// ** GROUPS **
// *********************************************
Group House
Group GroundFloor "Downstairs" <groundfloor> (House)
Group FirstFloor "Upstairs" <firstfloor> (House)
Group Porch "Porch" <porch> (GroundFloor)
Group LivingRoom "Living Room" <sofa> (GroundFloor)
Group Kitchen "Kitchen" <kitchen > (GroundFloor)
Group Hallway "Hallway" <corridor> (GroundFloor)
Group Pantry "Pantry" <pantry> (GroundFloor)
Group Conservatory "Conservatory" <conservatory> (GroundFloor)
Group Garden "Garden" <garden> (House)
Group MasterBedroom "Master Bedroom" <bedroom> (FirstFloor)
Group LargeBedroom "Large Bedroom" <bedroom> (FirstFloor)
Group SmallBedroom "Small Bedroom" <bedroom> (FirstFloor)
Group Bathroom "Bathroom" <bath> (FirstFloor)
Group Toilet "Toilet" <toilet> (FirstFloor)
Group Landing "Landing" <corridor> (FirstFloor)
Group Loft "Loft" <attic> (FirstFloor)
Group Batteries "Batteries" <battery> (House, Persist)
Group Persist
Group Misc (House)
Group MQTTv2
// **********************************************
// ** HOUSE **
// *********************************************
String House_HomeAway "Home/Away [MAP(homeaway.map):%s]" <present> (House, Persist)
String House_Mode "House Mode [%s]" <house> (House, Persist)
String Holiday_Type "Holiday Type [%s]" (House)
String Day_Of_Week "Day of the week [%s]" (House) { mqtt=">[mybroker:Misc/DayOfWeek:state:*:default" }
String CurrentTime "Current Time [%s]" (House) { mqtt=">[mybroker:Misc/Time:state:*:default]" } //{ channel="mqtt:topic:8c4878b0:MQTT-Time" } ///
mhilbush
(Mark)
September 22, 2019, 11:24am
3
I avoid the problem completely by formatting my items this way. It makes the files longer, but I no longer spend my time messing with column formatting.
Number:Temperature Office_Temperature
"Office Temperature [%.1f °F]"
<temperature>
(gSF_Office,gSensor,gTemperature)
["Measurement","Temperature","Sensor"]
{ channel="zwave:device:zstick:node42:sensor_temperature" }
And, I use my handy VS Code extension to format (and reformat) the items…
3 Likes
Max_Bec
(Max Beckenbauer)
September 22, 2019, 3:24pm
4
I use the space bar…
That’s what i want to avoid!
I avoid the problem completely by formatting my items this way. It makes the files longer, but I no longer spend my time messing with column formatting.
Thank’s. But i prefer the line format. So i see every section of each item below each other.
wars
(Ward)
September 22, 2019, 9:54pm
5
Maybe this function can be added in the official extension? I use the formatting function for my PS1 scripts and json files all the time. Saves a lot of time!
1 Like
chriscolden
(Chris Colden)
September 23, 2019, 11:16pm
6
There is the textfx plugin for notepad++ although your mileage may vary. https://www.cathrinewilhelmsen.net/2014/10/15/notepad-column-editing/