- Platform information:
- Hardware: Raspberry Pi 2
- OS: openHABian 2.3.0
- Java Runtime Environment: which java platform is used and what version
- openHAB version: 2.3.0
Hello, new openHABian user here.
I have my system mostly working. I have a Neurio power monitor Neurio which has four CTs: two for Phase A and B and two more which I use for my home AC and my garage AC units.
I currently have all the data in inFluxDB and graphs in Grafana.
What I want to add is a graph which shows my net power consumption MINUS the AC units. I can think of two approaches:
- Use math somehow in the Grafana metric definition. I can’t figure out how to subtract when the metrics are in separate tables (i.e. FROM clause is different)
- Create a rule which will do the math and then store another metric in the database.
Has anyone solved this problem before? Seems pretty common. Right now I don’t understand the Rules syntax well enough to write it myself. I’m hoping for an example. I know that this method would incur more storage in the DB but I really don’t think Grafana can do it.
Once I get this working I will write up my solution notes and post in the right section.
For now, here are notes on how I got Neurio working, via HTTP binding with JSONPATH transform. The Neurio device has a local API that returns a JSON string with all the CT power & voltage details, updated every second.
openhab2-conf/services/http.cfg:
neurioCache.url=http://10.1.1.23/current-sample
neurioCache.updateInterval=1000
openhab2-conf/items/neurio.items
Group gNeurio "Power" <energy>
Number Power_Consumption "Value: [%.1f W]" { http="<[neurioCache:1000:JSONPATH($..channels[?(@.type=='CONSUMPTION')].p_W)]" }
Number AC_House_Consumption "Value: [%.1f W]" { http="<[neurioCache:1000:JSONPATH($..channels[?(@.label=='AC House')].p_W)]" }
Number AC_Garage_Consumption "Value: [%.1f W]" { http="<[neurioCache:1000:JSONPATH($..channels[?(@.label=='AC Garage')].p_W)]" }
Thanks for any advice!
-Nathan