Configuration of an input state

Hello everyone
What is the best way to display the status of a discrete input in the basic ui. How can I configure my .items and .sitemap to see the state of the input?

Start here

You would bind your item to a channel or binding to link it to your mystery device
For a binary input, a Contact item type is a good match

see examples here

for how to put your new item into a sitemap


I’m trying to get the status of a wellpro 8026 on the sitemap the openhab docs I had already read that could not help me. I also have the problem that the wellpro 8025 and 8026 continue’s start to flash after I restart openhabian?Wen i mess around with modbus config it stops somethimes but i cant seem to find what the problem is.

I, just want the 8026 state to toggle from on or off every time it gets a pulse.

Good. The lights are supposed to flash when OpenHAB is polling them. Polling means that OH reads data from them, then a little while later reads them again.

I don’t know what that means exactly. Wellpro 8026 has 16 different inputs. Wellpro8026 has no outputs, so you cannot toggle it or do anything else to it.

Okay, then first you need an Item.

Modbus is a version 1.x binding, so you need to bind items in the old OopenHAB version 1 way.
That means you edit a file myfileofsomeitems.items manually.

The config part of the Item needs to refer to whatever you called the 8026 in your modbus.cfg and you need to choose which of the sixteen inputs you are interested in.
In OpenHAB, those start from 0 to 15

You should end with something like

Contact somename "My Item [%s]"  {modbus="some8026name:0"}

Now include a Text item referring to the contact’s name in your sitemap

1 Like

Thanks in advance, this helped me a lot further. My Sitemap item now works and changes status when the digital input is being served. Now I just want the digital input status to toggle between on or off each time he gets a pulse of a switch or openhab, I try to display the status of my lighting without relaying over the power circuit when I get this done, This is saving me a lot of extra relays. I think the only problem is when the electricility goes out. But I think to solve this by putting the raspberry on a ups so never falling without power. Then I use 1 digital input to see when the power goes out. The pulse relays are no problem because they stay in the same state but the dimmers go to off.I think to make a rule when the power digital input goes off to switch the dimmers off.Then state of the lighting should be good

I dont know what that means.
An input is an input, if you want it to change then you must change what is connected to it.

You might create another OpenHAB Item without any binding, and a rule that changes your new Item ON->OFF or OFF->ON when the modbus-item changes to OPEN, is that what you mean?

What I actually mean is that I want to change the status of the digital input after a pulse from on to off or off to on like a pulse relay switches from on to off or off to on with any pulse that it gets.I want the status to react the same way as a puls relay.

If you want to change the status of a digital input then you must connect something to it with a length of wire and control that something.

You can instead in OpenHAB, have some other Item that is affected both by the input-item, and by other events if you like, all under the control of rules that you write which behave however you want.

Contact myRealInput "My Input [%s]"  {modbus="some8026name:0"}
Switch myPretendItem "My Toggling Item [%s]"
rule "rule to toggle virtualitem"
   Item myRealInput changed to CLOSED
   if ( myPretendItem.state == ON) {
   } else {

1 Like

This works as i want it.But I get an error in the eclipse smarthome designer the method or field myPretendItem is undefined but it does works. I still have 1 question I have 1 8025 and 1 8026 module and the power / data led flashed constantly red / Green on both modules is this normal that they keep polling.I use an fbti chip rs485 to usb converter and that is also flashing all te time?

The relevant part of your device manual was pointed out here

My personal reply to this (and your acknowledge of it) are here

Perhaps it is not clear what “polling” means?
If you wish to complain about the way the LEDs work then you will have to go to Wellpro.
I think it would be a good idea if a red LED meant error, but it does not, and I do not sit and look at them very much.