Water Tank Monitoring

Someone could tell me how I could monitor my water tank with reed switches?
I already have them installed as Contacts on OH, but they are three sensors, and I want to put them all together in only one item. How could I do this?

They are installed as shown below:

This picture nor is your description anywhere near detailed enough to answer your question. How do these switches work together? It isn’t even clear where on that diagram the sensors are located. There is a total of 6 possible combinations of OPEN/CLOSED with three reed sensors but you provide no information about what the six possible combinations actually mean?

So the best we can provide is the general:

  • create a proxy Item to represent the tank
  • create a Contact Item for each sensor
  • create Rules to calculate and populate your proxy Item that triggers whenever any of the three sensors changes and publishes whatever that particular combination of sensors represents to the proxy Item.

Hi Rich,

I Want to show three levels on OH (Full, Medium, Low).
Each reed switch will represent a level.

If the first is CLOSED, it means that I have 25% of Water on my Tank. If the the first and the second sensor is CLOSED too, it means that I have 50% of Water, and If the three reed switches are closed, it means that I have 75% of water on my tank.

Here are my “Items” configuration:

Contact FULL “FULL LEVEL [MAP(fd.map):%s]” { gpio=“pin:4” }
Contact MEDIUM “MEDIUM LEVEL [MAP(fd.map):%s]” { gpio=“pin:5” }
Contact LOW “LOW LEVEL [MAP(fd.map):%s]” { gpio=“pin:6” }

I Don`t know how to configure that, even represent this on sitemap.

Like I said, create a proxy Item to represent the tank and a Rule to populate the proxy Item based on the states of your other three Items.

I’ve never done this with Contacts but the following should work as well.

Group:Number:SUM WaterTank "Water Tank Level [MAP(lvl.map):%d]"
Contact FULL “FULL LEVEL [MAP(fd.map):%s]”  (WaterTank) { gpio=“pin:4” }
Contact MEDIUM “MEDIUM LEVEL [MAP(fd.map):%s]” (WaterTank) { gpio=“pin:5” }
Contact LOW “LOW LEVEL [MAP(fd.map):%s]” (WaterTank) { gpio=“pin:6” }

lvl.map

0=Empty
1=Low
2=Medium
3=Full

The Group keeps a count of how many Contacts are OPEN and lvl.map converts that count into the tank level in words.

Thanks Rich.

But how I can create an proxy item and a rule for that? Sorry, but I`m a newbie on this…
Can you show me an example?

Thanks again…

Please read the beginners tutorial and the first sections of the users guide.

Then read through the design patterns. There is even one for proxy items.

https://community.openhab.org/tags/designpattern

Thank you Rich. It worked for me.
Appreciate your help.