<div dir="ltr">Hi Chris<div><br></div><div>I can't see any issue with setting the poll state to OFF if the <span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px">charger state is either CHARGER_STATUS_IDLE or CHARGER_STATUS_PLUGGED_IN_</span><span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px">TIMER_WAIT, particularly if the can bus goes to sleep in these states. </span></div><div><span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px"><br></span></div><div><span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px">Kind regards</span></div><div><span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px">Derek</span></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 4 Feb 2025 at 11:47, Chris Box via OvmsDev <<a href="mailto:ovmsdev@lists.openvehicles.com">ovmsdev@lists.openvehicles.com</a>> wrote:<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 style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p id="m_4890371074057665589reply-intro">On 2025-02-03 07:34, Michael Balzer wrote:</p>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
<div id="m_4890371074057665589replybody1">This is the moment the vehicle state change was detected:<br><br>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px"><span style="font-family:"courier new",courier,monospace;font-size:8pt">2025-02-02 21:08:14.372 GMT D (338493292) events: Signal(vehicle.charge.stop)</span></blockquote>
<br>The event is emitted automatically by the vehicle framework when metric "v.c.charging" (ms_v_charge_inprogress) changes from true to false.<br><br>I don't know the Leaf code, but I think that should directly lead to a poller state change, but doesn't.</div>
<div> </div>
</blockquote>
<div> </div>
<div>In <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_nissanleaf/src/vehicle_nissanleaf.cpp" target="_blank">vehicle_nissanleaf.cpp</a> there are four places where we have "StandardMetrics.ms_v_charge_inprogress->SetValue(false);"</div>
<div>They're all in the same switch statement block.</div>
<div> </div>
<div>Two of them also say "PollSetState(POLLSTATE_OFF);"</div>
<div>These are CHARGER_STATUS_INTERRUPTED and CHARGER_STATUS_FINISHED.</div>
<div> </div>
<div>The two that don't set poll state are CHARGER_STATUS_IDLE and CHARGER_STATUS_PLUGGED_IN_TIMER_WAIT.</div>
<div> </div>
<div>For anyone that knows the Leaf code, does it seem reasonable to add PollSetState(POLLSTATE_OFF) to both of those? I note there's a mysterious comment "Separate from vehicle_nissanleaf_poll1() to make it clearer what is going on." but I can find no record of such a function in the current repo.</div>
<div> </div>
<div>Chris</div>
</div>
_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" rel="noreferrer" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br>
</blockquote></div>