IoTaWatt Discussion

I am running it locally in docker.

Do you mean setup in HA, or setup in EmonCMS ?
HA setup isnt doing much of anything exciting

  - platform: emoncms
    api_key: <KEY>
    url: http://<IP>:8080
    id: 1
    scan_interval: 5
    exclude_feed_id:
     - 1

Its worth noting that I have a bunch of additional feeds in EmonCMS to “convert” power to energy, rather than doing it in iotawatt or HA. Was the best place for me.

EmonCMS is setup as a data uploader, with all my CTs and some simple calculations.

HTH!

Sorry, was out and about and fingers working faster than brain.

I’m after how you have your Inputs and Feeds in emonCMS itself - eg:

imageimage

I’m doing some quick calculations in HA to create usage within HA, but it doesn’t feed into Energy as this was all setup before that existed, and works well enough I’d not spent time moving over.

sensor:
  - platform: template
    sensors:
      emoncms_usage:
        value_template: "{{ '%0.0f' | format(states('sensor.emoncms_solar') | float + states('sensor.emoncms_main') | float) }}"
        unit_of_measurement: 'W'
        friendly_name: EmonCMS Usage

I dont think im doing anything different to you, OTHER than logging to kwh for every input out of the iotawatt.
When the energy dashboard first launched, the emonCMS integration didnt have the correct device_state set, so it didnt see it.

That changed quite a while back though, so the energy dashboard definitely sees them.

1 Like

I just set up the EmonCMS addon. Got it connected to the IoTaWatt no problems. It is uploading a month’s worth of data now.

One thing I noticed is that only the inputs are sent to EmonCMS. Not the Outputs.

So my integrators and calculations in the IoTaWatt are not used. It all has to be done in EmonCMS. Is that correct?

EDIT: it seems I have to duplicate the outputs in the IoTaWatt and give them numeric names to have them appear in EmonCMS.

This is all seeming like way too much overhead.

Yeah, that is correct. I only have 2 or 3 outputs though so it wasn’t a whole lot of effort for me. TBH I had forgotten about that shenanighan.

It does seem silly that outputs arent sent normally though.

At one point on my Iotawatt / HA jourey i was just pulling in outputs via rest, and then all the inputs via EmonCMS.

  - platform: rest
    name: Iotawatt
    json_attributes:
      - outputs
    resource: http:/<IP>/status?outputs=yes
    value_template: 'ok' # Dummy data so it doesnt kersplode
    scan_interval: 10

As I mentioned, this came about due to grabbing everything via API was causing my iotawatt to overload.
Potentially that came about because i was upllading to emonCMS & PVOutput, as well as polling in HA.

If you use the rest integration rather than the rest sensor platform you can grab all the inputs and all the outputs in one resource call to the iotawatt.

I think that is what I will do.

EDIT or maybe not. The http:/<IP>/status?outputs=yes resource only returns the power not the energy.

Yeah – didnt help in my case, still caused it to freeze and restart.
Its not impossible it was a bit of a coincidence and it was iotawatt firmware related, but I never went back to try it again.

The core integration is making more than 1 call to grab data ? That seems … dumb. It would help to explain some of the issues I had with it, and why it was worse than using a single rest sensor.

Does adding &integrators=yes (a total stab in the dark?)
I dont have energy setup on mine. Integrators were not a thing when I set mine up, in early 2020.

Nope. I’ll see if I can find the API documentation.

So this query will return all the instantaneous powers (and voltage for i/p 0) for inputs and outputs:

http://<ip_address>/status?inputs&outputs

But for the energy values you need to list the inputs and outputs. For my particular install it is like this:

http://10.1.1.250/query?select=[Export.wh,Import.wh,Self_Solar.wh,Self_Total.wh,solar_prod.wh,Upstairs_HP.wh,Downstairs_HP.wh,Stove.wh]&begin=d&end=s&group=all

As these are different resources they could clash. So I’m not sure how to proceed.

I can fork the integration and make improvements, maybe thats easier ?

Did you have a list of the quirks you dont like ?

This Device polling misses midnight boundaries. Workaround casues error. · Issue #4 · kuralabs/iotawatt_ha · GitHub

and once per day this: AttributeError: 'NoneType' object has no attribute 'text' · Issue #3 · kuralabs/iotawatt_ha · GitHub

And when restarting this: Energy dashboard glitching when HA restarted · Issue #115065 · home-assistant/core · GitHub

ill have a look at them!
at least fixing some issues might be a step in the right direction.

Some of those look dumb and relatively easy to fix.

1 Like

Just wanted to say installed iotawatt yesterday and set up the built in integration and it is working flawlessly.

So the core integration now lists your outputs on the device page (not just the inputs)?

And it is resetting correctly at midnight (not slightly after, which plays havoc with the energy dashboard)?

All resets correctly for me at midnight.

For the outputs - it does not list them on the device page but it creates three sensor entities for each one - eg the below is an output I have that adds up my lights.

and here is device page

That midnight reset issue I’ve not experienced through the iterations of the integration I have used / am using. Must be frustrating. I know it would drive me nuts.

Well that’s good. I might have to switch to the core integration. Can you show what is available in the pop-up when you click on one of those outputs and then the settings cog?

Is it editable?

I need to adjust a few entity ids to match my existing setup from what is reported by iotawatt.

Here’s another test to try:

Disconnect the power to your iotawatt momentarily to simulate a power blackout. Does this happen to any of the energy entities:


.

It needs to go unavailable (the gap) without the drop in value first and when it comes back it should not start at 0. Both of these issues will cause bad readings in the energy dashboard.

If it passes those two things I’ll swap to the core integration.

I went ahead and tried the core integration. Sigh. As I suspected:

Untitled