Energy EAGLE Discussion

Plug-ins, scripts, and other software to improve your home automation experience.
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Wow! That's odd that they just up and replaced your meter. :?

In any case, thanks for the info!
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Version 0.9.11 Posted

Changes from 0.9.9:
  • Fixed bug that misinterpreted negative instant demand values (for those with solar or other grid-contributing energy sources).
  • Another attempt to fix a bug that causes a UnicodeDecodeError in certain circumstances where non-ASCII characters appear in the XML output from the EAGLE.
  • Fixed a bug that could cause the plugin to crash if unable to connect to the EAGLE.
rhanson
Posts: 198
Joined: Tue Apr 30, 2013 6:31 pm

Re: Energy EAGLE Discussion

Post by rhanson »

Nathan,

Almost there..

Line 1380: don't divide by 2, we need to compare the whole value to 2^31-1, not half of it .. I think you're compensating for the signed int twice in your mind :-)

Also, on 1386: pretty sure you want ~ instead of - (the result is the same for 0xfff... but not any other number)

Code: Select all

1380: if int(energyInput1, 16)  > 0x7fffffff:
1386:  energyInput1 = float(int(energyInput1, 16) | ~0xffffffff) * float(int(multiplier, 16)) / float(int(divisor, 16))
Then it works as expected.

Thanks for this plugin!
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Thanks for catching that. It was late. ;-)
rhanson wrote:Line 1380: don't divide by 2, we need to compare the whole value to 2^31-1, not half of it .. I think you're compensating for the signed int twice in your mind

Also, on 1386: pretty sure you want ~ instead of - (the result is the same for 0xfff... but not any other number)
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Version 0.9.12 Posted

Changes from 0.9.11:
  • Corrected negative demand calculation code.
richy240
Posts: 111
Joined: Sun Jul 08, 2012 10:14 am

Re: Energy EAGLE Discussion

Post by richy240 »

Is the value of the "Change in Current Load (kW)" property the same as the value of "energyInput1Delta" device state?
Last edited by richy240 on Sat Oct 05, 2013 6:57 pm, edited 2 times in total.
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

richy240 wrote:Is the value of the "Change in Current Load (kW)" property the same as the value of "energyInput1Delta" device state?
Yup. :-)
richy240
Posts: 111
Joined: Sun Jul 08, 2012 10:14 am

Re: Energy EAGLE Discussion

Post by richy240 »

I'm getting some weird results when I use "Change in Current Load (kW)" as a condition. Even when I set the condition to be greater than 0, the trigger only fires when the value is below 0. The "Current Load (kW)" property seems to work ok as a condition, but I can't seem to get the Change to work. Am I doing something wrong?

I'm trying to do something like this: if the current load is above 5kW after the most recent change, and the change in draw was +1kW, perform this action. Am I on the right track here?

EDIT: Never mind, I'm an idiot. :?
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Ha! No. Actually, I've seen some odd behavior when using the Change in Current Load as a condition as well. The apparent reason is that the Change in Current Load changes a few milliseconds after the Current Load, as the plugin goes through the XML. Indigo triggers on the Current Load and processes the conditions before the Change in Current Load value is populated into the device's state. I haven't decided on the best way to work around this. When I figure it out I'll let you know.
richy240
Posts: 111
Joined: Sun Jul 08, 2012 10:14 am

Re: Energy EAGLE Discussion

Post by richy240 »

nsheldon wrote:Ha! No. Actually, I've seen some odd behavior when using the Change in Current Load as a condition as well. The apparent reason is that the Change in Current Load changes a few milliseconds after the Current Load, as the plugin goes through the XML. Indigo triggers on the Current Load and processes the conditions before the Change in Current Load value is populated into the device's state. I haven't decided on the best way to work around this. When I figure it out I'll let you know.
I KNEW I WASN'T CRAZY! Although I was going back and forth on it - sometimes it seemed to work ok, and sometimes it was giving me some REALLY weird behavior.

I guess the temporary workaround would be to trigger the action based on any change of Change in Current Load instead of any change of Current Load. That seems to render more reliable results for me, provided I'm not crazy. ;)
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Yup. That's one of the workarounds I was thinking of but hadn't tested yet. Glad that works more reliably for you.

Another I was thinking of was using code in an embedded Python script action to test the energyInput1Delta state. I've tested that method and found it to work (probably because there's a bit more delay to start executing the embedded Python code, allowing the Change in Load to update before the code tests it), but it does require more coding. Your solution doesn't. ;-)
davidw
Posts: 8
Joined: Wed Oct 23, 2013 9:38 pm

Re: Energy EAGLE Discussion

Post by davidw »

Hello Nathan! I'm an SCE customer with a solar array, and just received my Eagle today. Thanks for the great plug in!

I tried to Use Advanced Pricing and put in my tiered rates, and got this error:

Energy EAGLE Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 637, in runConcurrentThread
File "plugin.py", line 1583, in eagleSummationValues
<type 'exceptions.TypeError'>: can't compare datetime.datetime to unicode

Energy EAGLE Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


As promised in the final line, it repeats about every 10 seconds.

For now I've just turned off Advanced Pricing, but is this something I've configured incorrectly or...?
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Hi David.

I'm glad you're getting some use from the plugin. As far as I'm concerned, even bad input shouldn't cause a crash like that, so thanks for reporting it. I'll see if I can track it down with the information you've provided. If not, I'll let you know and I can get some debug logs from you. However, I should also say that, while the RFA-Z109 EAGLE does support gathering the raw data, the plugin's Advanced Pricing doesn't currently support solar or other energy production sent back to the power company (adding that functionality adds quite a bit more complexity which I've been hesitant to tackle as of yet). Currently, the best way to get your current bill estimate is through one of the free "cloud" services supported by the EAGLE (Bidgley and Wattvision). I'll get the bug fixed, but even after it's fixed, you won't get an accurate total cost estimate from the Energy EAGLE plugin, though the estimate would fairly accurately show how much you would have paid without the solar panels. :-)
davidw wrote:Hello Nathan! I'm an SCE customer with a solar array, and just received my Eagle today. Thanks for the great plug in!

I tried to Use Advanced Pricing and put in my tiered rates, and got this error:

Energy EAGLE Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 637, in runConcurrentThread
File "plugin.py", line 1583, in eagleSummationValues
<type 'exceptions.TypeError'>: can't compare datetime.datetime to unicode

Energy EAGLE Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


As promised in the final line, it repeats about every 10 seconds.

For now I've just turned off Advanced Pricing, but is this something I've configured incorrectly or...?
davidw
Posts: 8
Joined: Wed Oct 23, 2013 9:38 pm

Re: Energy EAGLE Discussion

Post by davidw »

Got it, thanks. Had some trouble getting my Eagle to communicate with Bidgely, but after a couple of resets things seem to be working. I don't suppose you're planning to write a plugin to read the data from Bidgely, are you? :D

And possibly worse than that, while browsing your posts for a Bidgely connection, I've learned that I could make my Hue lights change color depending on my rate tier or consumption. My guests already think the lighting in my house is random enough, as much of it controlled via Berkinet's AD2USB plugin. They might just start to bring flashlights so they know what to expect.
nsheldon
Posts: 2469
Joined: Mon Aug 09, 2010 2:12 pm
Location: CA
Contact:

Re: Energy EAGLE Discussion

Post by nsheldon »

Hey David.

No plans on a Bidgely plugin, but that isn't a bad idea.

Ha, yea. Keep your guests guessing. Funner that way. ;-)
Post Reply

Return to “Nathan Sheldon Software”