44_ROLLO: Probleme mit drive-type na / extern. Fahrbefehl wird nicht ausgeführt.

Begonnen von GunterB, 09 Oktober 2020, 08:17:04

Vorheriges Thema - Nächstes Thema

GunterB

Hallo Zusammen,

ich habe das Problem, dass meine ROLLO Module nicht immer die im rl_command hinterlegten Befehle ausführen.
Das Auftreten ist Zufällig, und ich meine es trat erst auf, nachdem ich das "set extern closed" etc... verwende.

Gestern ist es mir per Handbedienung eines ROLLO aufgefallen.
Beim Klick auf ROLLO closed, wurde das Stateicon Rot und das ROLLO meinte abwärts zu fahren.
Mein MQTT_DEVICE hatte davon aber nichts mitbekommen, und der STATE bleib bei OPEN.
Ein erneuters Klicken auf ROLLO closed, wurde dann der Befehl augenscheinlich an das MQTT_DEVICE gesendet und der Rolladen bewegte sich dann auch.

Das ganze passiert ab und zu, ist aber nicht wirklich reproduzierbar.
Allerdings habe ich bis jetzt auch noch nicht viel ausprobiert, um die Konstellation zu finden.

Off-my-topic
Ich würde auch gerne, aufgrund von Timingproblemen und nicht Empfangenen RF Befehlen, das SHADE Kommando der TDEF Motoren verwenden. Leider ist es nicht möglich, das ROLLO Modul extern auf einen bestimmten PCT Wert zu setzen.
Das wäre echt schön, wenn sowas auch nocht extern gemacht werden könnte.

Code (JL3_Bad) Auswählen
defmod JL3_Bad ROLLO
attr JL3_Bad userattr room_map rx_channels rx_devices structexclude
attr JL3_Bad cmdIcon open:fts_shutter_up closed:fts_shutter_down stop:fts_shutter_manual half:fts_shutter_50
attr JL3_Bad devStateIcon open:fts_shutter_10:closed closed:fts_shutter_100:open half:fts_shutter_50:closed drive-up:fts_shutter_up@red:stop drive-down:fts_shutter_down@red:stop pct-100:fts_shutter_100:open pct-90:fts_shutter_80:closed pct-80:fts_shutter_80:closed pct-70:fts_shutter_70:closed pct-60:fts_shutter_60:closed pct-50:fts_shutter_50:closed pct-40:fts_shutter_40:open pct-30:fts_shutter_30:open pct-20:fts_shutter_20:open pct-10:fts_shutter_10:open pct-0:fts_shutter_10:closed
attr JL3_Bad group Rolladen
attr JL3_Bad rl_autoStop 1
attr JL3_Bad rl_commandDown set JL_3_Bad DOWN
attr JL3_Bad rl_commandStop set JL_3_Bad STOP
attr JL3_Bad rl_commandUp set JL_3_Bad UP
attr JL3_Bad rl_excessBottom 3
attr JL3_Bad rl_excessTop 0
attr JL3_Bad rl_resetTime 0
attr JL3_Bad rl_secondsDown 22
attr JL3_Bad rl_secondsUp 22
attr JL3_Bad rl_switchTime 1
attr JL3_Bad rl_type normal
attr JL3_Bad room Bad
attr JL3_Bad rx_channels 3
attr JL3_Bad rx_devices 0x00bb94
attr JL3_Bad webCmd open:closed:half:stop:pct


Code (JL_3_Bad) Auswählen
defmod JL_3_Bad MQTT_DEVICE
attr JL_3_Bad userattr JL_1_Buero JL_1_Buero_map structexclude
attr JL_3_Bad IODev myBroker
attr JL_3_Bad devStateIcon UP:shutter_open DOWN:shutter_closed SHADE:shutter_halfopen STOP:shutter_halfopen
attr JL_3_Bad publishSet UP DOWN STOP SHADE cmd/jarolift/shutter/2
attr JL_3_Bad room Bad
attr JL_3_Bad stateFormat state
attr JL_3_Bad webCmd UP:DOWN:STOP:SHADE


