I’ve not seen any discussion of emoncms specifically but a quick scan of some of the their docs indicate they have a pretty well defined API.
However, openHAB supports several databases for storing data. See the Persistence section of the wiki for which DBs and other storage mechanisms are stored. I personally use rrd4j as I don’t really use or care about data older than a week right now. I’ll probably switch over to MySQL or InfluxDB if that ever changes.
I save my energy data from a homemade sensor to emoncms. Grafana also produces very good graphs using influxdb which is supported by openhab.
var String Key = "xxxxxxxxxxx" //your api key
rule "Send Power to Emoncms"
when
Item TotalPower received update
then
var Number power = TotalPower.state as DecimalType
sendHttpGetRequest("http://emoncms.org/input/post.json?csv=" + power + "&apikey=" + Key + "&node=1")
end