What is your background? Learning the core of HG

So I guess this question is a little stupid and I guess there is no shortcut to what I want. But I ask anyway.

Somehow I really like HG even though I think it is lacking a lot of features and user friendliness. In my head I have a lot of things I would like to do and change in HG.

When I watch the code and everything that Gene has done I also get impressed with all the different technologies used and the knowledge needed to make something like HG.

I have a background in a little C, a little more C++, and at the end some C#. Even though it was several years ago and maybe a little outdated. I understand the basics of many other languages and programming. And even though I can’t create things from scratch I know what to Google for and find and use solutions that other have done.

With that said I’m struggling to get into HG. It feels like I want to fly before I can even crawl. So much I want to add and do to HG but every time I start to look around the code I get lost almost immediately.

So, even though I guess I know the answer, is there any suggestions to what I could read and learn to get a crash course into understanding HG?

Starting with the basic HTML, Javascript feels frustrating, because I understand those parts. But still, the advanced stuff is over my head.

Do I have to spend months before I can get my head around HG?

For those who feel pretty confident with the parts that makes HG what it is. What is your background and knowledge?

I know, stupid question, because there is almost never any shortcuts to anything. Only hard work to get what you want. But maybe I can benefit from others mistakes and get to where I want a little faster by learning from that.

Maybe if you look closely at this link it explains exactly what Home Genie is and what it sets out to do. If your background is in C and it’s variants there’s a section there for you to write program’s big or small to interface with the Home Genie API. That would be a good place to start

http://www.homegenie.it/

Thank you. But that not really what I’m out to do. I have no problem understanding and writing small little scripts to automate things.

I’m talking about the core of HG, what makes it work. And understanding that and making changes and adding new features.

I think I was a little unclear in the subject, so I changed that.

Personally i think the forking and branching of HomeGenie may not be the way forward. It would probably be easier to rewrite and redesign a project like HomeGenie. From what I can gather from others the code is quite outdated at this stage.

Maybe Bounz would be the best person to comment on that here.

Maybe Gene was correct. Maybe it is a completed project. Maybe he had taken it as far as it could go in its current format.

Patching up the project may be a waste of time at this stage. Maybe a group project effort would be the way forward using the concepts and aspirations of Home Genie as a blueprint.

This is just my two cents worth.

So there is something wrong with how HG was designed to work? Because it otherwise seems strange to me that a project only live a couple of years until it is obsolete.

If the foundation is badly designed I agree that there is no future with HG. But if it is not using the latest technology then it is just about that Gene abandoned HG and it took a long time for someone in the community to take it forward. But that can be fixed with some effort. (Something I was hoping to be able to help with some day.)

But is the core and it’s design bad?

As I said Bounz and David_Wallis may be better qualified to comment on this.

Product support and user feedback are the most important ingredients in any software’s success. The old forum was killed off which appears to have killed off a lot of user feedback and product support is questionable at the moment.

Time will tell with this forum but we really need a lot more users to return here and contribute ideas and feedback.

Hi, guys.
Sorry for the late reply, I’m on a short trip to Saint Petersburg (and the next week I’m going to ski in Sochi).

In my opinion HG’s core “smells” as it’s poor structured and is “dirty”. It doesn’t follow SOLID principles, so, as you mentioned, it’s difficult to expand code and write unit tests.
But. Current implementation works and covers common home automation use cases. And there are a lot of automation programs and interfaces that well be lost if we start a new project with new API for extensions.
That’s why I decided to refactor existing code and not to start a new project from scratch.

With those comments @Bounz , as I want to learn, what/where could I read on how it should be?

Well, here is a list of books I recommend to read.
Clean Code (good book for junior and middle developers): https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

SOLID principles: https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
Clean Architecture (I haven’t read that, but should be good): https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164

