2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

34_ESPEasy.pm: Added ESPEasy commands MCPPulse, MCPLongPulse

git-svn-id: https://svn.fhem.de/fhem/trunk@15809 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dev0 2018-01-07 07:40:42 +00:00
parent 2a994528ed
commit acd5046e99

View File

@ -36,7 +36,7 @@ use Color;
# ------------------------------------------------------------------------------
# global/default values
# ------------------------------------------------------------------------------
my $module_version = "1.33"; # Version of this module
my $module_version = "1.35"; # Version of this module
my $minEEBuild = 128; # informational
my $minJsonVersion = 1.02; # checked in received data
@ -75,6 +75,8 @@ my %ESPEasy_setCmds = (
"lcd" => "3",
"lcdcmd" => "1",
"mcpgpio" => "2",
"mcppulse" => "3", # forum 82174
"mcplongpulse" => "3", # forum 82174
"oled" => "3",
"oledcmd" => "1",
"pcapwm" => "2",
@ -125,7 +127,9 @@ my %ESPEasy_setCmdsUsage = (
"servo" => "servo <servoNo> <pin> <position>",
"lcd" => "lcd <row> <col> <text>",
"lcdcmd" => "lcdcmd <on|off|clear>",
"mcpgpio" => "mcpgpio <pin> <0|1|off|on>",
"mcpgpio" => "mcpgpio <port> <0|1|off|on>",
"mcppulse" => "mcppulse <port> <0|1|off|on> <duration>", # forum 82174
"mcplongpulse" => "mcplongpulse <port> <0|1|off|on> <duration>", # forum 82174
"oled" => "oled <row> <col> <text>",
"oledcmd" => "oledcmd <on|off|clear>",
"pcapwm" => "pcapwm <pin> <Level>",
@ -764,11 +768,15 @@ sub ESPEasy_Read($) {
my $ident = $cd
? $espName ne "" ? $espName : $peer
: $espName.($espName ne "" && $espDevName ne "" ? "_" : "").$espDevName;
Log3 $bname, 4, "$btype $name: "
. "Dispatch to: '$ident', "
. "source: '$json->{data}{ESP}{name}'/"
. "'$json->{data}{SENSOR}{0}{deviceName}' "
. "(combinedDevice: ".($cd ? "true" : "false").")";
my $d0;
Log3 $bname, 4, "$btype $name: Src:'$json->{data}{ESP}{name}'/'"
. "$json->{data}{SENSOR}{0}{deviceName}' => ident:$ident "
. "dev:"
. ( ($d0=(devspec2array("i:IDENT=$ident:FILTER=i:TYPE=$btype"))[0])
? $d0
: "undef" )
. " combinedDevice:".$cd;
# push internals in @values
my @values;
@ -3188,17 +3196,33 @@ sub ESPEasy_removeGit($)
ESPEasy Wiki PCF8574</a>
</li><br>
<li><a name="ESPEasy_device_set_mcpgpio">mcpgpio</a><br>
<li><a name="ESPEasy_device_set_mcpgpio">MCPGPIO</a><br>
Control MCP23017 output pins (16-Bit I/O Expander with Serial Interface)<br>
<ul>
<li>arguments: <code>&lt;port&gt; &lt;0|1|off|on&gt;</code></li>
<li>example: <code>set &lt;esp&gt; mcpgpio 48 on</code></li>
<li>example: <code>set &lt;esp&gt; MCPGPIO 48 on</code></li>
</ul>
Port numbering see:
<a href="https://www.letscontrolit.com/wiki/index.php/MCP23017#Input">
ESPEasy Wiki MCP23017</a>
</li><br>
<li><a name="ESPEasy_device_set_mcppulse">MCPPulse</a><br>
Pulse control on MCP23017 output pins (duration in ms)<br>
<ul>
<li>arguments: <code>&lt;port&gt; &lt;0|1|off|on&gt; &lt;duration&gt;</code></li>
<li>example: <code>set &lt;esp&gt; MCPPulse 48 on 100</code></li>
</ul>
</li><br>
<li><a name="ESPEasy_device_set_mcplongpulse">MCPLongPulse</a><br>
Longpulse control on MCP23017 output pins (duration in s)<br>
<ul>
<li>arguments: <code>&lt;port&gt; &lt;0|1|off|on&gt; &lt;duration&gt;</code></li>
<li>example: <code>set &lt;esp&gt; MCPLongPulse 48 on 2</code></li>
</ul>
</li><br>
<li><a name="ESPEasy_device_set_pcapwm">pcapwm</a><br>
Control PCA9685 (16-channel / 12-bit PWM I2C-bus controller)<br>
<ul>