++ed by:
1 non-PAUSE user
Author image Martin H. Sluka
and 1 contributors


AHA::Switch - Object representing an AHA managed switch/actor


    # Parent object for doing the HTTP communication
    my $aha = new AHA("fritz.box","s!cr!t");
    # Switch represented by the $ain which can be a name or a real AIN 
    my $switch = new AHA::Switch($aha,$ain)

    # Obtain all switches from a list operation
    for my $switch (@{$aha->list()}) {
        say $switch->name(),": ",$switch->is_on();


This module represents an actor/switch for the AVM home automation system. It encapsulated an actor with a certain AIN and provides all methods as described in "AHA" with the difference, that not AIN is required, since this has been already provided during the construction of this object.


$switch = new AHA::Switch($aha,$ain)

Create a new switch object. The first object must be an "AHA" instance, which is responsible for the HTTP communication. The second argument Many must be an 8-digit AIN (actor id) or a symbolic name. This symbolic name can be configured in the admin UI of the Fritz Box.

$ain = $switch->ain()

Get the AIN which this object represents.


Same as the corresponding method in "AHA" with the exception, that no $ain argument is required since it already has been given during construction time