Max::Device - Class to represent an eQ-3 Max! device
use Max;
for my $device ($max->devices) { ... }
for my $device ($room->devices) { ... }
$device->room->setpoint(21.5);
my $room = $device->room(42);
$device->add_link($other_device);
if ($device->has_temperature) {
say "Current temperature is " . $device->temperature;
}
if ($device->is_cube) { ... }
if ($device->has_valve) {
printf "Valve is %d%% open.", $device->valve;
}
if ($device->flags_as_string =~ /battery/) {
say "Low battery.";
}
Represents a device in an "eQ-3 Max!" network.
Considered an internal method; should not be called directly.
Given another Max::Device object, sets up a unidirectional link between the devices. In a typical situation, devices will be cross-linked, but this method does not automate that.
Returns true on success, false on failure.
Returns the address in binary form.
Returns the address as 6 hexadecimal digits.
Configures the device to display either the current temperature, or the setpoint temperature. Will work on wall thermostats, or emit a warning otherwise.
Configures the device temperature presets and on-device setpoint limits. To keep any of the values unchanged, provide it as undef
. Will work on heaters and wall thermostats, or emit a warning otherwise.
Returns the configured name, or a string comprised of the device's type and address. The address is added, even for devices that have a configured name, if the argument $include_addr
is true.
Returns a space-joined list of flag in alphabetical order. Possible flags are:
init
link
battery
error
invalid
Returns a boolean value according to the device type.
Returns the current mode as a number, or as a string. Possible modes are:
0 auto
1 manual
2 vacation
3 boost
Returns the configured name (binary).
Sets a new name, but does not write the metadata to the cube. Use $max->write_metadata
to store the new name.
Returns the Max::Room object for the associated room.
Given a Max::Room object or a numeric room ID, configures the device to associate with that room.
Returns undef on failure. Returns a Max::Room object on success, and updates the Max::Room object in the parent Max object.
Returns the device's serial number.
Returns the currently target temperature.
Setting the target temperature of individual devices is not supported; use $device->room->setpoint
to set the target for the entire room.
Returns the measured temperature. Note: not all devices support this feature. Most notably, the TRVs don't. Use has_temperature
to test this.
Returns the type either as a number, or as a string. Possible types are:
0 cube
1 heater
2 heater+
3 thermostat
4 shutter
5 button
Returns the current position of the valve. 0 is fully closed, 100 is fully open. Note: not all devices have a valve. Use has_valve
to test this.
Shutter and button devices are not (yet) supported.
Tricks exist to read the current measured temperature from a TRV, but because that involves waiting for parameters to change, this library does not implement such tricks. Consider buying a wall thermostat for every room.
Pick your favourite OSI approved license :)
http://www.opensource.org/licenses/alphabetical
Juerd Waalboer <#####@juerd.nl> <http://juerd.nl/>