I have an energy counter and want to display how much energy was used in last week.
Here’s how I think it should be done:
I need an item displaying some value (from MQTT) decreased with historical value of another item (persisted in influxdb).
I assume, I need to create separate item and use transformation (let’s say in JS). But the question is how I can access influxdb from transformation?
Any suggestions?
What you need to do is use a Rule. You can access historic states, sums of the state since a certain date, etc on the Item stored in InfluxDB from the Rule.