Home Assistant State Machine

I am working on a new application that allows to control HA using state transition diagrams or grafcets.
The project can be found on GitHub
I have a docker hub image and that is an easy installation if you have HA already running in Docker. However, I would like to have other people to be able to install it as an AddOn.
Since I have HA running in docker on my Synology, I have no idea on how to create an AddOn and if it is feasable.

Anyone that is willing to participate?

Direct link to the manual on GitHub: Manual

1 Like

Hello, what use-cases does your creation support, i.e. why is it needed?

Hi Paulius,
Well I am currently using Node-RED for all my more complex automations.
e.g. When I am walking into my bedroom I want the light go on while there is movement (timeout of 2 minutes). But when I go out of bed and outside the bedroom I don’t want the lights to be turned on.
Also, I have certain times in the week that it shouldn’t turn on.

I have a motion sensor outside the bedroom at the entrence, motion sensor in the bedroom.
I have tried this in Node-RED with just the cards. What a mess. I now have created a state machine in Node-RED but it is basically one big javascript and uncontrollable.

I used to be a developer for machine control and used to program using state machines and grafcets. This is way easier programming.

That is the use case.

What is supports? You want a more technical depth than whats in the manual right now?

node-red-contrib-persistent-fsm (node) - Node-RED.

node-red-contrib-finite-statemachine (node) - Node-RED.

Yes, I have seen them, but there are still not as clear is I would like (far from).
HASM (Home Assistant State Machine) is build for grafcets and state transition diagrams. Easier programming of complex automation is not possible (in my opinion)

HASM works like visio with extra functionality for state transision diagrams.
One example is an Error state. If an error occurs, were ever it occurs (like turning off a light fails), you can let it go to an Error state and proceed from there.

But most importanly: It is visual clear, easy changable, clean…

But back to the question :blush:
Because the fact that there are many addons I dont use still doesnt mean that it is not usefull for others. So good that they exists.

I have created hasm for me in the first place, but I think I am probably not the only one liking a better state transition diagram programming feature. Therefor I am looking for support for creating an addon. That would not be for me, because I use it in docker

Perhaps you didn’t look. Tutorial: Making your first add-on | Home Assistant Developer Docs

Thank you! No, I didn’t see this manual.
I think I might be able to follow this instruction, but I cannot test the AddOn in a real life situation, because I cannot install an AddOn on my system.

Or am I wrong in assuming that you need to be able to run AddOns in order to test it?

You’ll need to have a haos or supervised install to test it. I have a test instance and could test.

1 Like

Thank you for your offer. Due to the fact that I cannot test it because I cannot install AddOns, I will greatly take your offer.

Right now, I had my first spin at HASM creating a real life state transition diagram. I encountered some bugs and missing features. I have just released a new docker image which I want to test further in a real life situation (and not only in Visual Studio testing it on a test HA in docker)

For a first spin it wan’t even bad. But I think it is too early to publish an AddOn, because I want regular users to have a good solid experience at first use.

Other users are happy to try the docker image though. The development just started 1 month ago, so it has some rough edges.

A use case was asked for and what features the application has.
Well, it has only been several weeks since I started this application (initially for personal use), but already the application shows its features and can withstand a real life use case. Still, work to do to make it even easier to develop automations and to make it robust.

I have created a real life example on the wiki page on GitHub. It can be found here Real Life Example HASM

1 Like