Custom Component: IoTaWatt Energy Monitor integration

I have the same issue. Added a version entry to manifest.json to get HA to load the integration however non of my configured I/O have appeared as sensors.

Have you had any luck getting things working Louise?

To get the integration working as well as adding version to manifest.json to trick HA into loading the integration I had to remove from init.py the last two ā€œentry.dataā€ lines under ā€œsession,ā€ which refer to username and password.

    api = Iotawatt(
        entry.data["name"],
        entry.data["host"],
        session<s>,</s>
<s>        entry.data["username"],</s>
<s>        entry.data["password"],</s>
    )
1 Like

Took code from core/homeassistant/components/iotawatt at iotawatt_integration Ā· gtdiehl/core Ā· GitHub (after first taking hacs version but that didnā€™t appear either), I have added ā€œversionā€ field and progressed iotawattpy to 0.0.4 (didnā€™t check but I suspect that is where username/password might have been added?) so

manifest.json looks like this
{
  "domain": "iotawatt",
  "name": "iotawatt",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/iotawatt",
  "requirements": [
    "iotawattpy==0.0.4"
  ],
  "ssdp": [],
  "zeroconf": [],
  "homekit": {},
  "dependencies": [],
  "codeowners": [
    "@gtdiehl"
  ],
  "version": "0.0.20201217"
}

did the dance (uninstalled, restarted hass, installed, reentered detail) and it seems had picked up all the entities from iotawatt.

Sent out PR (Boost versioned dependency on iotawattpy, add "version" by yarikoptic Ā· Pull Request #1 Ā· gtdiehl/core Ā· GitHub) for those two little changes but I guess may be it is no longer the repo to use?

Sorry, Iā€™ve been away for a while. Finally getting back to this!

I have updated the GitHub repository that you can point HACS to.

Iā€™ll also update the first post to point to this repository instead.

1 Like

thanks for your work!

Iā€™ve update through HACS (had to remove the previous integration) and now I cannot set it up anymore?

image

BTW Iā€™m running core-2021.5.1

@stepir I did see an issue where if authentication is disabled (which it is by default) on the IoTaWatt, then the integration will fail. I have made the change in GitHub. Iā€™m running HA 2021.4.4. I didnā€™t see the error you had though.

Can you update the integration from the HACS repository area, and retry adding the iotawatt integration? If the same error occurs, can you look in the home-assistant.log and see if there is any error?

2 Likes

thank Iā€™m on it - will report back

/edit it works now thanks a lot!!!

Hey guys,

Iā€™ve added the repository and installed iotawatt through hacs and restarted. I can see it listed there as an integration. But when I go to configuration / integrations / add integration I donā€™t see IoTaWatt listed as an integration to install. Am I missing something?

Ta

Try clearing your browser cache.

That did it :man_facepalming:t2:. Thanks.

Hey guys, thanks for the integration. I have it installed and up and running reporting power in watts.

Iā€™d like to use the energy meter integration to calculate the cost of energy use by the appropriate tariff, I have that installed and set up as well, though only in watts. I see that the utility meter requires an input in kwh (energy).

Can I convert the output in watts from IoTaWatt into kwh so I can use the energy meter to calculate cost?

I know this question has been asked before, but the more I read the less clear it becomes. How do you do it?

Feed your Watt sensors into the utility_meter integration and it will spit out kWh.

Thanks,

I donā€™t have to at least divide by 1,000? Here are current readingsā€¦

I have seen other comments where various forms of template sensors are used to convert the input into the utility meter integration (the integration says its input should be KwH), so Iā€™m not sure if I have it setup correctly.

Nope

I feed my direct power sensors into the utility_meter and it calculates to kWh on itā€™s own.

Make sure your unit_of_measure is ā€œWā€ not ā€œWattsā€

1 Like

Thanks,

Iā€™ve changed the iotawatt power sensor unit_of_measure from ā€œWattsā€ to ā€œWā€ in configuration => customizations.

Iā€™ll reset all the meters and see how it goes.

1 Like

I think I am missing something fundamental here or I have not got this setup properly.

I have fed the output in watts from iotawatt into the utility meter with W as the unit of measure. This is what is displayed in HA ā€¦

Here is what I am seeing in iotawattā€¦

As far as I can tell, both are reset at midnight, but show vastly different numbers.

Seems that your source sensors are not reporting correctly.

I relay my readings through EmonCMS (self-hosted) and all the data tabulates properly.

OK then, youā€™re getting an output from EmonCMS while I am getting it directly from iotawatt. My IotaWatt reports use of 2.53 kWh in its graph. My local instance of EmonCMS is reporting 2.4 (using the ā€˜My Electricā€™ app) - both based on the iotawatt sensor.

Perhaps I need to feed the utility meter from EmonCMS (using kwh?) rather than the watts directly from iotawatt.

Reading through this tread seems to suggest I need to use the sensor.integration (to convert Watt to KiloWattsHour) and feed that into utility_meter instead of using Watts from iotawatt directly.

1 Like

Thatā€™s an awesome looking dashboard you have there. Something for me to aim for.

No issue - just a quick note to say thanks to the dev(s), great addon, and great to see that itā€™s in HACS now. :+1: