• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "automation". Back to normal view
    1. Tech people of Tildes, what have you automated in your life?

      Talk about anything you have "automated" in your life. No restrictions on the tools or things to automate. You have a simple "silence your phone at work" thing? Great job! Do you have a complex...

      Talk about anything you have "automated" in your life. No restrictions on the tools or things to automate. You have a simple "silence your phone at work" thing? Great job! Do you have a complex thing with hundreds of lines of custom code? Wonderful! All are welcome!


      I myself have automated a bit of stuff, and am constantly looking for more (that's why this thread exists):

      Home:

      • My room will turn on the lights when it detects the brightness inside is going down, but will slowly do it relative to the current brightness so it doesn't suddenly turn on at once. (Tries to keep a certain brightness at certain times)
      • I can send "loff", "lon" or, "lauto" through XMPP to turn my lights off, on, or toggle the automatic mode mentioned above from anywhere. I am blocking internet connections from my smart light hub so I had to re-implement that manually

      Computer:

      • Copying any YouTube links (or Invidious links, which get translated into YouTube) will automatically prompt me about opening them under MPV

      Phone:

      This is where I do the bulk of my automation, as Tasker is a very convenient way to automate stuff.

      • Toggle full brightness and/or auto rotation on specific apps (Gallery, NewPipe, etc.)
      • A couple of Android "Share" targets for
        • Uploading dumb images to my webserver
        • Adding links to Miniflux (abusing it's bookmarklet functionality)
        • youtube-dl through Termux
      • And some (mostly gimmicky) text-to-speech notifications for calls and XMPP messages

      Planned:

      • Miniflux notifier over XMPP. My last attempt failed because Node-RED apparently doesn't reconnect over to XMPP when its connection drops :(
      26 votes
    2. Phone automation - Share your workflows!

      I recently switched operating systems on my phone and lost some of the automated workflows I had during the transition. While I've rebuilt some of it, but it sometimes feels like I'm missing...

      I recently switched operating systems on my phone and lost some of the automated workflows I had during the transition. While I've rebuilt some of it, but it sometimes feels like I'm missing something or that I could do more, I just don't know what exactly. I'd like to hear from others here and see if they can inspire me to implement what works for them. I'm using an android phone with automate and here's the workflows that I got:

      • When plugging in the phone, set it to do not disturb and enable Bluetooth. This is for when I go to sleep so that I don't get woken up by notifications and I can listen to podcasts on my headband.
      • If at work (Based on cell towers, not GPS) set phone to vibrate, when leaving it set it to ring. I actually lost this one but haven't rebuilt it since I've not been to the office in a while.
      • Learn location. For a set time, grabs the cell towers around and stores them in a JSON file.

      What kind of automation have you implemented on your phone?

      18 votes
    3. What tasks on your computer have you automated?

      After using Shreddit to delete my Reddit history periodically for some time now, I finally decided to make a cron job to automate it on a weekly basis. I use it to delete every post and comment...

      After using Shreddit to delete my Reddit history periodically for some time now, I finally decided to make a cron job to automate it on a weekly basis. I use it to delete every post and comment that isn't whitelisted, which right now is just a tiny subreddit for a musician I like that I solely moderate and a pinned post explaining why I have a bunch of karma but barely any posts.

      After setting this up, it got me curious as to what tasks other people automate in their lives in order to streamline their workflows and eliminate minor (or major) routine tasks.

      So, what do you automate, and how did you go about doing it?

      18 votes
    4. What do you do when asked to automate away other peoples' jobs?

      At work there's a project that was originally pitched as an automated system we would build for a new client, and now the conversation has shifted towards automating away some data entry tasks for...

      At work there's a project that was originally pitched as an automated system we would build for a new client, and now the conversation has shifted towards automating away some data entry tasks for an existing client. If the project is successful I would guess that some or all of the people doing the data entry tasks would be out of a job. And if it's a resounding success I would guess that the powers that be would be eager to apply it in other areas and potentially put more people out of jobs.

      This project is in the very early stages of gathering requirements and whatnot so it's not really clear what exactly we're building or what my role in building it would be. But it involves a technology that's new to us (natural language processing) and often times I end up playing some role in a project that involves learning something new, even if it's just in some small way.

      So yeah, I know automation replacing low-skill work is nothing new and if these jobs can be automated away, they will be sooner or later, but this is the first time I've been confronted with the idea of using my skills to put people I don't know out of a job and it sticks in my craw. Normally I love automation and interacting with new (to me) tech even if it's nothing groundbreaking and I'm just doing the plumbing to connect system A to interface B, but in the past it's always been in the name of freeing up people from tedious tasks so that they can do more interesting and more important work, rather than "freeing" them of their paycheck. So I'm finding myself adding this to the small but compelling pile of frustrations I have with this job and weighing it against the also-small but also-compelling pile of things I love about it.

      Anyway, if you've ever been in a position where you were asked to automate away someone else's job, how did that go? What did you do?

      If you haven't, what do you think you would do?

      16 votes
    5. How standardised are Z-Wave/ZigBee device APIs? Can I directly control off-the-shelf hardware?

      I'm looking to get a couple of remote controlled dimmer sockets for a quite specific use case (heat lamps in a tortoise enclosure), and I'd like to control them directly from a Raspberry Pi. I've...

      I'm looking to get a couple of remote controlled dimmer sockets for a quite specific use case (heat lamps in a tortoise enclosure), and I'd like to control them directly from a Raspberry Pi. I've found a couple of decent looking fairly generic options - examples from Trust and TKB - and there seem to be several appropriate radio modules, either USB or GPIO.

      Detecting and pairing with devices seems (hopefully) straightforward. My sticking point is trying to figure out how standardised the actual messaging is; there seem to be several brands of hub and device that can be used interchangeably, but a few that can't. In my case, of course, the RasPi will be taking the position of the hub and speaking to the devices directly.

      I'm having trouble finding reliable info on whether a command like "dim to 70%", or "read output power" will be the same across all devices, whether it will follow some kind of standard but it may be one of several competing formats, or whether it's completely proprietary.

      Any insight on how easy it is to programatically talk to these things would be very much appreciated!

      6 votes
    6. Make Emacs write (part of) your git commit messages

      I was fed up with the chores of writing consistent git commit messages, so a while ago I started developing a hook in Emacs which I used with Magit (actually git-commit-mode) which uses some crude...

      I was fed up with the chores of writing consistent git commit messages, so a while ago I started developing a hook in Emacs which I used with Magit (actually git-commit-mode) which uses some crude heuristics to fill out the COMMIT_EDITMSG buffer for me. Here is what it does (| stands for the cursor):

      • If only a single file modified, insert <filename>: |

        • If can figure out function name, insert <filename> (<functionname>): |
      • If only a single file added, insert Add <filename>|

      • If a TODO added to Readme.org, insert ; TODO <headline>|

      • If a TODO was DONE, insert ; DONE <headline>|

      • If the files are Readme.org and Readme.org_archive, and no new TODO's were added anywhere, insert ; Archive DONE|

      • If the file is .gitignore, insert ; Ignore |

      • If the file is TAGS, insert ; Update TAGS|

      I extend this when I find new cases where I repeatedly do the same thing. The code is below. It's probably a good idea to use it as a starting point and personalise it because this reflects how I like to write my commit messages (and I like pretending how they do it over at Emacs git repo). It is sloppy and probably buggy, but I don't think it can be destructive.

      Final note: I can't figure out how to set this up so that after this takes effect, the buffer is marked as modified. I want to flip the modified bit so that in some cases I can just hit C-c C-c and go. But I need to modify the buffer somehow to commit in some cases (I just type C-o to open a new line in those cases). Here is the function:

      (defun gk-git-commit-mode-hook ()
        "Set up git commit buffer."
        ;; If a single file is modified, prefix the message w/ it.
        (let ((modified-re "^#	modified:")
              (new-re "^#	new file:")
              (issue-re "^[+\\- ]\\*+ \\(TODO\\|DONE\\) ")
              current-defun filename addp onlyp issuep)
          (save-excursion
            (with-current-buffer "COMMIT_EDITMSG"
              (goto-char (point-min))
              (re-search-forward "^# Changes to be committed:" nil t)
              (forward-line)
              (beginning-of-line)
              (cond ((looking-at modified-re)
                     (re-search-forward ":   " nil t)
                     (setf filename (thing-at-point 'filename t)))
                    ((looking-at new-re)
                     (re-search-forward ":   " nil t)
                     (setf filename (thing-at-point 'filename t)
                           addp t)))
              (setq onlyp (progn
                            (forward-line)
                            (not (or (looking-at modified-re)
                                     (looking-at new-re)))))
              (when (and onlyp (equal filename "Readme.org"))
                (goto-char (point-min))
                (when-let* ((pos (re-search-forward issue-re nil t)))
                  (setq issuep (progn
                                 (re-search-backward "\\*" nil t)
                                 (buffer-substring (1+ (point))
                                                   (line-end-position))))))
              ;; Try to set ‘current-defun’.
              (when onlyp
                (save-excursion
                  (goto-char (point-min))
                  ;; Error if not found, means verbose diffs
                  ;; not enabled.
                  (re-search-forward "^diff --git")
                  (goto-char (line-beginning-position))
                  (let ((str (buffer-substring (point) (point-max)))
                        (default-directory (expand-file-name "..")))
                    (with-temp-buffer
                      (insert str)
                      (diff-mode)
                      (goto-char (point-min))
                      (setq current-defun (diff-current-defun))))))))
          (if onlyp
              (cond
               ((and issuep (not addp))
                (goto-char (point-min))
                (insert ";" issuep))
               ((equal filename "TAGS")
                (goto-char (point-min))
                (insert "; Update TAGS"))
               ((equal filename ".gitignore")
                (goto-char (point-min))
                (insert "; Ignore "))
               (filename
                (goto-char (point-min))
                (if addp
                    (insert "Add " filename)
                  (insert
                   filename
                   (if (and current-defun)
                       (format " (%s)" current-defun)
                     "")
                   ": "))))
            (when (and (equal filename "Readme.org")
                       (save-excursion
                         (goto-char (point-min))
                         (re-search-forward (concat modified-re " +Readme.org_archive")
                                            nil t))
                       (save-excursion
                         (goto-char (point-min))
                         (re-search-forward "\\-\\*+ DONE" nil t))
                       (not
                        (save-excursion
                          (goto-char (point-min))
                          (re-search-forward "\\+\\*[\\+\\-] TODO" nil t))))
              (goto-char (point-min))
              (insert "; Archive DONE")))))
      
      (add-hook 'git-commit-mode-hook #'gk-git-commit-mode-hook)
      

      Hope you find it useful.

      12 votes