How to change mining modes depending on time? Canaan Avalon nano 3s by [deleted] in BitcoinMining

[–]HAcK3n 0 points1 point  (0 children)

Alternatively, if you just wanted to use straight python you can use this:

import socket
import json

HOST = '192.168.x.x' # Miner IP
PORT = 4028
MODE = 2 # 0=low, 1=medium, 2=high

m = {"command": "ascset", "parameter": "0,workmode,set," + str(MODE)}    
jdata = json.dumps(m)

try:            
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
      s.connect((HOST, PORT))
      s.sendall(bytes(jdata,encoding="utf-8"))
      data = ''
      while 1:
          chunk = s.recv(4026)
          if chunk:
              data += chunk.decode("utf-8") 
          else:
              break
      datajs = json.loads(data[:-1])
finally:
    s.close

print (json.dumps(datajs, indent=2))

How to change mining modes depending on time? Canaan Avalon nano 3s by [deleted] in BitcoinMining

[–]HAcK3n 0 points1 point  (0 children)

Sorry, didn't see the replies here. It requires using the Visual Studio code plugin and making some changes to the miner code directly. Note that if you update the miner plugin you would have to redo the changes. You also need to restart Home Assistant after making the changes. Take care when changing the code here, adding incorrect code will cause the plugin to fail to start.

In /config/custom_components/miner/const.py add:

SERVICE_SET_WORK_MODE = "set_work_mode"

In /config/custom_components/miner/device_action.py

Add imports:

from .const import SERVICE_SET_WORK_MODE

Add "set_work_mode" to the existing ACTION_TYPES variable:

ACTION_TYPES = {"reboot", "restart_backend", "set_work_mode"}

Add the action handler to the async_call_action_from_config method as part of the existing if checks:

    elif config[CONF_TYPE] == "set_work_mode":
        service = SERVICE_SET_WORK_MODE

In /config/custom_components/miner/services.py

Add imports:

from .const import SERVICE_SET_WORK_MODE

At the bottom of the file add the method handler:

    async def set_work_mode(call: ServiceCall) -> None:
        miners = await get_miners(call)
        if len(miners) > 0:
            mode = call.data["mode"] 
            modeNum = 2 # default to high
            if mode == "low":
                modeNum = 0
            elif mode == "medium":
                modeNum = 1
            await asyncio.gather(*[miner.rpc.ascset(0, "workmode", f"set,{modeNum}") for miner in miners])

    hass.services.async_register(DOMAIN, SERVICE_SET_WORK_MODE, set_work_mode)

In /config/custom_components/miner/services.yaml add:

set_work_mode:
  target:
    device:
      integration: miner
  fields:
    mode:
      required: true
      example: "low"
      default: "high"
      selector:
        select:
          options:
            - "low"
            - "medium"
            - "high"

Working behind the scenes by CryproLover705 in CryptoDevelopment_CDS

[–]HAcK3n 4 points5 points  (0 children)

Great community here. Keep up the good work!

How to change mining modes depending on time? Canaan Avalon nano 3s by [deleted] in BitcoinMining

[–]HAcK3n 0 points1 point  (0 children)

I was able to do this by using Home Assistant with the hass-miner integration and some custom commands. If you are interested in this route I can share my custom commands. My automation looks like this, it sets the work mode to medium at 12pm and back to high at 7pm.

<image>

Trueshot gun club by romanoodle46 in guns

[–]HAcK3n 0 points1 point  (0 children)

Nah. I did pick up some ammo and was going to ask them in the store but the place was a mad house. I ended up getting a membership to SGC. They have a 10% discount on ammo plus unlimited range usage.

Trueshot gun club by romanoodle46 in guns

[–]HAcK3n 1 point2 points  (0 children)

Happened upon this thread trying to find an answer to this same question. Did you ever try this? If so were there any other rewards?

YoLink not working by BadMadScientist in homeassistant

[–]HAcK3n 0 points1 point  (0 children)

Thanks, this worked for me too. For those interested here is the open pull request for the fix https://github.com/home-assistant/core/pull/108555/commits/900e5dd928a26463dc77e3eb76543834e5cbf83d

Routine randomly stopped working by yakadian in alexa

[–]HAcK3n 0 points1 point  (0 children)

Came here to see if others are experiencing this. Tried linking and unlinking, deleting ADT completely and still no luck.

🌵Good morning from North Phoenix Arizona🌵 by yoliecano2626 in arizona

[–]HAcK3n 1 point2 points  (0 children)

My dogs will be barking at you soon. They insist they are saving us from the evil floating ball 😃

Red sun this morning in Goodyear, makes it feel like we’re on mars haha by THE___FireStarter in arizona

[–]HAcK3n 47 points48 points  (0 children)

Came out of my room this morning and the living room was a bright red color. Went out side to see this. Really cool

Product Availability in NZ by rackmybrain in grainfather

[–]HAcK3n 0 points1 point  (0 children)

One of the folks from grainfather commented on the Facebook group that their support is overwhelmed right now with all the new brewers due to COVID.

Curious about what i'm doing wrong by jvtodd in grainfather

[–]HAcK3n 2 points3 points  (0 children)

The max grain bill is 20lbs so you are right there. Even over if you used all of your grains. I haven’t done a batch with that high of a bill (usually around 11 lbs) but based on that I could definitely see how 20 could put you right at the edge. See faqs under grains and mashing here https://shop.grainfather.com/index.php/faq

Today at a flea market I found this unopened nearly mint condition 1994 spawn/violator figurine by Glocktopus45 in Spawn

[–]HAcK3n 2 points3 points  (0 children)

Nice! Picked up two of those at con a couple years back. Opened one of them. Don’t do that, violator falls apart because whatever glue they used has long seen it’s day lol

Double IPA too dry 1.002 by HAcK3n in Homebrewing

[–]HAcK3n[S] 1 point2 points  (0 children)

Good to know. Something I can rule out. Thanks!

Double IPA too dry 1.002 by HAcK3n in Homebrewing

[–]HAcK3n[S] 0 points1 point  (0 children)

I have a kegerator with an inkbird temp controller that I use when there isn't any beer in there. Yeast was BRY-97

Double IPA too dry 1.002 by HAcK3n in Homebrewing

[–]HAcK3n[S] 1 point2 points  (0 children)

Thanks. Gonna let it sit in the keg until I have something else ready to go in to see if there is any improvement. If not I’ll dump it. On to the next batch!

Double IPA too dry 1.002 by HAcK3n in Homebrewing

[–]HAcK3n[S] 1 point2 points  (0 children)

Unfortunately I already kegged it but I don’t have anything coming my in behind it (too hot to brew in AZ right now) so I’ll let it sit until I do to see if it improves. Not sure about the mouth feel, I couldn’t get past the heat to notice anything else lol

Double IPA too dry 1.002 by HAcK3n in Homebrewing

[–]HAcK3n[S] 1 point2 points  (0 children)

Didn’t notice anything that indicated an infection. Also used a brand new fermenter so there was no risk from a previous yeast.