Integrating a damage capturing application in openHAB (MySQL)

Dear openHAB Community,

I’m working on a Smart Public Building project at my university HfT Stuttgart and would appreciate to hear your opinions about my plans.
My task in this project is about capturing damages in the building via smartphone and send that data online to the responsible staff. This should be integrated in openHAB since our university wants to use it as central platform for that specific project.

My idea is to capture the information in a webform by using a smartphone. The data should then be uploaded in a MySQL Database. With MySQL persistence in openHAB i want to integrate the data in the HABPanel.

A damage ticket in the database contains information like

  • brief description
  • position (room)
  • urgency
  • picture of the damage
  • e-mail of the ticket-creator

As a first step, it would be nice to have a counter in the HABPanel which tells me how many tickets are in my database, or a visualisation of each ticket with an image of the damage and for example its position. As an extended version it would be useful to inform the ticket-creator when a damage is repaired.
I have many more ideas but I’m having a bit of trouble with the integration in openHAB, so that’s where I’m seeking advice on.

I would be glad if you’d share your thoughts and ideas about the project with me. I try to update this thread in future to keep you on track with my progress.

I really appreciate any help you can provide

1 Like

I’m not surprised as this really is not a use case for which openHAB is well suited. Your best bet will likely to be to implement something separately and include it in HABPanel via a webview.

The problems are:

  • there really is no built in way to enter arbitrary text, though a custom HABPanel widget might work
  • there really is no good way to represent this information internally in openHAB because the Item based modeling does not lend itself to supporting the creation and deletion of an arbitrary number of “database” entries like this. It is designed to represent static data and actuators. You will have to go through a lot of convluted code to squeeze this sort of ticket tracking system into the openHAB model.

openHAB would be a good way to automatically sense damage and automatically generate a damage ticket as a result of data from various sensors. openHAB would be a very poor choice, if not disaterous, as a ticket tracking system itself. It simply is not designed for that kind of problem.

I second Rich in every case.
Sounds like a 100% use case for a ticket system like Atlassian JIRA. You’ll get everything you ask for out of the box. and I’m sure, there’s either already an instance of JIRA running at your University or you’ll get one cheap as an education institute.

and tops: Every company I know uses JIRA (ok 90%, the rest uses some similar ticketing system) and it’s good to know one for job search.

and if you won’t use the mobile version, you could easily write your own App, WebApp or something using the API of JIRA - so you can fill in your further thoughts.

Thank you for replying!

@rlkoshak By “webview” you mean the http binding?

What i was researching before was the “Open Data Kit”(ODK) App which already delivers me a “capture app” for my smartphone and a way to store my data (running local or e.g. Google App Engine). The data can be accessed via the browser. My idea was to use ODK as an external application and accessing it via the http binding on a sitemap, but it seems to not work this way.

@binderth Can you imagine a way of integrating the data from JIRA in openHAB somehow? The ticket system is exactly what I’m searching for, but i still wanna get that information in openHAB using it as a central component for organisation of a public building.

Best regards
Markus

hmm… you could access the JIRA-API (or let JIRA use the openHAB API) to update room-specific items. So you could have your building layout with the items, you want to use within OpenHAB - and update them via JIRA.

e.g.

String Building_Hoersaal1_Damage_Description "Schaden Hörsaal 1" (WiWi_Fakultaet, WiWi_HS1) 
String Building_Hoersaal1_Damage_Urgency     "Dringlichkeit"     (WiWi_Fakultaet, WiWi_HS1)
String Building_Hoersaal1_Damage_Picture     "Bild"              (WiWi_Fakultaet, WiWi_HS1)
...

Thing is - openHAB2 relies on actual items and is not dynamic in that case, meaning you could only use either the “latest” damage - or you must predefine x damages per room (Building_Hoersaal1_Damage1_Description, Building_Hoersaal1_Damage2_Description, Building_Hoersaal1_DamageN_Description, …).

now you can write either a openHAB rule, which updates damages regularly from JIRA - or let JIRA do the work and update the openHAB items…

No. I probably used the wrong term. I mean use a Frame widget. If you are using sitemaps you would use a Webview element.

The HTTP binding will do nothing for you from a UI perspective. All you can do is get data from a URL and populate one or more Items with that data.

:+1 to what Thomas says.

openHAB is a really horrible platform for a ticket tracking system. Items are not dynamic and the UIs are even less dynamic. The UIs do not support entry of arbitrary information, though you can get that by using a custom Widget. You really need something like Jira to run your ticket system and either a widget on your HABPanel or Sitemap to expose the Jira UI and perhaps a few Items within OH to represent some summary information like the total number of tickets, sums by priority and the like.