stateDiagram

%% Initial state name as "." so that it fits in black circle shape.
%% See https://github.com/StateSmith/StateSmith/issues/404
state "." as ROOT.(InitialState)

state ON_GROUP {

        ON1

        ON1 : ON1

        ON1 : enter / #123; on1_stuff( )#59; #125;

        ON2

        ON2 : ON2

        ON2 : enter / #123; on2_stuff( )#59; #125;

        state "$exit_pt.2" as ON_GROUP.(ExitPoint)(2)

        state "$exit_pt.off" as ON_GROUP.(ExitPoint)(off)

}

SHUT_OFF

SHUT_OFF : SHUT_OFF

SHUT_OFF : enter / #123; off( )#59; #125;

HALTED

HALTED : HALTED

HALTED : enter / #123; halt()#59; #125;

ROOT.(InitialState) --> SHUT_OFF

ON1 --> ON2 : ON

ON1 --> ON_GROUP.(ExitPoint)(2) : OFF

ON2 --> ON1 : ON

ON2 --> ON_GROUP.(ExitPoint)(off) : OFF

ON_GROUP.(ExitPoint)(2) --> HALTED

ON_GROUP.(ExitPoint)(off) --> SHUT_OFF

SHUT_OFF --> ON1 : ON

HALTED --> SHUT_OFF : OFF