222 lines
5.1 KiB
Perl
222 lines
5.1 KiB
Perl
###############################################################################
|
|
#
|
|
# Developed with love
|
|
#
|
|
# (c) 2021-2021 Copyright: Sebastian Schwarz
|
|
#
|
|
# This script is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# any later version.
|
|
#
|
|
# The GNU General Public License can be found at
|
|
# http://www.gnu.org/copyleft/gpl.html.
|
|
# A copy is found in the textfile GPL.txt and important notices to the license
|
|
# from the author is found in LICENSE.txt distributed with these scripts.
|
|
#
|
|
# This script is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
#
|
|
# $Id$
|
|
#
|
|
###############################################################################
|
|
|
|
package FHEM::HailoLibero;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use GPUtils qw(GP_Import GP_Export);
|
|
require FHEM::Hailo::Libero;
|
|
|
|
## Import der FHEM Funktionen
|
|
#-- Run before package compilation
|
|
BEGIN {
|
|
|
|
# Import from main context
|
|
GP_Import(
|
|
qw(
|
|
readingFnAttributes
|
|
)
|
|
);
|
|
}
|
|
|
|
#-- Export to main context with different name
|
|
GP_Export(
|
|
qw(
|
|
Initialize
|
|
)
|
|
);
|
|
|
|
sub Initialize {
|
|
my $hash = shift;
|
|
|
|
# Provider
|
|
$hash->{WriteFn} = \&Write;
|
|
|
|
# Consumer
|
|
$hash->{SetFn} = 'FHEM::Hailo::Libero::Set';
|
|
$hash->{DefFn} = 'FHEM::Hailo::Libero::Define';
|
|
$hash->{UndefFn} = 'FHEM::Hailo::Libero::Undef';
|
|
$hash->{DeleteFn} = 'FHEM::Hailo::Libero::Delete';
|
|
$hash->{RenameFn} = 'FHEM::Hailo::Libero::Rename';
|
|
$hash->{NotifyFn} = 'FHEM::Hailo::Libero::Notify';
|
|
|
|
|
|
$hash->{AttrFn} = 'FHEM::Hailo::Libero::Attr';
|
|
$hash->{AttrList} =
|
|
'disable:1 '
|
|
. 'LiberoIP '
|
|
. $readingFnAttributes;
|
|
$hash->{parseParams} = 1;
|
|
|
|
return FHEM::Meta::InitMod( __FILE__, $hash );
|
|
}
|
|
|
|
1;
|
|
|
|
=pod
|
|
|
|
=item device
|
|
=item summary Modul to communicate with the Hailo Libero
|
|
=item summary_DE Modul zur Datenübertragung zur Hailo Libero
|
|
|
|
=begin html
|
|
|
|
<a name="HailoLibero"></a>
|
|
<h3>HailoLibero</h3>
|
|
<a name="HailoLiberodefine"></a>
|
|
<b>Define</b>
|
|
<ul><br>
|
|
<code>define <name> HailoLibero</code>
|
|
<br><br>
|
|
Example:
|
|
<ul><br>
|
|
<code>define Hailo_Libero HailoLibero</code><br>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoreadings"></a>
|
|
<br><br>
|
|
<b>Readings</b>
|
|
<ul>
|
|
<li>led_brightness</li>
|
|
<li>eject_delay</li>
|
|
<li>eject_power</li>
|
|
<li>detection_area</li>
|
|
<li>detection_sensitivity</li>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoeset"></a>
|
|
<b>set</b>
|
|
<ul>
|
|
<li>led_brightness - LED brightness | 1-10 default: 6 | 0 = off</li>
|
|
<li>eject_delay - delay until eject | 0-5 seconds default: 0s</li>
|
|
<li>eject_power - power value of eject | 1-10 default: 5</li>
|
|
<li>detection_area - distance for detection | 31-100 mm default: 50mm</li>
|
|
<li>detection_sensitivity - sensor sensitifity | 1-50 default: 1</li>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoeattributes"></a>
|
|
<b>Attributes</b>
|
|
<ul>
|
|
<li>LiberoIP - IP e.g. 192.168.1.200</li>
|
|
</ul>
|
|
</ul>
|
|
|
|
=end html
|
|
=begin html_DE
|
|
|
|
<a name="HailoLibero"></a>
|
|
<h3>HailoLibero</h3>
|
|
<br>
|
|
<a name="HailoLiberodefine"></a>
|
|
<b>Define</b>
|
|
<ul><br>
|
|
<code>define <name> HailoLibero</code>
|
|
<br><br>
|
|
Beispiel:
|
|
<ul><br>
|
|
<code>define Hailo_Libero HailoLibero</code><br>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoreadings"></a>
|
|
<br><br>
|
|
<b>Readings</b>
|
|
<ul>
|
|
<li>led_brightness</li>
|
|
<li>eject_delay</li>
|
|
<li>eject_power</li>
|
|
<li>detection_area</li>
|
|
<li>detection_sensitivity</li>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoset"></a>
|
|
<b>set</b>
|
|
<ul>
|
|
<li>led_brightness - LED Helligkeit | 1-10 default: 6 | 0 = aus</li>
|
|
<li>eject_power - Auswurfstärke | 1-10 default: 5</li>
|
|
<li>detection_area - Erkennugsbereich | 31-100 mm default: 50mm</li>
|
|
<li>detection_sensitivity - Sensor Empfindlichkeit | 1-50 default: 1</li>
|
|
<li>eject_delay - Auswurf-Wartezeit| 0-5 seconds default: 0s</li>
|
|
</ul>
|
|
<br><br>
|
|
<a name="HailoLiberoeattributes"></a>
|
|
<b>Attributes</b>
|
|
<ul>
|
|
<li>LiberoIP - IP e.g. 192.168.1.200</li>
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
=end html_DE
|
|
|
|
=for :application/json;q=META.json 73_HailoLibero.pm
|
|
{
|
|
"abstract": "Modul to control Hailo Libero 3.0",
|
|
"x_lang": {
|
|
"de": {
|
|
"abstract": "Modul zum bedienen des Hailo Libero 3.0"
|
|
}
|
|
},
|
|
"keywords": [
|
|
"fhem-mod-device",
|
|
"fhem-core",
|
|
"Hailo",
|
|
"Libero",
|
|
"Smart"
|
|
],
|
|
"release_status": "stable",
|
|
"license": "GPL_2",
|
|
"version": "v1.1.8",
|
|
"author": [
|
|
"Sebastian Schwarz <ema@il.local>"
|
|
],
|
|
"x_fhem_maintainer": [
|
|
"BOFH"
|
|
],
|
|
"x_fhem_maintainer_github": [
|
|
"NO ONE"
|
|
],
|
|
"prereqs": {
|
|
"runtime": {
|
|
"requires": {
|
|
"FHEM": 5.00918799,
|
|
"perl": 5.016,
|
|
"Meta": 0,
|
|
"HttpUtils": 0,
|
|
"Encode": 0
|
|
},
|
|
"recommends": {
|
|
},
|
|
"suggests": {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
=end :application/json;q=META.json
|
|
|
|
=cut
|