@Andrew1
Updated the driver because it halted on the error in my previous post. I get these error on both my car's, (xc40 -2019 and v40-2018). So not all info was parsed and had to commenting out below code to make it work again.
// sendEvent(name: "hvBatteryChargeStatusDerived", value: obs.hvBattery.hvBatteryChargeStatusDerived, displayed: false)
// sendEvent(name: "hvBatteryChargeModeStatus", value: obs.hvBattery.hvBatteryChargeModeStatus, displayed: true)
// sendEvent(name: "hvBatteryChargeStatus", value: obs.hvBattery.hvBatteryChargeStatus, displayed: true)
// sendEvent(name: "hvBatteryLevel", value: obs.hvBattery.hvBatteryLevel, displayed: true)
// sendEvent(name: "distanceToHVBatteryEmpty", value: obs.hvBattery.distanceToHVBatteryEmpty, displayed: true)
// sendEvent(name: "hvBatteryChargeWarning", value: obs.hvBattery.hvBatteryChargeWarning, displayed: true)
// sendEvent(name: "timeToHVBatteryFullyCharged", value: obs.hvBattery.timeToHVBatteryFullyCharged, displayed: true)
I wanted a direct link to google maps to quickly see where the cars position is and also wanted a second state for the position's values in this format (lat, long) for easy logging to a external db and be able to plotter it as a route where the car have been on a external web page. So added this to the code
attribute "positions", "number"
attribute "GMaps Link", "string"
def sendThis = "${obs.position.latitude}, ${obs.position.longitude}"
def sendThis2 = "<a href=\"https://www.google.com/maps/search/?api=1&query=${obs.position.latitude},${obs.position.longitude}\" target=\"_blank\">${obs.position.latitude},${obs.position.longitude}</a>"
sendEvent(name: "positions", value: sendThis, displayed: true)
sendEvent(name: "GMaps Link", value: sendThis2, displayed: true)
log.info "${obs.position.latitude}, ${obs.position.longitude}"
log.info "<a href=\"https://www.google.com/maps/search/?api=1&query=${obs.position.latitude},${obs.position.longitude}\" target=\"_blank\">${obs.position.latitude},${obs.position.longitude}</a>"
Again, big thanks for the great work on this driver, love it! =)