i think your issue there is you are using the outgoing smtp mail server not the imap one, try with imap.gmail.com and port 993. if that dosnt work probably best to open an issue on github (just to avoid spaming this thread)
(i am assuming you are replacing EMAIL APP PASSWORD with your actual password)
yeah, it looks like i forgot to remove the test data when i pushed to github. in main.py, if you remove line 42 (the import), remove usage_data from the function call on line 43 and uncomment line 44 it should work.
ill push an update to githug to fix it when i am home from work tonight done. i also pushed some changed that make it non blocking that were nesaserry for HA to be happy. this is mostly switching from the requests library to httpx for the web calls
(also, i dont think this is really closed. it is solved for the OP but plenty of other people are in different situations that need help and find this thread that its still fairly used.)
@TomW1605 Iād be keen to read updates on your progress on integrating the output into HA (via the Historical Sensor code).
Iām taking a look at getting my power data from the AusNet/MyHomeEnergy service. Iāve managed to fetch fairly up-to-date data (within an hour I think) using a script, and while I still have some authentication challenges to consider[*], I also want to start working towards injecting the data into HA.
[*]MyHomeEnergy authenticates with a Captcha, making things painful for automation. But once logged in, I can capture my auth cookie from my browser and use that in my script. The cookie only works for 30 minutes and then my auth fails. But after 15 minutes of using a valid cookie, my requests are given a new auth cookie to use, and they work fine for another 30 minutes. So if I send requests often enough, and keep switching cookies as new ones are offered, I think I can go indefinitely (as long as HA doesnāt crash, or my internet goes down). Iāve managed to go 24 hours so far.
here is my repo with the historical sensor integration GitHub - TomW1605/ha-synergy: synergy integration for home-assistant. unfortunately there seems to be a bug in the integration that is causing sql write errors that HA is interpreting as a corrupt DB causing it to dump the whole DB and start again. it is fairly easy to restore the DB by hand (just delete the new one, rename the old one back to its original name and restart HA) but thats not at all practical for production.
I have been in touch with my NSW retailer about direct access to my meter data.
The meter is supplied by PlusES, & after much too-ing & fro-ing, they have agreed to give me access as they should under Australian regulations:
I queried AEMO about this issue. Their reply follows:
(Start) AEMC
to (redacted)
Last Wednesday at 8:33 AM
Hi (redacted)
Thank you for your enquiry.
We understand that you seek information on whether the National
Electricity Rules (NER) allow local access to your smart meter.
This access would allow you to attach a device that reads energy data from
your smart meter.
Clauses 7.15.3(g and (h) of the NER provides:
A customer can request their electricity retailer for a read
only password for local and remote access to energy data recorded
by their meter - The retailer must provide the read only password within 10
business days.
The access is subject to the authorisation of the relevant Metering
Coordinator for the meter.
We trust this information assists.
Regards AEMC.
(end)
Their reply: We can offer Mini hub device to support Modbus protocol over RS485
interface which the customer can then interface to any software that
supports Modbus protocol for local real time energy data monitoring.
This device will be a RS485>Webserver interface, which should be easy to interface to HA. I am not sure if the Costs will be available until I get more info. It would be nice to have the peak/off-peak/shoulder info, but having real access to the data will be great.
Thanks Doug, Iāve requested the same from Energex (QLD) with the following:
to: [email protected]
Subject: HEMS alternative
Hi Team,
I would like to request read only access to the smart meter data gathered by the intellihub system at my premises. The AEMC states in the National Electricity Rules that I can obtain access to the smart meter data in cluses 7.15.3 (g and h)
A customer can request their electricity retailer for a read
only password for local and remote access to energy data recorded
by their meter - The retailer must provide the read only password within 10 business days.
The access is subject to the authorisation of the relevant Metering Coordinator for the meter.
As such, can you please provide me access to the API address and a read only account for the following device:
My account: 9999900000
My Meter number: QB0111111 / EDA222222
My Provider: OVO Energy
My Address: XXX, YYY QLD 4999.
Thanks in advance,
Will keep you posted here on how this goes - if it works, I say request it away!
Good luck! I have yet to receive confirmation I will definitely get access. I feel one thing that might come out of it is that the meter suppliers will decide that perhaps it would be a good idea to make Zigbee access Australia universal instead of just SA & Vic.
One positive thing with zigbee is that it can be used to control (ie load shed) devices for Energy resellers (one would hope with customer consent). I feel that the future of a reliable grid will depend on this. Not everyone will have a V2G vehicle & want to use it positivelyā¦Some EV owners will just arrive home & plug in their EV adding to the Max demand issue 5pm>8pm. I will be suggesting moving to Zigbee enabled metering to my local State pollie in NSW. But first I wait for access.
Like Shakespeare (Much ado about nothing), yes I can get access, but it will cost an estimated $795 for a RS485 hun⦠(in other words, they will give the same access as a big commercial user, & I will need to supply the resat.) I was not guaranteed long term access.
I will be writing to my local Member of Parliament, because this is ridiculous. I should be able to view my own data easily, at reasonable cost.
What I cannot understand is why the metering in Australia is not specification standardised. In Victoria & South Australia Zigbee compatibility is standardised.
I feel this should be available Australia wide.
ā¦to be continued.
For Australian users, I have included my latest communication with my State Member of Parliament:
(Deleted for privacy)
our last communication was on 24 Sept, Just to reacquaint you with my issue,
I was trying to directly access my metering data from my Smart Electricity
meter. I want this data so I can feed it to my Smart Home
Control system (called “Home Assistant“).
I asked the Question of the regulatory authority & received this response:
(Start) AEMC
to
Last Wednesday at 8:33 AM, Sept 2024
Hi
Thank you for your enquiry.
We understand that you seek information on whether the National
Electricity Rules (NER) allow local access to your smart meter. This access
would allow you to attach a device that reads energy data from your smart
meter.
Clauses 7.15.3(g and (h) of the NER provides:
A customer can request their electricity retailer for a read only
password for local and remote access to energy data recorded by their meter
The retailer must provide the read only password within 10 business
days
The access is subject to the authorisation of the relevant Metering
Coordinator for the meter.
We trust this information assists.
Regards
AEMC
(end)
When I passed this information to my retailer, RedEnergy, they in turn passed it
to the Metering Supplier, PlusES (a South Australian Company). After a huge amount
of too-ing & fro-ing, PlusES said (via RedEnergy) the Zigbee access is not
supplied in NSW meters, & the only access they could give was a very complicated
Industrial access (that is normally used by large commercial power consumers)
at an estimated cost of $795, but they could not guarantee long term access.
This was after 4 months!
Compare this to Victorian Spec Smart meters that have “zigbee“ access, where a cheap
interface is available (or a remote consumer display option). Zigbee also allows
energy suppliers to have the option in future of controlling consumer loads, such
as EV chargers, A/C, Hot Water services, etc, which can be a virtual power plant
by reducing or increasing grid loads. This will be important in the future.
I could give you a full account of the communications with Red Energy, but I feel
I have covered the bulk of issues.
My recommendation is that all Australia, or at least the Eastern Grid (SA, Vic, NSW
& Qld) should standardise metering & I feel the Victorian Specs would be a good start.
My worry is that the NSW spec Smart Meters seem to me not to be future-proofed, in
that there seems to be no way to control Consumer devices from the Smart Meter, or
to allow Consumers access to their immediate data at a reasonable cost in a timely
manner.
I feel that in the future, if the consumer wants immediate metering data so they
can efficiently use their power, they should be able to get the immediate data
directly from the meter. This would allow better use of power & better knowledge
of energy usage & subsequent bill (shock!). Energy companies at present sometimes use
estimated bills, but the consumer has no access to data to dispute this bill. An
Energy display with memory would enable a consumer to dispute these bills.
Merry Christmas! Pls keep me in the loop with this request.
(end)
Perhaps others might approach their MPs about this issue?
GāDay. I am new to HA and based in Canberra with a Raspberry Pi on the way.
I already have a Fronius inverter, MyEnergi hub and EV charger and SolarAnalytics. Would it be easier to simply pull data from the Fronius than the smart meter?
Kinda seems odd that we donāt have a mandated standard like Zigbee in place for read only access.
sorry new HA user here - what is the best suggested way for Vic, SP Ausnet energy user to realtime monitor import from the grid via HA please? Thank you.
Hi all,
New user of home assistant here. Still getting my head around it all. Iām a developer fluent in Python and IoT. Was building my own energy monitoring off NMI data and had a colleague recommend looking into HA. Iāve got a scraper which logs into the my Energy website and downloads the NMI data (including 2FA which reads from my email). Iām wondering:
Are most other people getting NMI data differently, or is this a new feature that would help people out? I could try and package it properly for broader access if it fills a gap, being new Iām not sure whether this is useful / there are other accepted ways people do this.
What add ins are people using to visualise NMI data?