Code (DOIF Jarolift received command doif) Auswählen
([JL_received:"^rx_disc_low:..*$"]) (
{
    my $LogLvl = 6;
my $Empf_Device = "JL_received";
my $serial = ReadingsVal("$Empf_Device", "serial", ".");
my $function = ReadingsVal("$Empf_Device", "rx_function", ".");
my $disclow = ReadingsVal("$Empf_Device", "rx_disc_low", ".");
my $dischigh = ReadingsVal("$Empf_Device", "rx_disc_high", ".");
my $message = "";

##Kanäle:
my $disclowbin = sprintf ("%08b", $disclow);
Log $LogLvl, "disclow: $disclow";
Log $LogLvl, "disclowbin: $disclowbin";
my $dischighbin = sprintf ("%08b", $dischigh);
Log $LogLvl, "dischigh: $dischigh";
Log $LogLvl, "dischighbin: $dischighbin";
##Devices die angesteuert werden sollen:
my @Rollos = devspec2array("JL.*");
foreach(@Rollos) {
my $rx_devices = AttrVal($_, "rx_devices", undef);
my $RolloDev = $_;
next if (!defined($rx_devices));
next if ($rx_devices eq "");
my @rx_devicesList = split ' ', $rx_devices;
Log $LogLvl, "Device: $_ rx_devices: @rx_devicesList";

my $rx_channels = AttrVal($_, "rx_channels", undef);
next if (!defined($rx_channels));
next if ($rx_channels eq "");
my @rx_channelsList = split ' ', $rx_channels;
Log $LogLvl, "rx_channels: @rx_channelsList";

my $rx_serial = substr $serial, 0, -2 ;
Log $LogLvl, "rx_serial: $rx_serial";
my $i = 0;
foreach(@rx_devicesList){
if ($rx_serial eq $_ ){
my $DeviceChannel = $rx_channelsList[($i)];
Log $LogLvl, "found: $_ with Channel $DeviceChannel";

##Prüfen, ob der Channel gesetzt ist
my $sollfahren = 0;
if ($DeviceChannel < 9){
my $value = substr $disclowbin, ($DeviceChannel * (-1)), 1;
if ($value eq "1"){
Log $LogLvl, "SOLL FAHREN!!!";
$sollfahren = 1;
}
} else {
my $value = substr $dischighbin, (($DeviceChannel-8) * (-1)), 1;
if ($value eq "1"){
Log $LogLvl, "SOLL FAHREN!!!";
$sollfahren = 1;
}
}
if ($sollfahren == 1){
##rx-function:
##4 -> STOP
##8 -> HOCH
##2 -> RUNTER
##a -> Hoch/Runter
if ($function eq "0x4"){
fhem("set $RolloDev extern stop");
$message .= "$RolloDev: extern stop\n";
Log 1, "JL_received from $rx_serial: $RolloDev Funktion: STOP";
} elsif ($function eq "0x8"){
fhem("set $RolloDev extern open");
$message .= "$RolloDev: extern hoch\n";
Log 1, "JL_received from $rx_serial: $RolloDev Funktion: HOCH";
} elsif ($function eq "0x2"){
fhem("set $RolloDev extern closed");
$message .= "$RolloDev: extern runter\n";
Log 1, "JL_received from $rx_serial: $RolloDev Funktion: RUNTER";
} else {
$message .= "$RolloDev: extern stop\n";
Log 1, "JL_received from $rx_serial to ROLLO: Keine Funktion: $function";
}
}
}
$i++;
}
}
if (length($message) > 0) {
fhem("set myTelegramBot _msg $message");
}
}
)


Crosspost https://forum.fhem.de/index.php/topic,95832.msg1090549.html#msg1090549

GunterB

Ich habe mir das mal genauer angeschaut, es liegt wohl daran, dass der erste Fahrbefehl bei drive-type als "na" angelegt wird.
Bei einem Erneuten betätigen des OPEN Befehls, wechselt drive-type auf "modul" und der Fahrbefehl wird ausgeführt.

