Logging in OH2

So I am working through moving from 1.8 to 2.0. Latest build as far as I can tell.

Items are defined in Paper UI and they are working, as in I can get door icons in the classic site map to changed based on them being open or closed. I am working on rebuilding some rules…

A normal logging command written in Eclipse, this isn’t working:
logInfo(“info”, "The front door is " + FrontDoor_DoorStatus.status)

The result is “The name ‘.status’ cannot be resolved to an item or type.”

Basically the logging command cant find the item to find out its status. It is not defined in the OH 1.X items files, just as OH 2.0 Things. How can I log their status to help me write my rules?

Try .state (I think that this should work):

logInfo("info", "The front door is " + FrontDoor_DoorStatus.state)

Also: make sure that the FrontDoor_DoorStatus is a defined item (not a thing), linked to a channel of a thing.

Ah dang it. I am that rusty after all.

1 Like