From f9bb3f3456594e285e977b10ee3bde6c74436f99 Mon Sep 17 00:00:00 2001 From: Risiko Date: Tue, 28 Jul 2020 18:39:53 +0000 Subject: [PATCH] 10_pilight_ctrl: new support relay switch protocol git-svn-id: https://svn.fhem.de/fhem/trunk@22486 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/10_pilight_ctrl.pm | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index f8dc03a2f..c5ea27b51 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 10_pilight_ctrl: support relay switch protocol - feature: 49_SSCamSTRM: new commands adoptForTimer / adoptTime in master devs - feature: 74_XiaomiBTLESens: add Support for Mijia LYWSD03MMC - bugfix: 73_AutoShuttersControl: Fix Shading bug then shutters ClosedPos, diff --git a/fhem/FHEM/10_pilight_ctrl.pm b/fhem/FHEM/10_pilight_ctrl.pm index d036a2aed..241941413 100644 --- a/fhem/FHEM/10_pilight_ctrl.pm +++ b/fhem/FHEM/10_pilight_ctrl.pm @@ -52,6 +52,7 @@ # V 1.25 2017-04-23 - FIX: react only of global::INITIALIZED m/^INITIALIZED$/ # V 1.26 2017-09-03 - FIX: heitech support # V 1.27 2018-01-28 - NEW: handle bh1750 illuminance sensor as weather station +# V 1.28 2020-07-27 - NEW: support switch protocol relay ############################################## package main; @@ -431,9 +432,10 @@ sub pilight_ctrl_Write($@) case m/mumbi/ {$code .= "\"systemcode\":$id,\"unitcode\":$unit,";} case m/brennenstuhl/ {$code .= "\"systemcode\":$id,\"unitcode\":$unit,";} case m/pollin/ {$code .= "\"systemcode\":$id,\"unitcode\":$unit,";} - case m/heitech/ {$code .= "\"systemcode\":$id,\"unitcode\":$unit,";} + case m/heitech/ {$code .= "\"systemcode\":$id,\"unitcode\":$unit,";} case m/impuls/ {$code .= "\"systemcode\":$id,\"programcode\":$unit,";} case m/rsl366/ {$code .= "\"systemcode\":$id,\"programcode\":$unit,";} + case m/relay/ {$code .= "\"gpio\":$id,";} case m/daycom/ { if (!defined($syscode)) { Log3 $me, 1, "$me(Write): Error protocol daycom no systemcode defined"; return; @@ -803,6 +805,9 @@ sub pilight_ctrl_Parse($$) $id = $unit if ($id eq "" && $unit ne ""); $unit = "all" if ($unit eq "" && $all ne ""); + # some protocols have no unit e.q. relay + $unit = "all" if ($unit eq ""); + Log3 $me, 5, "$me(Parse): protocol:$proto,id:$id,unit:$unit"; my @ignoreIDs = split(",",AttrVal($me, "ignoreProtocol","")); @@ -843,6 +848,7 @@ sub pilight_ctrl_Parse($$) case m/intertechno_old/ {$protoID = 1;} case m/quigg_gt/ {$protoID = 1;} case m/heitech/ {$protoID = 1;} + case m/relay/ {$protoID = 1;} case m/dimmer/ {$protoID = 2;}