I am not sure what is wrong with your Tasker. That is a TIME profile correct???
Hubitat did make the Omni Sensor code available so you can add "battery" capability and setBattery Command to it, delete the rest, and save as your own unique driver type to use.
I have no idea is this is the most efficient way to do it but here is my code:
// Copyright 2016-2019 Hubitat Inc. All Rights Reserved
metadata {
definition (name: "Virtual Battery", namespace: "hubitat", author: "Bruce Ravenel") {
capability "Battery"
command "setBattery", ["Number"]
}
preferences {
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true
}
}
def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("logEnable",[value:"false",type:"bool"])
}
def installed() {
log.warn "installed..."
setBattery(50)
runIn(1800,logsOff)
}
def updated() {
log.info "updated..."
log.warn "debug logging is: ${logEnable == true}"
log.warn "description logging is: ${txtEnable == true}"
if (logEnable) runIn(1800,logsOff)
}
def parse(String description) {
}
def setBattery(bat) {
def descriptionText = "${device.displayName} is ${bat} %"
if (txtEnable) log.info "${descriptionText}"
sendEvent(name: "battery", value: bat, descriptionText: descriptionText, unit: "Degrees")
I quickly tested and it seems to work. I probably could delete more of the code but I don't do Groovy so I didn't want to delete something that might be important.