Add uptime sensor
ardevd opened this issue · 10 comments
Not feasible given the status output format from the Bobcat diagnoser
I think this is do-able. I've added PR ardevd/bobcatpy#9 which will give us a datetime object of when the container was started.
Is that the uptime you're thinking of?
Thanks for this!
Is the container re-created when you reboot the miner or just when the image is updated? If it's the latter then the uptime value would be misleading. I'll check on it later tonight
I think it's either path. For mine shows yesterday evening (when I last cycled it), I assume it will be changed when the image is updated too.
Edit: I think it relates to the age of the container itself, not related to container image
It seems like you're right. A container can be stopped and started without being recreated but it does indeed seem like the Bobcat re-creates the container after boot.
I've also included the blockchain Height sensor which might be useful in the future:
"blockchain_height": SensorEntityDescription(
key="blockchain_height",
native_unit_of_measurement="blocks",
name="Blockchain Height",
icon="mdi:progress-star",
),
The new version fails to set up due to timeout.
@Hatfa are you sure you're using the latest version? The latest version should not have timeout issues and also includes blockchain height sensor amongst several other new sensors.
uptime sensor implemented.
@ardevd lol.. I didn't have any timeout issues before. I've downloaded the new zip file this morning (using android phone) and started to get issues. just checked on PC. it seems the two sensor.py files aren't the same.(before there was no block height just miner height, the one from morning had other sensors added but wasn't working correctly, now it's all fine) Odd... but no issues now.
Cool. I fixed a breaking bug a few minutes ago and updated the version. I suggest you use HACS to manage the integration instead of manually downloading it from github.