-
Notifications
You must be signed in to change notification settings - Fork 130
Adding Items and devices
ggodart edited this page Jan 27, 2021
·
2 revisions
Devices (called items in MisterHouse) are normally added in the items.mht
file, however they can also be added in code as described in the items.mht wiki page.
Links for how to add devices for each type of device are specified in the Protocols and Interfaces section of this wiki, or if you already know what you want the underlying code is documented on the Items and Methods page.
Here is an items.mht
example of a simple X10 device
#X10A, housecode_unit, item_name, groups, other_parameters
X10A, A1, garage_lamp, All_X10_lights|All_X10, PLM,
Once this is defined, MisterHouse restarted and all the hardware connections made you can control this device from the default web interface or using your own code.
e.g.
$garage_lamp->set(ON,"set by my program");
e.g.
if ( $state = state_now $garage_light_switch) {
print_log("garage light switch changed to $state ");
}