UtilitechAS / amsreader-firmware

ESP8266 and ESP32 compatible firmware to read, interpret and publish data to MQTT from smart electrical meters, both DLMS and DSMR is supported
Other
381 stars 73 forks source link

Negative Amp on L1 #855

Open danielcherubini opened 4 days ago

danielcherubini commented 4 days ago

Describe the bug Hey, so looking at my HA history, all of a sudden around sept 28th my L1 started reporting negative amps, I'm not sure what is going on, since I haven't updated the firmware or done anything to the system at that time.

I first thought it might have been HA, since I do update that, but I checked the AMS dashboard, and yep, L1 was reporting negative amps.

Expected behavior I do believe it shouldn't be negative, that it should be most likely the postive value of what's being reported.

Screenshots image image

Hardware information:

Relevant firmware information:

Additional context I recently updated the firmware to the latest and the issue persists. Attatched is a telnet log with verbose logging.

telnet.log

ArnieO commented 4 days ago

As indicated in this thread: https://github.com/UtilitechAS/amsreader-firmware/issues/764 some meters report negative current if there is export (solar panels etc). Do you have solar panels?

Can you include the power gauge on a screenshot taken while the current value is negative - so we can see whether the current values seem reasonable?

Also, please run a Telnet debug while current is negative - and post (attached text file) the output. In that way we can check the raw data from the meter. (Or you can do the check yourself by using this tool: https://www.gurux.fi/GuruxDLMSTranslator )

danielcherubini commented 4 days ago

Hi, Yeah I read that thread, and no I don't export any power, no solar, nothing.

Here's with the power gauge

image

I noticed that if it goes over about 1100w then the value goes positive

image

Here's a log when it's negative telnet2.log

and here's one when it's positive. telnet3.log

danielcherubini commented 4 days ago

Actually that part about where it's over 1100w going to positive.. i take that back

image

ArnieO commented 4 days ago

Thank you, and let us look at the content of your logfiles using https://www.gurux.fi/GuruxDLMSTranslator .

ANALYSIS OF telnet2.log We copy the first section in the logfile marked "DLMS frame", and convert it to XML:

<DataNotification>
  <LongInvokeIdAndPriority Value="40000000" />
  <DateTime Value="" />
  <NotificationBody>
    <DataValue>
      <Array Qty="0C" >
        <Structure Qty="02" >
          <!--1.1.0.2.129.255-->
          <OctetString Value="0101000281FF" />
          <String Value="AIDON_V0001" />
        </Structure>
        <Structure Qty="02" >
          <!--0.0.96.1.0.255-->
          <OctetString Value="0000600100FF" />
          <String Value="7359992898552476" />
        </Structure>
        <Structure Qty="02" >
          <!--0.0.96.1.7.255-->
          <OctetString Value="0000600107FF" />
          <String Value="6525" />
        </Structure>
        <Structure Qty="03" >
          <!--1.0.1.7.0.255-->
          <OctetString Value="0100010700FF" />
          <UInt32 Value="00000226" />
          <Structure Qty="02" >
            <Int8 Value="00" />
            <Enum Value="1B" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.2.7.0.255-->
          <OctetString Value="0100020700FF" />
          <UInt32 Value="00000000" />
          <Structure Qty="02" >
            <Int8 Value="00" />
            <Enum Value="1B" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.3.7.0.255-->
          <OctetString Value="0100030700FF" />
          <UInt32 Value="00000000" />
          <Structure Qty="02" >
            <Int8 Value="00" />
            <Enum Value="1D" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.4.7.0.255-->
          <OctetString Value="0100040700FF" />
          <UInt32 Value="00000312" />
          <Structure Qty="02" >
            <Int8 Value="00" />
            <Enum Value="1D" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.31.7.0.255-->
          <OctetString Value="01001F0700FF" />
          <Int16 Value="FFEB" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="21" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.71.7.0.255-->
          <OctetString Value="0100470700FF" />
          <Int16 Value="001D" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="21" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.32.7.0.255-->
          <OctetString Value="0100200700FF" />
          <UInt16 Value="093D" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="23" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.52.7.0.255-->
          <OctetString Value="0100340700FF" />
          <UInt16 Value="093D" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="23" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.72.7.0.255-->
          <OctetString Value="0100480700FF" />
          <UInt16 Value="0940" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="23" />
          </Structure>
        </Structure>
      </Array>
    </DataValue>
  </NotificationBody>
</DataNotification>

In the XLM we need to find the sections having the OBIS codes for instantaneous phase currents, which end with 31.7.0, 51.7.0 and 71.7.0 - which is this section:

<Structure Qty="03" >
          <!--1.0.31.7.0.255-->
          <OctetString Value="01001F0700FF" />
          <Int16 Value="FFEB" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="21" />
          </Structure>
        </Structure>
        <Structure Qty="03" >
          <!--1.0.71.7.0.255-->
          <OctetString Value="0100470700FF" />
          <Int16 Value="001D" />
          <Structure Qty="02" >
            <Int8 Value="FF" />
            <Enum Value="21" />
          </Structure>
        </Structure>

This is a "List 2" message as explained in the Aidon Interface specification.

There is no section 51.7.0 - so this meter does not report the current on phase L2.

So the first payload / data frame of your file telnet2.log reports negative current on L1, positive on L3.

The next 3 frames are short List 1 frames (see Interface spec), only containing Instantaneous active import power (OBIS code 1.7.0).

The second List 2 frame in this logging: Current on L1 is reported as 0xFFEA -> -2,2 A

So there are two consecutive frames with negative current on phase L1.


ANALYSIS OF Logfile: telnet3.log

The first List 2 frame reports 0x0034 (5,2 A) on L1 and 0x0049 (7,3 A) on L3. So no negative number in this frame.

The second List 2 frame reports 0x0034 (5,2 A) on L1 and 0x004A (7,4 A) on L3. No negative number.


CONCLUSION Analysis of the raw data confirms that your meter sometimes reports negative current values on phase 1. As you do not have power generation in your installation, this is not normal. I recommend you to contact your grid company and ask if they are aware of such a situation in your installation (they could be, based on collected data from the meter), and ask them what the reason could be.

I think this could be an indication of a problem at grid level in your area/neighborhood - so it could be that your grid company is already aware of the situation and working on it.

Please be so kind as to report back here when you have been in contact with your grid company, as we would like to learn from this situation; as it might happen again.