yp87 / leaf2mqtt

Pull in data from the Nissan Connect platform for the LEAF and publish over MQTT
GNU General Public License v3.0
42 stars 39 forks source link

Feature Request: Add a server status topic #55

Open apbarratt opened 1 year ago

apbarratt commented 1 year ago

A topic with details of server success rate would be rather useful for quickly figuring out if a problem is likely to be leaf2mqtt or the Nissan servers.

Here's an example, though I suspect I may not fully understand the workflow of how the request and response system works here so do change as would be more appropriate :)

Where leaf represents the default root topic:

Server

Status

Topic Type Description
leaf/server/requestsToday Double The number of requests sent to Nissan's server today
leaf/server/failuresToday Double The number of requests sent to Nissan's server today that resulted in failure
leaf/server/successRate Float A percentage derived from the above values
leaf/server/lastSuccess String A json representation of the last topic and payload that succeeded
leaf/server/lastSuccessDateTimeUtc Iso8601 UTC The datetime when the last request succeeded
leaf/server/lastFailedRequest String A json representation of the topic and payload that failed
leaf/server/lastFailedDateTimeUtc Iso8601 UTC The datetime when the last request failed
leaf/server/lastRequestWasSuccessful Boolean True if the last request sent to the server succeeded. False otherwise
leaf/server/json String A json representation of all server status