Okay. I'll check out the code and see what I can find that might be causing that. From the error, it looks like there's a non-ASCII character in the output from the EAGLE and it can't be interpreted properly. If you could turn on debug logging in the Energy EAGLE configuration while that error is repeating, then paste in the log into your reply, that would be helpful. The output will be big, but that's okay.richy240 wrote:I'm running version 6.0.1, thanks for your help.
Energy EAGLE Discussion
Re: Energy EAGLE Discussion
Re: Energy EAGLE Discussion
All right homeboy, here it is. If you need anything else, just say the word.
- Attachments
-
- EAGLE_log.txt
- (17.26 KiB) Downloaded 278 times
Re: Energy EAGLE Discussion
Version 0.9.7 Posted
Changes from 0.9.6:
Changes from 0.9.6:
- Significantly re-organized data gathering code by separating individual EAGLE command calls into separate methods.
- Changed status gathering back to every 5 seconds, but only for the current load data. Historical data is now gathered only every 20 seconds.
- Fixed a bug that would cause a UnicodeDecodeError by explicitly specifying that XML from the EAGLE is Windows-1252 encoded (as specified in the EAGLE XML-API docs).
Re: Energy EAGLE Discussion
Thanks richy. Those logs are helpful. The point at where it's crashing is where the debug logger is attempting to process the XML for display but runs into an encoding issue.richy240 wrote:All right homeboy, here it is. If you need anything else, just say the word.
Try out version 0.9.7. I put some code in there to specify that XML data from the EAGLE should be interpreted as "Windows-1252" encoded (as described in Rainforest Automation's XML API). For some reason, your unit has a non-ASCII character in the output (perhaps a name or other custom parameter). Hopefully, this update will eliminate the errors.
Re: Energy EAGLE Discussion
Ok, here's what I'm getting now.
Code: Select all
Energy EAGLE Debug eagleDeviceData called. Device: EAGLE Energy Sensor
Energy EAGLE Debug sendCommand called.
Energy EAGLE Debug connect called.
Energy EAGLE Debug Attempt # 1 to connect to EAGLE.
Energy EAGLE Debug Sending command
<LocalCommand>
<Name>get_device_data</Name>
<MacId>0xd8d5b90000000d09</MacId>
</LocalCommand>
to "EAGLE Energy Sensor".
Energy EAGLE Debug Reading data from "EAGLE Energy Sensor".
Energy EAGLE Debug Data returned:
<NetworkInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<Status>Connected</Status>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<ExtPanId>0x7fffffffffffffff</ExtPanId>
<ShortAddr>0x0000ffff</ShortAddr>
<Channel>25</Channel>
<LinkStrength>100</LinkStrength>
</NetworkInfo>
<DeviceInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<InstallCode>0x9b9bf36a05ff50b1</InstallCode>
<LinkKeyHigh>be9bf8b2123344bc</LinkKeyHigh>
<LinkKeyLow>99a8996c5e2984e3</LinkKeyLow>
<FWVersion>1.4.23 (5099)</FWVersion>
<HWVersion>3.2.3</HWVersion>
<Manufacturer>Rainforest Automation, I</Manufacturer>
<ModelId>RFA-Z109 EAGLE</ModelId>
<DateCode>20121201EC051052</DateCode>
</DeviceInfo>
<InstantaneousDemand>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Demand>0x0000000000001094</Demand>
<TimeStamp>0x19bd2c29</TimeStamp>
<Multiplier>0x00000001</Multiplier>
<Divisor>0x000003e8</Divisor>
<DigitsRight>0x00000003</DigitsRight>
<DigitsLeft>0x00000006</DigitsLeft>
<SuppressLeadingZero>0x0001</SuppressLeadingZero>
</InstantaneousDemand>
<CurrentSummation>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<SummationDelivered>0x0000000002053c2c</SummationDelivered>
<SummationReceived>0x0000000000000000</SummationReceived>
<Multiplier>0x00000001</Multiplier>
<Divisor>0x000003e8</Divisor>
<DigitsRight>0x00000003</DigitsRight>
<DigitsLeft>0x00000006</DigitsLeft>
<SuppressLeadingZero>0x01</SuppressLeadingZero>
</CurrentSummation>
<PriceCluster>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Price>0x00000063</Price>
<Currency>0x0348</Currency>
<TrailingDigits>0x03</TrailingDigits>
<Tier>0x00</Tier>
<RateLabel>Set by User</RateLabel>
</PriceCluster>
<MessageCluster>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Id>0x0000</Id>
<Text></Text>
<ConfirmationRequired>N</ConfirmationRequired>
<Confirmed>N</Confirmed>
<Queue>active</Queue>
</MessageCluster>
<MeterInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Type>0x0000</Type>
<Nickname>ˆà@€é</Nickname>
<Account></Account>
<Auth></Auth>
<Host></Host>
<Enabled>0x2d</Enabled>
</MeterInfo>
Energy EAGLE Debug Parsing XML data from "EAGLE Energy Sensor".
Energy EAGLE Error Error parsing XML from EAGLE Energy Sensor: Error: 'ascii' codec can't encode characters in position 2325-2326: ordinal not in range(128)Re: Energy EAGLE Discussion
Okay. We're getting closer. I think I know where that's happening. (That Meter Nickname is the culprit). I'll hunt that bug down and post another update later tonight or tomorrow.
Re: Energy EAGLE Discussion
I noticed that, but I can't find a place in the Eagle's UI to set the nickname.nsheldon wrote:Okay. We're getting closer. I think I know where that's happening. (That Meter Nickname is the culprit). I'll hunt that bug down and post another update later tonight or tomorrow.
Re: Energy EAGLE Discussion
Version 0.9.8 Posted
Changes from 0.9.7:
Changes from 0.9.7:
- Second attempt to fix a bug that would cause a UnicodeDecodeError when there were non-ASCII characters in the EAGLE's XML output.
Re: Energy EAGLE Discussion
Okay. Give version 0.9.8 a try. I don't know if it will work or not, but hopefully it will.richy240 wrote:I noticed that, but I can't find a place in the Eagle's UI to set the nickname.
As for the meter nickname, I don't think you can set that on the EAGLE. I believe that information is provided by the meter itself (or, rather, the energy company who configures the meter).
Re: Energy EAGLE Discussion
Ok, here are my most recent results, from start to finish. There's still an error, but at least it's different this time. 
Code: Select all
Energy EAGLE Debug eagleDeviceData called. Device: EAGLE Energy Sensor
Energy EAGLE Debug sendCommand called.
Energy EAGLE Debug connect called.
Energy EAGLE Debug Attempt # 1 to connect to EAGLE.
Energy EAGLE Debug Sending command
<LocalCommand>
<Name>get_device_data</Name>
<MacId>0xd8d5b90000000d09</MacId>
</LocalCommand>
to "EAGLE Energy Sensor".
Energy EAGLE Debug Reading data from "EAGLE Energy Sensor".
Energy EAGLE Debug Stopping device: EAGLE Energy Sensor
Energy EAGLE Debug Data returned:
<NetworkInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<Status>Connected</Status>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<ExtPanId>0x7fffffffffffffff</ExtPanId>
<ShortAddr>0x0000ffff</ShortAddr>
<Channel>25</Channel>
<LinkStrength>100</LinkStrength>
</NetworkInfo>
<DeviceInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<InstallCode>0x9b9bf36a05ff50b1</InstallCode>
<LinkKeyHigh>be9bf8b2123344bc</LinkKeyHigh>
<LinkKeyLow>99a8996c5e2984e3</LinkKeyLow>
<FWVersion>1.4.23 (5099)</FWVersion>
<HWVersion>3.2.3</HWVersion>
<Manufacturer>Rainforest Automation, I</Manufacturer>
<ModelId>RFA-Z109 EAGLE</ModelId>
<DateCode>20121201EC051052</DateCode>
</DeviceInfo>
<InstantaneousDemand>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Demand>0x00000000000012f1</Demand>
<TimeStamp>0x19be18f7</TimeStamp>
<Multiplier>0x00000001</Multiplier>
<Divisor>0x000003e8</Divisor>
<DigitsRight>0x00000003</DigitsRight>
<DigitsLeft>0x00000006</DigitsLeft>
<SuppressLeadingZero>0x0001</SuppressLeadingZero>
</InstantaneousDemand>
<CurrentSummation>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<SummationDelivered>0x000000000205a205</SummationDelivered>
<SummationReceived>0x0000000000000000</SummationReceived>
<Multiplier>0x00000001</Multiplier>
<Divisor>0x000003e8</Divisor>
<DigitsRight>0x00000003</DigitsRight>
<DigitsLeft>0x00000006</DigitsLeft>
<SuppressLeadingZero>0x01</SuppressLeadingZero>
</CurrentSummation>
<PriceCluster>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Price>0x00000063</Price>
<Currency>0x0348</Currency>
<TrailingDigits>0x03</TrailingDigits>
<Tier>0x00</Tier>
<RateLabel>Set by User</RateLabel>
</PriceCluster>
<MessageCluster>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Id>0x0000</Id>
<Text></Text>
<ConfirmationRequired>N</ConfirmationRequired>
<Confirmed>N</Confirmed>
<Queue>active</Queue>
</MessageCluster>
<MeterInfo>
<DeviceMacId>0xd8d5b90000000d09</DeviceMacId>
<MeterMacId>0x000781000052ca0b</MeterMacId>
<Type>0x0000</Type>
<Nickname>ˆà@€é</Nickname>
<Account></Account>
<Auth></Auth>
<Host></Host>
<Enabled>0x2d</Enabled>
</MeterInfo>
Energy EAGLE Debug Parsing Device Data XML from "EAGLE Energy Sensor".
Energy EAGLE Error Error parsing XML from EAGLE Energy Sensor: Error: not well-formed (invalid token): line 1, column 2325Re: Energy EAGLE Discussion
Version 0.9.9 Posted
Changes from 0.9.8:
Changes from 0.9.8:
- Third attempt to fix a bug that would cause a UnicodeDecodeError when there were non-ASCII characters in the EAGLE's XML output.
Re: Energy EAGLE Discussion
I'm still getting the same error.nsheldon wrote:Version 0.9.9 Posted
Changes from 0.9.8:
- Third attempt to fix a bug that would cause a UnicodeDecodeError when there were non-ASCII characters in the EAGLE's XML output.
Code: Select all
Energy EAGLE Error Error parsing XML from EAGLE Energy Sensor: Error: not well-formed (invalid token): line 1, column 2327Re: Energy EAGLE Discussion
OK! Thanks a lot Nathan for helping me get through those issues. The Energy Eagle is running like a champ now, and I am finally in the process of building my Control Pages, and including this information for all to see (and consider)!
I do have a recommendation, however. It would be really awesome if costs were rounded to two decimal places, instead of the 3 that are currently displayed. Aside from simply being a peeve, I'm not sure how I can spend $0.007 in real life without rounding up, so displaying it this way seems kinda odd to me.
Otherwise AWESOME PLUGIN SIR! Crap, even with the third decimal place, this is a super cool plugin that will really add value to my automation system. THANK YOU!
EDIT: I guess I could create a trigger that grabs this value, clips it, and injects the modified value into a variable or something. So in that case, never mind. If/when I get around to doing this, I'll post the code.
I do have a recommendation, however. It would be really awesome if costs were rounded to two decimal places, instead of the 3 that are currently displayed. Aside from simply being a peeve, I'm not sure how I can spend $0.007 in real life without rounding up, so displaying it this way seems kinda odd to me.
Otherwise AWESOME PLUGIN SIR! Crap, even with the third decimal place, this is a super cool plugin that will really add value to my automation system. THANK YOU!
EDIT: I guess I could create a trigger that grabs this value, clips it, and injects the modified value into a variable or something. So in that case, never mind. If/when I get around to doing this, I'll post the code.
Re: Energy EAGLE Discussion
Sorry I forgot to get back to you on that one. So did that error clear up?richy240 wrote:I'm still getting the same error.
That's a good point.richy240 wrote:I do have a recommendation, however. It would be really awesome if costs were rounded to two decimal places, instead of the 3 that are currently displayed. Aside from simply being a peeve, I'm not sure how I can spend $0.007 in real life without rounding up, so displaying it this way seems kinda odd to me.
Glad you like the plugin so far!
Re: Energy EAGLE Discussion
Nathan,
Forever ago, we were talking about how the Eagle represents negative net flow, since I have solar. You asked me for a snippet of the XML coming back from the Eagle.
The next day, SCE came out and replaced my meter, for no apparent reason, and it took 3 weeks (!) to get the meter provisioned and the Eagle to talk to it. Today, I finally had a chance to capture the data during the sunlight hours.
Here's what the Eagle is sending (for demand, summation, etc):
Note that the demand figure is huge:
demand = 4294965389
multiplier = 1
divisor = 1000
They've got negative numbers rolling over, so 0xffffffff = -1
Inverting it gives us what we need:
-1907 * 1 / 1000 = -1.907 kW (which is what displays on the web viewer)
For summation, we don't have to do this, because they are both positive numbers:
"Delivered" is energy delivered to the house from Edison (shown as "From Grid"), which I would call "Received", but whatever. 
Hope this helps. Thanks!!
Forever ago, we were talking about how the Eagle represents negative net flow, since I have solar. You asked me for a snippet of the XML coming back from the Eagle.
The next day, SCE came out and replaced my meter, for no apparent reason, and it took 3 weeks (!) to get the meter provisioned and the Eagle to talk to it. Today, I finally had a chance to capture the data during the sunlight hours.
Here's what the Eagle is sending (for demand, summation, etc):
Code: Select all
<InstantaneousDemand>
<DeviceMacId>0xd8d5b90000000ea3</DeviceMacId>
<MeterMacId>0x0007810000bfcf52</MeterMacId>
<Demand>0xfffff88d</Demand>
<TimeStamp>0x19d4ca0d</TimeStamp>
<Multiplier>0x00000001</Multiplier>
<Divisor>0x000003e8</Divisor>
<DigitsRight>0x00000003</DigitsRight>
<DigitsLeft>0x00000006</DigitsLeft>
<SuppressLeadingZero>0x0001</SuppressLeadingZero>
</InstantaneousDemand>
Note that the demand figure is huge:
demand = 4294965389
multiplier = 1
divisor = 1000
They've got negative numbers rolling over, so 0xffffffff = -1
Inverting it gives us what we need:
Code: Select all
>>> print (demand | ~0xffffffff)
>>> -1907
For summation, we don't have to do this, because they are both positive numbers:
Code: Select all
<SummationDelivered>
0x00000000001341f2
</SummationDelivered>
<SummationReceived>
0x00000000000313de
</SummationReceived>
Hope this helps. Thanks!!
- Attachments
-
- eagle-log-file.txt
- Log file
- (7.3 KiB) Downloaded 210 times