-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger to poll miner (after it's been offline) #293
Comments
I'm not 100% certain of this, but its possible that pyasic or hass-miner is crashing due to the miner being completely offline. I'm guessing there would be some way to have the miner show as unavailable, rather than just have unknown values, and just poll it every so often in a safe way once it has been determined to be offline, that may be the best option. Can you check your logs and see if there are any places that pyasic has raised an error, or anything that would seem to crash the integration when the miner is shut down? |
That was a few weeks ago, I'll try to remember to look tomorrow when I plan to turn it off again. Polling once every minute (or 5) would be fine, it's local network. |
This is pretty much exactly what I expected, but slightly confusing. It seems like the miner is being re-queried at some point and is failing to be found. I'll have to figure out under what circumstances it re-queries, add a check for none, then let HASS know it is missing, and re-query every once in a while. |
From my research, it seems like it should be polling the machine after this anyway, can you try out this release and see if it fixes the issue (as well as #294)? |
The number is a bit confusing. I'm currently running v1.1.0beta2 |
Different repo, sorry. I will update the name though to v1.1.1b1. |
Mmm, there's no git on HASS so it's a bit of a pain to switch between repo's, but I'll try. |
This file has 0 bytes: https://github.com/b-rowan/hass-miner/archive/refs/tags/v1.1.1b1.tar.gz |
Anyway I was able to download the zip, extract on my own computer and then drag and drop it into the web based Visual Studio. Ridiculous but works :-) |
Well then... Try now? I just deleted that release and re-added it, and it now has data in it. |
You just have to delete the old repo and change the URL, then you can use it. It is definitely a bit annoying, even with hacs, and you may need to reboot to get it to work properly. |
Indeed. It seems that you can't just replace the code, you have to delete it and reinstall. |
My guess is it has something to do with how HACS installs packages or something... |
Ok, still not polling properly then. It also seems like on the restart it clears and doesn't re-add the entities. I have an idea for this, let me test it here. |
Try v1.1.1b2? I tried raising a ConfigEntryNotReady error in async setup entry, but I have no idea how this will work. I dont even have access to my HASS testing instance right now, so if this doesnt work ill have to try to fix it tonight. |
Ok, I updated, cut power to the miner and restarted home assistant. I then restored power to the miner. Ah, this time after about half a minute it showed as active! Nice. |
Awesome! That's good to know, home assistant dev docs are quite confusing lol. Ill do some testing of my own later, plus working on #294, and hopefully I can push something out. |
Pushed out v1.1.0 (this repo), can you give it a test? I'm hoping the issues I've had with testing it are just on my end... |
I installed the new release, added the miner back, turned off Active and cut the power. I then waited an hour, no crashes in the log. I then switched the power on. The device immediately shows as active. After a few seconds the Active toggle is turned off. And then turns on again (correctly, because it started mining at boot). |
Does it pick up as unavailable while it's offline? |
I made a stupid mistake in the coordinator, I was only updating the miner if it was None, which would never pick up as being "offline". I have pushed a pre-release version (1.1.1rc1), can you try that out? |
I use a smart switch to power the miner on only when I need it, since even in standby it uses a little bit of power. However (especially after a Home Assistant restart) the miner integration will not detect that the miner is awake.
I can work around the issue by reloading the miner integration, but it would be nice if there was some sort of action (that I can call using an automation) to check if the miner is awake.
(it would be better if the miner itself told home assistant it's awake, but presumably that requires a firmware change)
The text was updated successfully, but these errors were encountered: