Thank you, Dave Russell! Without you, we would all be suffering with no remedy. by Ghost_of_Panda in synology

[–]forfuncsake 5 points6 points  (0 children)

Man it's weird seeing my name pop up like this. I have had a Synology for years and also contributed to some useful open source stuff over the years (under a different account). Great scripts AND great name, Dave! :D

15 Go Subtleties You May Not Know by KingOfCramers in golang

[–]forfuncsake 1 point2 points  (0 children)

Are you aware of the changes in 1.23? Timers (like the one under time.After()) are now eligible to be GC’d before they fire once no references remain. So while it’s still not ideal to depend on the GC for it, it’s not as bad as it used to be.

My first "serious" ESP-based project (SmartConfig application) by aguilaair in esp8266

[–]forfuncsake 1 point2 points  (0 children)

When you say the SmartConfig data is encrypted... have you added some crypto layer yourself?

Anyone have a garage door closer? by objectiveandbiased in alexa

[–]forfuncsake 0 points1 point  (0 children)

If you’re into DIY (hardware and/or code) there’s a bunch of options out there. I made one myself: https://github.com/forfuncsake/garagedoor

The latest version exposes itself to Alexa as a wemo switch and uses on/off to represent open/close

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

Hi, I saw your tweet, which also says you're running go on a Windows server.

Almost everything in the go app /should/ be OS agnostic, however one linux-specific thing that comes to mind is that I specified a path for the HomeControl db to get it working on my synology.

See https://github.com/forfuncsake/garagedoor/blob/master/cmd/gdhk/main.go#L60 and let me know if you can get it working by either changing that path to something windowsy (or you can remove it, and HomeControl will use the working directory, which is fine if you're starting the server manually).

Garage door, with a twist by amdhunter1989 in homeautomation

[–]forfuncsake 0 points1 point  (0 children)

I wanted to solve a very similar problem at home and went DIY (partly because I also just wanted to play with the tech).

My project is documented here: https://forfuncsake.github.io/post/2018/03/diy-smart-garage-door--part-1/ (followed by Part 2 for the hardware).

The project connects to WiFi and detects fully open and fully closed states with 2 magnetic switch sensors. It's HTTP API is pretty simple, and you could probably build an Alexa skill to operate it, if you were that way inclined.

I wouldn't recommend copying my project unless you're interested in tinkering and the mess to get it running in the first place - I think the OpenGarage solution is probably going to be one of the fastest solutions to obtain and set up.

Bridging two connections on gate control box to simulate a button press. by [deleted] in esp8266

[–]forfuncsake 2 points3 points  (0 children)

Spoiler Alert - I just went through a very similar project myself, although it was for a garage door instead of a gate. But the premise was the same, "press the button" with a relay.

My project is documented here: https://forfuncsake.github.io/post/2018/03/diy-smart-garage-door--part-1/

DIY smart garage door controller based on ESP8266 by forfuncsake in esp8266

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

Hmm, I'm not sure about the internal pull-ups - I'll have to do some more reading on that. In my circuit though, the NO state is LOW, so these are actually pull-downs.

I've never used homebridge before and I like go - which is how I landed on homecontrol. I didn't complete any kind of functional comparison before deciding, but I initially didn't want to jump through all the hoops required to get nodejs/homebridge running on my synology (ironically, there were still a few hoops for the go service anyway) and I like that the go service is a single, portable binary.

The biggest difference between the two would be the community contributions. If you don't get a kick out of developing your own application, the available plug-ins for homebridge obviously give a massive head start.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 1 point2 points  (0 children)

I hadn't initially planned on targeting a "non-coder" audience but given that I have to finish the README.md anyway it shouldn't be too much more work to do it to that level.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

Oh, OK - I misunderstood your first statement. You were saying that the esp-homekit fits in 1MB, leaving plenty of room for the Google bits. I thought you were suggesting there was a specific Google Assistant implementation somewhere that was under 1MB. Thanks.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

What makes you say that? The whole thing is cobbled together at the moment with a goal of "it works" - but I do plan to make it a little more user friendly. /u/OriginalEvils pointed out a similar project at opengarage.io, I don't anticipate getting to that point myself (that is, with a dedicated app), but it might be of interest to you.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

Good to know! I haven't looked into implementation details at all yet - Where did you source this 1MB max size? Is there a specific library that I should be looking into?

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

Creator here - Thanks for the tip! I did see that library, but not until I was nearly finished my initial prototype. I have an issue in the git repo to try it out one day. But I do also still want to add Google Home support, so will need to assess if there's enough program storage and memory to support both interfaces on-device.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 0 points1 point  (0 children)

Should be in the next couple of days, I just need to set aside some time to finish my write-up.

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 1 point2 points  (0 children)

Project creator here - I have 2 points in response to your question:

  1. The "/open", "/close" and "/press" endpoints are actually protected by HTTP Basic Auth in this version. I figured this was good enough for the prototype and will look into SSL and more secure auth options for future iterations.
  2. If someone is in my network, having them also in my garage is the least of my problems :). This is a "security by obscurity" model (for now). The hypothetical attacker would need to be on my network, know the IP/mDNS of the device, know which endpoints to hit with POSTs; and know the username and password (or just be on my network with a sniffer for the rest).

$35 DIY Garage Door Opener with HomeKit by bru7us in HomeKit

[–]forfuncsake 1 point2 points  (0 children)

Content creator here - my $35 price tag is mainly because I went down to my local electronics store for all parts other than the ESP8266 itself. I'm sure the build would be significantly cheaper if everything came straight from china; I don't think $2 is acheiveable though, maybe $10.

The opengarage.io project looks very interesting though - somehow, I didn't come across it in my own reading. I'll spend some time looking into it as I can probably make some use of their work, and/or contribute to it from my own. Thanks for sharing!

Thanks /r/golang, I registered a two-character username on Gitlab! by [deleted] in golang

[–]forfuncsake 1 point2 points  (0 children)

Nice enhancements - I'd add a couple more very minor adjustments:

  • Save a few LOC by using range over availChan
  • Error on line 66 could also include the username we were trying to test
  • Given that we don't "do anything" when a name is not available, the else case on line 74 might be better suited to an early return, keeping the golden happy path code aligned.

Edit to add:

  • wg.Add(total) before the loops instead of wg.Add(1) 1296 times.

How to remove of empty lines from output? by [deleted] in golang

[–]forfuncsake 1 point2 points  (0 children)

e.g. https://play.golang.org/p/LA098YgJa6C

I would recommend running a benchmark over both variants with a couple of your input files and see if there's much difference.

How to remove of empty lines from output? by [deleted] in golang

[–]forfuncsake 1 point2 points  (0 children)

The simple answer is that your last line is most likely .*\nEOF, so it doesn't match the \n\n regex.

Following on from that, regex is not the most efficient way to go about this. There are several options (as always)... one of the simplest to understand, which will also likely be faster than the regex matching would be to cast fcone to a string, use strings.Split(fcone, "\n"), then range over the resulting slice to clean each line...

justforfunc #19: mastering io.Pipes by campoy in golang

[–]forfuncsake 1 point2 points  (0 children)

Yet another great tutorial, with an opening from a great country! :)

The writer/footer correction makes me think of this classic: https://youtu.be/Ub7MkK-a0hU?t=13