Ninety percent of my needs are collecting data for later analyses. Some types of data I do not have an automated way to collect data so I collect it manually. I would like to be able to show charts of this data along with my sensor data. Is there a “item” that provides a manual interface for entering data?
I’d like to do something similar. Collecting gas, water and electricity meter readings. I was thinking of building a basic web page which collects the data and sends it into OpenHAB using MQTT - I think that’d be the neatest way off the top of my head.
I agree that MQTT is probably the best way. But if you want a ready made UI you could try Slack (https://github.com/openhab/openhab/wiki/Slack-integration). I use this mainly for debugging and checking item state, but it is also useful for updating item state, sending arbitrary commands etc, You could use it for entering sensor data as well of course.
Ooh. That looks neat too. I’m a huge fan of Slack and I love the idea of being able to ‘talk’ to the house. I’ll look into that myself too. Cheers.
I wrote it so let me know how you get on - I find it really useful especially when something goes awry and I need to manually update some state in openHAB.
Yeah. Thanks @ben_jones12 That will be very handy. I’m most of the way there…but how do I find the slackhab_user_id ?
openhab_url = 'http://127.0.0.1:8080' slackhab_user_id = "UXXXXXXXX"
Where slackhab_user_id is the internal user ID for the slackhab bot. The easiest way to get this user_id is to add some debugging to the slackhab plugin. Although there may be a way to find it via the Slack UI.
I think you have to make a manual request to the Slack API;
Was a while a go I did this so sorry I can’t remember the specifics.
Thanks. I figured it out from there. Probably a neater way of describing this (especially for developers and those more familiar with APIs…) but I essentially retrieved the user_ids by:
Logging in to Slack web interface
Generating a token
Using the Tester tab I chose Home from the dropdown and then hit the Test method button
Found the userid in the returned XML (or whatever) code
Works great, @ben_jones12 Thanks fort your good work. This will be very useful…
Feel free to update the WIKI page if you like - that does sound like a much better set of instructions than mine!
Glad you got it up and running.
Would it be an option to just use Jabber integration to set the value of an item?
Slack looks like it can send the data but it seems like overkill. An generic interface that could be used for testing and sending data should be part of the openHAB UI. It could be MQTT if that is easiest.
That makes me think I can just use MyMQTT on my phone for sending in data to any item I create. That should work although I would like to be able to customize the interface so you do not need to understand MQTT.
Looks like we may be overlooking the REST API for openHAB -
Yes good idea @bpair , I think it could be possible with the http binding or the executeCommandLine action to use curl and call the openhab rest api.
Yes. Although I am thinking that the openHAB web app and the smartphone app should provide a way to send a rest call for each item. That would solve the problem of needing to sometimes manually enter data or change state. This is basically what happens when you turn a switch on or off.
Rather than using a different application it should be available as part of the supported openHAB apps.
Ok, after some research, now I input my gaz, electrical and water consumption in openhab. The trick is to use the VoiceCommand item and use a regex to extract the value in your sentence.