Design patterns (reference book with examples in Java): https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612
Design patterns (with examples in C#) https://www.amazon.com/Agile-Principles-Patterns-Practices-C/dp/0131857258

Architecture patterns: https://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420

@raptorjr, unfortunately, no one will tell you, how any software should be implemented, but we all want it to be maintainable, testable, expandable, with readable, well-structured source code.

@Bounz Thank you. Appreciate the links and also the time you have put into this forum and into HG in general.

But since you do this it feels like you think HG has a future. And for it to have a future we need more developers that are able to maintain and add new features.
But do you think this is possible or do you think that it will be hard to make HG going forward in its current shape?

Of course I understand that no one will tell me. The best way is to learn from others. And I really want to have and be part of a good home automation software. And that way learn from other how it should be. And there seems to still be a few sharp minds here on the forum. I just got a little disappointed by the above comment and it made me feel like there is no point in doing anything with HG besides fixing the current bugs. And if it is enough for someone to use it, fine. But not worth the time to make it great.

Again, I kind of agree with all above… some of it smells, its hard to follow - but its code that has evolved… and for me it works…

I personally hate the UI as I am unable to edit it :smiley: and I think it has been “minified” - for me we need to get the native source back and let the appveyor build deal with minifying it…

I’m also tempted to knock up a windows based front end that allows code editing a little easier with intellisense… as it makes the world of difference if you dont have a clue :smiley: (ie me :smiley: :D)

If you want to contribute - then create an issue for the bits that you want to resolve and thne we can try and help you get looking at the right part of the code… I am not great at it but have to do a lot of searching to find what I need… (Also use an IDE such as visual studio 2017 community edition - where you can right click and “find all references” or “go to implementation”) it will make your life easier.

I dont have the time or energy to re-write from scratch or even to jump ship and change product and I think HG can be relatively easily brought inline if people are willing to help and commits / release actually happen frequently.

For reference by background is Storage, Infrastructure, Networking, Design, Scripting…

And no appreciation of SOLID principles but trying to learn :slight_smile:

Oh there is so much I would like to do. I would like to have a live log for the whole system. Downloading textfiles or look in the console window I don’t like. Or be able to do debug output from automation programs or see why they crash sometimes and fix the real issue instead of just restarting.

Also intellisense would be cool, but I would also like it to be possible for beginners to make easy automation programs with something like blockely. I think it should be easy for anyone to do basic automation with very little knowledge. But the system should allow you to be advanced if you like.

And a mobile adapted webpage would be nice, so you don’t need a extra app.

And better support for MySensors, with the ability to write arduino code and update your nodes through HG, since MySensors support that.

I like the SOLID approach, even though I have never used it. Used to just make things work even though it was not always pretty. But I like pretty so I will put some time in understanding and learning to do things the SOLID way.

So much to do and so little knowledge :frowning:️ I want to fly before I can even crawl. But I hope that I can learn a lot from the code, even though it is not perfect, and from the new development taking place in Bounz repo.

one of the things I was in two minds about is arduino support etc… I think rather than try and support many languages, it should do one… I have a project in github that allows intellisense you can then copy the code out and paste it in… longer term I think I can do something better with debugging support…

Hello
Arduino need to be supported but only in the sense of connecting to HG e.g. as sensors (inputs to HG) or actuators (outputs to HG).
Writing the code for the arduino can be done in the Arduino environments eg Scratch, why redesign the wheel.

I use many (4 at present) Arduinos in my home automation setup but all have been programed using Scratch. I use both USB and http to communicate between the Arduinos and HG, where the custom c# programs in HG sort out the info.

Something like blockely could be a cool way to get more non techie users using HG and an advantage over other programs, but with more non techie users will come more questions.

IanR

thats kind of what I mean re the arduino bits… however my new light switches all have an esp32 in them and I am using an OTA library so it may be interesting to be able to do this from within HG at somepoint, but we’ll see… I don’t see any point in removing the functionality yet though… :slight_smile:

as for arduino development I’d much rather use Arduino program or PlatformIO.