{"action":"closed","issue":{"url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/issues/59","repository_url":"https://api.github.com/repos/RFD-FHEM/RFFHEM","labels_url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/issues/59/comments","events_url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/issues/59/events","html_url":"https://github.com/RFD-FHEM/RFFHEM/issues/59","id":126044104,"number":59,"title":"Generic send interface","user":{"login":"sidey79","id":7968127,"avatar_url":"https://avatars.githubusercontent.com/u/7968127?v=3","gravatar_id":"","url":"https://api.github.com/users/sidey79","html_url":"https://github.com/sidey79","followers_url":"https://api.github.com/users/sidey79/followers","following_url":"https://api.github.com/users/sidey79/following{/other_user}","gists_url":"https://api.github.com/users/sidey79/gists{/gist_id}","starred_url":"https://api.github.com/users/sidey79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidey79/subscriptions","organizations_url":"https://api.github.com/users/sidey79/orgs","repos_url":"https://api.github.com/users/sidey79/repos","events_url":"https://api.github.com/users/sidey79/events{/privacy}","received_events_url":"https://api.github.com/users/sidey79/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"sidey79","id":7968127,"avatar_url":"https://avatars.githubusercontent.com/u/7968127?v=3","gravatar_id":"","url":"https://api.github.com/users/sidey79","html_url":"https://github.com/sidey79","followers_url":"https://api.github.com/users/sidey79/followers","following_url":"https://api.github.com/users/sidey79/following{/other_user}","gists_url":"https://api.github.com/users/sidey79/gists{/gist_id}","starred_url":"https://api.github.com/users/sidey79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidey79/subscriptions","organizations_url":"https://api.github.com/users/sidey79/orgs","repos_url":"https://api.github.com/users/sidey79/repos","events_url":"https://api.github.com/users/sidey79/events{/privacy}","received_events_url":"https://api.github.com/users/sidey79/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/milestones/3","html_url":"https://github.com/RFD-FHEM/RFFHEM/milestones/3.2","labels_url":"https://api.github.com/repos/RFD-FHEM/RFFHEM/milestones/3/labels","id":1349721,"number":3,"title":"3.2","description":"","creator":{"login":"sidey79","id":7968127,"avatar_url":"https://avatars.githubusercontent.com/u/7968127?v=3","gravatar_id":"","url":"https://api.github.com/users/sidey79","html_url":"https://github.com/sidey79","followers_url":"https://api.github.com/users/sidey79/followers","following_url":"https://api.github.com/users/sidey79/following{/other_user}","gists_url":"https://api.github.com/users/sidey79/gists{/gist_id}","starred_url":"https://api.github.com/users/sidey79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidey79/subscriptions","organizations_url":"https://api.github.com/users/sidey79/orgs","repos_url":"https://api.github.com/users/sidey79/repos","events_url":"https://api.github.com/users/sidey79/events{/privacy}","received_events_url":"https://api.github.com/users/sidey79/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":3,"state":"open","created_at":"2015-10-11T22:16:24Z","updated_at":"2016-02-05T22:43:44Z","due_on":"2015-11-19T23:00:00Z","closed_at":null},"comments":1,"created_at":"2016-01-11T21:46:55Z","updated_at":"2016-02-05T22:43:44Z","closed_at":"2016-02-05T22:43:44Z","body":"\r\n\r\nSend following bits via Protocol #0\r\n0001 1100\r\n\r\nCurrent approach is to send the following command:\r\n\r\nSR;R=3;P0=500;P1=-9000;P2=2000;P3=4000;D=010303030202020303;\r\n\r\nProvide an Interface for sending bits instead of SIGNALdata:\r\n\r\nCommand like this: p0#00011100#R3; ( Protocol 0 / bits 00011100 / Repeat 3 times)\r\ncode like this:\r\n\r\nmy ($protocol,$data,$repeats) = split(\"#\",$command);\r\n$protocol=~ s/P(\\d+)/$1/; # extract protocol num\r\n$repeats=~ s/R(\\d+)/$1/;  # extract repeat num\r\n\r\nmy %signalHash;\r\n#my %patternHash;\r\nmy $pattern=\"\";\r\nmy $cnt=0;\r\nforeach my $item (/qw/sync one zero/)\r\n{\r\n\t\r\n\t$signalHash{$item}=\"\";\r\n\tforeach my $p ($ProtocolListSIGNALduino{$protocol}{$item})\r\n\t{\r\n\t\t#$patternHash{$item}.=\"$p*$ProtocolListSIGNALduino{$protocol}{clockabs} \";\r\n\t\t$signalHash{$item}.=\"$cnt\";\r\n\t\t$cnt++;\r\n\t\t$pattern.=\"P$cnt\\=$p*$ProtocolListSIGNALduino{$protocol}{clockabs}\";\r\n\t}\r\n\t#$signalHash{$item} =~ s/\\s+$//;     #rtrim\r\n\t#$signalHash{$item} ~= /tr/' '/','/  # replace whitspace with comma\r\n}\r\n\r\nmy @bits = split(\"\", $data);\r\n\r\n%bitconv = {1=one, 0=zero);\r\nmy $SignalData=\"D=$signalHash{sync}\";\r\nforeach my $bit (@bits)\r\n{\r\n\t#Log3 $name, 5, \"encoding $bit\";\r\n\t$SignalData.=$signalHash{$bitconv{$bit}};  ## Add the signal to our data string\r\n}\r\nmy $sendData = \"SR;R=$repeats;$pattern;$SignalData;"}}