I just started playing with openHAB this weekend. I would like to query my CouchDB for data using the http binding. However, I am getting an error when it hits the port number section of the url. I’ve tried escaping the colon using the backslash.
How does one use the http binding when there’s a port number in the url?
You can easily use your own portnumbers in the http binding. If it works in a browser it usually also works in your items and rules. Below an example of my own installation, which gets the ON/OFF status from a wallplug.
String Circle_plus_stat “Circle_plus stat [%s]” (Switches) {http="<[http://localhost:8088/api/read.xml?mac=000D6F000278D3CF:6000:REGEX(.?(.?).*)]"}
Thanks! I just tried it and get the following error:
2015-11-08 15:42:49.354 [ERROR] [.service.AbstractActiveService] - Error while executing background thread Souliss Refresh Service
java.lang.NullPointerException: null
at org.openhab.binding.souliss.internal.SoulissBinding.execute(SoulissBinding.java:343) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
I do not know the details of the soulis binding, so i cannot say if you need a regular expression like me. could you post here a working http request with its response in a browser as a first step ?
I assume something like “http://ip-addres of the soulis host:6000/anything else you need to get the desired value”
Here is the response string:
{“rows”:[
{“key”:null,“value”:{“datetime”:“2015-11-08T21:06:24.501Z”,“temp”:“71.90”,“humid”:“32.70”}}
]}
I have 9 sensors working around my home using the ESP8266 module to publish temperature and humidity to an mqtt broker every 5 minutes. From there, I have the data sent to a CouchDB database in JSON format. I’ve been using Node-Red to orchestrate the system and an AngularJS page I developed to display the data. I recently came across openHAB and wanted to see if I could start porting my existing solution over as openHAB appears to be a more robust platform. I have plans to add controllers for lights, garage, etc.
Which version of the Souliss binding are you using? It looks like this line is causing a NullPointerException, but the code has changed since then. Try replacing the binding JAR in your addons folder with the one from a recent build.
Yes, it is! Here is the JSON from my CouchDB IoT database I’m parsing: { "_id": "bab615607fe75c0e4c8e50d19e00533a", "_rev": "1-04e43e3e3132156859d6090f3098b3f2", "datetime": "2015-08-26T05:50:56.587Z", "iot_type": "Device", "category": "Sensor", "type": "TempHumid", "iot_id": "ESP0001", "temp": 75.5, "humid": 34.9, "path": [ "Home", "Upstairs", "Office" ] }
Here is the js I used in my transform folder to parse it: JSON.parse(input).rows[0].value.temp