I want to measure the time difference with milliseconds accuracy between the previous sensor state and the upcoming one. Or to put it in another way: i need the time delta of the last 2 sensor states.
What I’m trying to accomplish with this is:
I have a Tasmota with a photodiode attached as a counter and hooked up to my energy meter which blinks 1600/kwh. I can measure the consumption, but i’d also like to measure momentary wattage.
For this I need to convert kwh to w, and for that i need the time difference of the 2 measurement points.
I tried to fiddle with
as_timestamp(now()) and i’m getting results by subtracting some values from each other, but i’m getting nowhere meaningful values which i can incorporate in what i want to accomplish.