API information/documentation available?

Got my 2 units working and integrated to HomeAssistant. My ultimate destination is Indigo Domotics. I get my IoTaWatt values into Indigo from HA with a Python script, bypassing MQTT. Works great but I would like to get closer to realtime.
Getting the data directly from IoTaWatts is what I want to do.
I did search and have sort of a half-a$$ed answer but not really sure.
I ran across references to a Query API but did not find anything re usage, etc.
Any info or sampling would be much appreciated.

There is a query chapter in the docs:
https://docs.iotawatt.com/en/master/query.html

I missed that, sorry.
Thank you very much for the link.

Just curious, why?

Decades ago, I got asked the question, “what does realtime mean?” at an on campus interview. My answer was along the lines of it depends on what the task is. We then had a good discussion about the different meaning of the term for something like a home heating thermostat versus a data logging system for an atomic bomb test.

I have been using IotaWatt for years and other systems for over 2 decades. I have thought about what I would do with data that was “realtime”, but haven’t really come up with anything that would be really worthwhile. What I do find useful (sometimes incredibly so) is more long-term data over time. Here is an example (not with power data, since I don’t it going to a new enough instance of InfluxDB).

This shows the power of looking at a week’s worth of data at once. Each of the lines is the setting of the electronic expansion valve in my heat pump water heater, but the simple power value would show something similar. With all 7 days worth of data on the same plot it is not as easy to see the problem unless you know what you are looking at.

This trace shows only yesterday’s data:

The blip shortly after 04:00 is the heat pump turning off, since it finally brought the tank up to temperature. The bigger excursion from the mean at 06:45 to 07:00 is a normal startup of the heat pump.

Here is two days ago:


This shows two start ups, which is strange.
Looking at the data from IotaWatt shows more about what happened:

For some reason, the control system didn’t like what it saw happening with the heat pump and decided to turn on the bottom element.

Here is what it should look like:

In this case, it only used about half a KWh more for the unexpected behavior.
Here is the graph from the 24th:

This time it used about 3KWh over what is normal for the period.

This is what the EEV looked like then:


this resulted in a fault in the water heater and it reverted to backup standard electric mode. I waited till it figured out the compressor really wasn’t working and faulted (so it would record the fault). I then rebooted the water heater and it started working fine.

At some point, whatever is wrong will fail more permanently and then I can call for service/replacement, since it is still under warranty.

Realtime for this use case is not an issue, since it really is only by looking back over time that what is happening makes sense. If I want more instantaneous data, I generally just go to the IotaWatt status page, since that updates every second.

Probably just because I can :slight_smile:
While it wouldn’t make much difference in the overall scheme of things it’s a bit annoying when viewing IoTaWatts and Home Assistant side by side.
Along with branch circuits I display Watts, Volts and Hz on main hydro coming in and also on my Aux panel, which houses the GenSet transfer switch and circuits on GenSet when power out.
When Hydro comes back it’s not always smooth so I hope to use the info to stay on GenSet longer at times when needed.
Using IoTaWatt I’m able to monitor my most important branch circuits that carry TV, Internet, Fridge and onDemand Heat/Hot Water. I was surprised that those four circuits can stay under 1700 watts simply by leaving a few lights off. This opened the door to a backup to the GenSet using my EV. I can output 1900 watts from the EV. I’m adding another Transfer Switch that I can feed from my EV (Hyundai Ioniq 5) if/when GenSet fails. Not quite as automatic as transfer to GenSet but should be able to do it before the Computers, TV, Routers, etc. UPS’s run out of battery.
For now, best realtime data is more important to me than longtime historical.
Aside from all that, it’s just fun to ‘play around’ :grin:

The simple answer is don’t do that. To fix that problem is going to take more than you probably want to be doing the 99.99999% of the time you aren’t looking at. Iotawatt is updating the display every second. If you query it every second, you will likely cause some issues. The esp8266 is already very busy and probably doesn’t need multiple things asking how much power is being it used right now every second.

It’s your hardware and your measurement data, so do what makes you happy.

1 Like

Yeah, I know :slight_smile:
Still learning and trying to confirm I have my configurations correct. After a couple of weeks it probably won’t matter to me.
My definition of realtime is about a 10 second poll so hopefully won’t be taxing it too much.