GunterB

#2
So, ich habe jetzt die Konstellation, unter der man das Fehlverhalten Nachstellen kann.
Wenn nach einem extern closed ein wiederholtes Mal extern closed gesetzt wird, dann wechselt der drive-type von "na" auf "extern".
Wenn nun ein open gesetzt wird, wird der drive-type "extern" ausgewertet und es gibt keinen Fahrbefehl.
Das Problem ist also, dass mit dem open Befehl der drive-type nicht auf modul gesetzt wird, weil der drive-type auf extern steht.

Befehl: extern closed
Resultat --> drive-type na

Erneuter Befehl
Befehl: extern closed
Resultat --> drive-type extern

Befehl: open
Resultat --> drive-type na
Kein Fahrbefehl, obwohl es einen hätte geben müssen!

Ich schaue mir das jetzt im Modul an, und arbeite an einem Bugfix.

Befehl: extern closed
2021.05.19 12:49:56 5: ROLLO (Testrollo) >> Set (extern,closed)
2021.05.19 12:49:56 5: ROLLO (Testrollo) DesiredPos set to closed, ()
2021.05.19 12:49:56 5: ROLLO (Testrollo) DesiredPos now 100, closed
2021.05.19 12:49:56 5: ROLLO (Testrollo) >> Start
2021.05.19 12:49:56 4: ROLLO (Testrollo) drive from 0 to 100. command: closed. state: open
2021.05.19 12:49:56 4: ROLLO (Testrollo) pct: 0 -> 100 / direction: down
2021.05.19 12:49:56 5: ROLLO (Testrollo) >> calculateDriveTime | going down: from 0 to 100
2021.05.19 12:49:56 5: ROLLO (Testrollo) netto drive time = 23
2021.05.19 12:49:56 4: ROLLO (Testrollo) calculateDriveTime: oldpos=0,newpos=100,direction=down,time=23,steps=100,drivetime=29
2021.05.19 12:49:56 4: ROLLO (Testrollo) drive-type is extern, not executing driving commands
2021.05.19 12:49:56 4: ROLLO (Testrollo) stop in 29 seconds.
2021.05.19 12:49:56 5: ROLLO (Testrollo) >> Get
2021.05.19 12:50:25 5: ROLLO (Testrollo) >> Timer
2021.05.19 12:50:25 5: ROLLO (Testrollo) >> Stop
2021.05.19 12:50:25 4: ROLLO (Testrollo) stops from drive-down at pct 100
2021.05.19 12:50:25 4: ROLLO (Testrollo) drives to end pct and autostop is enabled. No stop command executed
Resultat --> drive-type na

Befehl: extern closed
2021.05.19 12:51:21 5: ROLLO (Testrollo) >> Set (extern,closed)
2021.05.19 12:51:21 5: ROLLO (Testrollo) DesiredPos set to closed, ()
2021.05.19 12:51:22 5: ROLLO (Testrollo) DesiredPos now 100, closed
2021.05.19 12:51:22 5: ROLLO (Testrollo) >> Start
2021.05.19 12:51:22 4: ROLLO (Testrollo) drive from 100 to 100. command: closed. state: closed
2021.05.19 12:51:22 4: ROLLO (Testrollo) pct: 100 -> 100 / direction: down
2021.05.19 12:51:22 5: ROLLO (Testrollo) >> calculateDriveTime | going down: from 100 to 100
2021.05.19 12:51:22 4: ROLLO (Testrollo) already at position!
2021.05.19 12:51:22 5: ROLLO (Testrollo) netto drive time = 0
2021.05.19 12:51:22 5: ROLLO (Testrollo) >> Get
Resultat --> drive-type extern

