<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Steve,<br>
    <br>
    "awake" = vehicle has been switched on by the user<br>
    "on" = vehicle is in drive mode ("ignited")<br>
    <br>
    The point is, "charging" is not "being awake". The idle alert checks
    if the car is awake but not moving.<br>
    <br>
    If you cannot tell if the user switched on the vehicle, assume it
    isn't when you detect charge mode.<br>
    <br>
    Another option is to implement your own idle alert handling, e.g. by
    overriding OvmsVehicle::NotifyVehicleIdling().<br>
    <br>
    The <font face="monospace">vehicle.charge.state</font> event is
    bound to changes of the "v.c.state" metric. Charge state is meant to
    only cover main battery charge states, it's defined & assumed to
    be one of…<br>
    <br>
    <font face="monospace">// charging, topoff, done, prepare,
      timerwait, heating, stopped</font><br>
    <br>
    …or empty (unknown). There's currently no "idle" state, it's meant
    to keep the last charge state.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 16.01.21 um 14:52 schrieb Steve
      Davies:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABFTEGVzs2UeE6T7woFQMFxa0XoZvrMBn-hnN9rCCDVbikdKww@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi Michael,</div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Sat, 16 Jan 2021 at
            14:53, Michael Balzer <<a href="mailto:dexter@expeedo.de"
              moz-do-not-send="true">dexter@expeedo.de</a>> wrote:<br>
          </div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>To avoid the "idling" alert, don't set the awake state
              during charges. "Awake" represents the vehicle being
              switched on, not automatic activity.<br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>Help me understand "v.e.awake" vs "v.e.on"?</div>
          <div><br>
          </div>
          <div>I'm currently setting "awake" when I'm getting data from
            the OBD-II, ie the car is responsive ("awake").  I'm not
            sure how to tell if that happened by user action or
            automatically.</div>
          <div><br>
          </div>
          <div>I set "v.e.on" when the car is actually ready to drive
            (at the moment I detect that the power steering ECU is
            responsive since that only comes on when the car is
            "READY").</div>
          <div><br>
          </div>
          <div>If "awake" is supposed to mean ready to drive, what does
            "on" mean?</div>
          <div><br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div><br>
              Also, if distinguishable, you should only set
              "charging12v" in that case, as "charging" is meant for the
              main battery.<br>
              <br>
            </div>
          </blockquote>
          <div> </div>
          <div>As for the charge.state event - it should generally have
            a value like idle, charging etc.  In this case though the
            value was empty - this is because OVMS rebooted at 01:25UTC
            and had not been able to talk to the car since then since
            the car was asleep. </div>
          <div><br>
          </div>
          <div>Here all the relevant events and metric changes:</div>
          <div><br>
          </div>
          <div><font face="monospace">2021-01-16T01:25:06+0000
              ovms/CAA5060/metric/v/c/state                        #
              OVMS rebooted. v.c.state initialised empty.</font></div>
          <div><font face="monospace">                                 
                                                          #   and since
              we can't talk to the car we never know better<br>
              2021-01-16T09:25:24+0000 ovms/CAA5060/event
              vehicle.charge.state              # Vehicle woke, for some
              reason mqtt code decided to send the charge.state at this
              point<br>
              2021-01-16T09:25:24+0000 ovms/CAA5060/event
              vehicle.charge.12v.start          # 12v charging detected
              by current flow into 12v battery.</font></div>
          <div><font face="monospace">2021-01-16T09:26:42+0000
              ovms/CAA5060/metric/v/c/state idle                   #
              Since car is now alive we get the "idle" charge state. 
              BUT WHERE IS THE charge.state EVENT?<br>
              2021-01-16T10:25:33+0000 ovms/CAA5060/event
              vehicle.charge.12v.stop           # Car decides to stop
              charging the 12v.<br>
            </font></div>
          <div><font face="monospace"><br>
            </font></div>
          <div>I'm not clear why another "vehicle.charge.state" event
            was not sent with "idle".</div>
          <div><br>
          </div>
          <div>I did not implement GetNotifyChargeStateDelay in my
            vehicle module - so I wonder if it ended up suppressed.</div>
          <div><br>
          </div>
          <div>Alternatively - at 09:26:42 the module was sending all
            metrics to MQTT.  This implies that it had lost and
            re-established MQTT session.  I wonder if that interfered
            with the MetricChanged logic.</div>
          <div><br>
          </div>
          <div>Unfortunately my log doesn't have metrics trace enabled
            so I can't see exactly.</div>
          <div><br>
          </div>
          <div>Steve</div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
  </body>
</html>