"Code" qustions and "Category"

Note: I happen to be running Windows 10, OH 3.4.2

I think I’ve pretty well got the basics down now. About time to move on from the Newbie Beginner group, I think. I do have a few parting questions, comments, and feel free to guide me to a better area to start asking these questions.

  1. “Code” for Locations (Home Page)

    config:
    cardOrder:
    - separator: Ground Floor
    - GF_Living
    - GF_Corridor
    - GF_Kitchen
    - GF_Toilet
    - gGF
    - separator: First Floor

– Is there a way to add separators from the UI? Or do you have to add via Code (which is fine)
– The inclusion of gGF (As an example) which does not have a “card” on the page. I assume that this top-level group is there just in case I want to add something like… overall averages maybe(?) for the entire ground floor in its own card? And if no items are assigned to that “card”, it simply does not display?

  1. Categories

A lot of what is here is very… European. And that’s fine. It would be nice to add some Americanized versions of a few things, however. And a few totally missing category types. I can make suggestions? Or, when I get ambitious, I can pull the code and add them myself?

Note that Symantics have just about everything. But the same things don’t have equivilents in Categories.

In North America, we have Basements - not Cellars. Just be nice to have the term added pointing to the same place as cellar.

We have something known (by a few names, but in particular) as a Sunroom. A porch with windows. Kind of a progression of Patio > Porch (has a roof) > Screen Porch (well… has screens) > and Sunroom (fully enclosed, but not totally weathertight like the house). There is nothing in categories for this, hence no usable picture.

Garden > Yard. It would be nice to have the category Yard which points to the same thing as Garden.

It would be nice to have a category that includes a 1 story house picture. “Main Floor” would be the only floor, and Basement would be… well, the cellar.

We have a lot of houses with “Sheds”. Small outside in the yard (garden?) storage building. “Not a Greenhouse”. Would be nice to have this added overall.

  1. Security, Cameras (outdoor), motion sensors, doorbells.

This will be general questions which are certainly now best asked elsewhere.

Navigate to the Overview page and click the pencil icon in the right. Click the black menu Item next to the card you want to add the seperater before.

It’s there because you have a Group named gGF which was assigned a Location tag. All Locations will appear in the list. However, as you surmise, only those that have something in them (Equipment, Points) will cause the Locations tab to render a card for it.

As for why you created a gGF Group and put it into your semantic model only you can answer. It makes sense to help organize the rooms. But if all it has in it are other Locations, it won’t render a card on the Locations tab.

See Items | openHAB. Category is just a way to assign an icon to an Item in the admin portions of MainUI, That link provides instructions for how to add your own icons which, in turn, adds new categories.

There are lots of threads on doorbells. For cameras see the IP Camera add-on.

1 Like

I guess I do need one clarification (for WIndows in particular?)

The root of Openhab - is it Openhab-3.4.2? Or Openhab-3.4.2\UserData? so \icons\classic would be under userdata? (same with the background pictures - would it be userdata\static.…?)

See Windows | openHAB. Though, unfortunately the table doesn’t really correspond to the “environment variable names” (e.g. $OPENHAB_CONF) is not clear.

Variable Windows Location Name Example
$OPENHAB_HOME Where ever you unzipped openHAB to c:\openhab.
$OPENHAB_CONF Site Configuration $OPENHAB_HOME/conf
$OPNEHBAN_USERDATA Userdata like rrd4j databases $OPENHAB_HOME/userdata

You’ll find the icons/classic folder already exists with a readme.txt file in it. This will be true of almost all the folders referenced in the docs. If you don’t see at least the root folder already there, you might be looking in the wrong location (exceptions are Ephemeris I think and the Exec binding whitelist).

Any config you do manually through text files for OH will be done somewhere in $OPENHAB_CONF which you might also see referenced as $OPENHAB_CONF or $OH_CONF as a shorthand since the specific location depends on how you installed and on what operating system (e.g. $OH_CONF might be /etc/openbhab on Linux, c:\openhab\conf on Windows, /openhab/conf in the Docker container, etc.

Most of the stuff handled through MainUI gets saved to $OPENHAB_USERDATA or $OH_USERDATA which similarly differs based on where and how it’s installed (e.g. /var/lib/openhab on Linux, c:\openhab\userdata on Windows, /openhab/userdata in the Docker container.

1 Like

Rich,

Finally getting around to checking my system. What you say mostly makes sense. However… My file structure is here (I don’t seem to have the $OPENHAB variables defined which may be an issue)

c:\openhab-3.4.2

 \addons

 \conf
      \html
      \icons\classic
      \items
      \persistence
      \rules
      \sitemaps
      \sounds
      \things
      \transform
      \scripts
      \automation
      \services

 \runtime

 \userdata
      \cache
      \config
      \etc
      \jsondb
      \kar
      \logs
      \marketplace
      \openhabcloud
      \persistence
      \secrets
      \tmp
      \zigbee

As you can see, things like icons etc are indeed in the \conf directory. But, other than readme’s, there is NOTHING in there although I have things and items and locations and…

Under UserData, the ONLY place where any useful info is happens to be in the jasondb directory in jason files.

Is this normal?

Looks like if I want to globally rename something that I screwed up, I can do a (careful) text search and replace in the JASON and restart openhab?

Yes. Anything done in MainUI is stored in JSON DB files, and these are all in the userdata/jsondb folder. The conf folders are for text configuration, so they should be empty if you haven’t done any of that.

Do not edit JSON while openHAB is running. You need to stop OH, edit your file, and then start OH.

1 Like

Those are just used as a short hand. You know where and how you installed OH and it’s really tedious to have to say

go to c:\openhab\conf on Windows assuming you installed it there, /home/<username>/openhab on Mac assuming you installed it there, /etc/openhab on Linux unless you installed it manually in which case /opt/openhab/conf assuming you installed it there, /openhab/conf inside a Docker container but of course you should have a volume mapped and the mapped folder is :person_shrugging:, on openHABian the SAMBA shares is SMB:\\openhabian\userdata, ...

each and every time we need to say "go look in the conf folder. So we use $OH_CONF as a stand-in for all that and it’s up to you to know how you installed OH and on what platform to translate that to the actual folder in your installation. Many of us will create environment variables ourselves to make navigating to important folders easier and I know that openHABian will create environment variables for you, but a manual install isn’t going to have that by default because a manual install is just an unzip.

Right, nothing will be there until you put it there. the $OH_CONF folder is where you put your text based configs (i.e. any config not done through the UI). If you used .items files instead of MainUI to create your Items, you’d have files under \items (but of course you would know that because you would have placed them there. But you didn’t so that folder is empty.

There are still a few things that cannot be done through the UI:

  • transformations
  • persistence configuration
  • Exec binding whitelist
  • custom Ephemeris configs
  • custom icons
  • custom static web pages

All those will have to be done in the $OH_CONF folder unless and until they get implemented in the UI (tranformations and persistence is on the way, it doesn’t make sense to allow editing the whitelist through the UI though so that should never be supported).

Yes.

Depends on the nature of the “name”. If it’s an Item name than yes, you could edit the JSONDB files yourself, though be sure to stop OH first. OH doesn’t monitor those files for changes and will overwrite your changes next time it dumps the DB in memory back to those files. Honestly, most of the time it’s often easier to delete and recreate the entity with the new name, or just fix the “Label” and ignore the “bad” Item name. Most of the time, it’s the label that you see anyway.

Keep in mind that for Items the name is it’s unique ID. So if you rename an Item, that Item will become disconnected from it’s persistence data.

Thanks. The UI / Not UI creation comment explained a LOT!