Befehl: open
2021.05.19 12:52:28 5: ROLLO (Testrollo) >> Set (open,)
2021.05.19 12:52:28 5: ROLLO (Testrollo) DesiredPos set to open, ()
2021.05.19 12:52:28 5: ROLLO (Testrollo) DesiredPos now 0, open
2021.05.19 12:52:28 5: ROLLO (Testrollo) >> Start
2021.05.19 12:52:28 4: ROLLO (Testrollo) drive from 100 to 0. command: open. state: closed
2021.05.19 12:52:28 4: ROLLO (Testrollo) pct: 100 -> 0 / direction: up
2021.05.19 12:52:28 5: ROLLO (Testrollo) >> calculateDriveTime | going up: from 100 to 0
2021.05.19 12:52:28 5: ROLLO (Testrollo) netto drive time = 22
2021.05.19 12:52:28 4: ROLLO (Testrollo) calculateDriveTime: oldpos=100,newpos=0,direction=up,time=22,steps=100,drivetime=28
2021.05.19 12:52:28 4: ROLLO (Testrollo) drive-type is extern, not executing driving commands
2021.05.19 12:52:28 4: ROLLO (Testrollo) stop in 28 seconds.
2021.05.19 12:52:56 5: ROLLO (Testrollo) >> Timer
2021.05.19 12:52:56 5: ROLLO (Testrollo) >> Stop
2021.05.19 12:52:56 4: ROLLO (Testrollo) stops from drive-up at pct 0
2021.05.19 12:52:56 4: ROLLO (Testrollo) drives to end pct and autostop is enabled. No stop command executed
Resultat --> drive-type na

KernSani

Hi,
habe das gerade erst gesehen. Wenn du einen patch liefern kannst, super, dann baue ich den ein, ansonsten schaue ich mir das auch nochmal an... Er sollte ja eigentlich beim ersten extern schon auf "extern" gehen.
Grüße,
Oli

Edit: Falsch... Er sollte beim zweiten "closed" auch auf "na" gehen, das macht er aber nicht, weil er schon closed ist... Schaue ich mir nochmal genauer an, aber ich glaube ich weiß schon wo ich reingreifen muss
RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

KernSani

Ich bin verwirrt... eigentlich gibt es bereits einen Fix, der gneau dein Problem beheben sollte:

# Wenn drivetype "extern" müssen wir drive_type wieder zurücksetzen - KernSani 27.01.2019
    elsif ( ReadingsVal( $name, "drive-type", "undef" ) eq "extern" ) {
        readingsSingleUpdate( $hash, "drive-type", "na", 1 );
    }

RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

GunterB

Ich habe das Modul jetzt gelöscht und per Update neu "geholt".
Der Header zeigt aber nur folgendes an:

########################################################################################
# $Id: 44_ROLLO.pm 18352 2019-01-20 15:24:51Z KernSani $ #
# Modul zur einfacheren Rolladensteuerung       #


Ich hoffe nicht, dass ich etwas eklatant falsch mache  :-[

Aber ich finde den Fix auch hier nicht:
https://github.com/RettungsTim/fhem-rollo/blob/master/FHEM/44_ROLLO.pm

Vom 27.01.2019 ist nichts zu finden.

Edit:
Aus irgendeinem Grund holt sich mein FHEM das Modul nicht aus der offiziellen Quelle. Ob ich da was verbogen habe, weiß ich nicht mehr.
Ich bin jetzt auf der Suche die Quelle (https://github.com/fhem/fhem-mirror/blob/master/fhem/FHEM/44_ROLLO.pm) zu ändern.
2021.05.25 10:04:37 1 : UPD FHEM/44_ROLLO.pm
2021.05.25 10:04:38 1 : saving fhem.cfg
2021.05.25 10:04:38 1 : saving ./log/fhem.save
2021.05.25 10:04:38 1 :
2021.05.25 10:04:38 1 : Downloading https://raw.githubusercontent.com/RettungsTim/fhem-rollo/master/controls_fhemrollo.txt


Edit2:
Habe nun die Stelle gefunden. Sorry Jungs!
update delete https://raw.githubusercontent.com/RettungsTim/fhem-rollo/master/controls_fhemrollo.txt