Wenn FHEM neu getsratet wurde - Set Befehl ausführen

Begonnen von Fabiango, 14 November 2021, 16:31:14

Vorheriges Thema - Nächstes Thema

Fabiango

Hallo zusammen,

ich möchte wenn FHEM neu gestartet wurde ein Set Befehl nach 30 Sekunden auf den Alexa Connector durchführen.
Da es seit der Umstellung der HMCCU auf Version 5 Probleme gibt möchte ich das nicht immer von Hand machen müssen.

Ich habe mir folgendes Notify ausgedacht aber es funktioniert nicht wie gewünscht.
define AlexaConnectorRestart notify global:INITIALIZED:.* sleep 30;;set alexa restart

Muss ich das global zuerst noch definieren bearbeiten?
Muss ich den Alexa Connector anderst ansprechen?

Über eure Hilfe wäre ich euch sehr Dankbar.
Stelle untenstehend noch die Lists zur Verfügung.

List (Alexa Connector)
Internals:
   FD         14
   FUUID      613335b5-f33f-c1dd-b9a1-c79888eebb71ef33
   FVERSION   39_alexa.pm:0.238200/2021-02-24
   LAST_START 2021-11-14 16:19:08
   NAME       alexa
   NOTIFYDEV  global,global:npmjs.*alexa-fhem.*
   NR         290
   NTFY_ORDER 50-alexa
   PARTIAL   
   PID        3624
   STARTS     1
   STATE      running /usr/bin/alexa-fhem
   TYPE       alexa
   active     0
   alexa-fhem version 0.5.61
   currentlogfile ./log/alexa-2021-11-14.log
   logfile    ./log/alexa-%Y-%m-%d.log
   CoProcess:
     cmdFn      alexa_getCMD
     name       alexaFHEM
     state      running /usr/bin/alexa-fhem
   READINGS:
     2021-11-14 16:19:08   alexaFHEM       running /usr/bin/alexa-fhem
     2021-11-14 16:19:18   alexaFHEM.ProxyConnection running; SSH connected
     2021-08-22 12:36:19   alexaFHEM.bearerToken crypt:5662775620567d59975b03037c080207
     2021-08-22 12:36:20   alexaFHEM.skillRegKey crypt:275403265351784b045a00030c7c04440b0e5d06200154044b060e2996760a7c555709535520095107
   helper:
Attributes:
   alexaFHEM-config ./alexa-fhem.cfg
   alexaFHEM-log ./log/alexa-%Y-%m-%d.log
   alexaMapping #Characteristic=<name>=<value>,...
On=verb=schalte,valueOn=an;ein,valueOff=aus,valueToggle=um

Brightness=verb=stelle,property=helligkeit,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

Hue=verb=stelle,valuePrefix=auf,values=rot:0;grün:128;blau:200
Hue=verb=färbe,values=rot:0;grün:120;blau:220

Saturation=verb=stelle,property=sättigung,valuePrefix=auf,values=AMAZON.NUMBER
Saturation=verb=sättige,values=AMAZON.NUMBER

TargetPosition=verb=mach,articles=den;die,values=auf:100;zu:0
TargetPosition=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

TargetTemperature=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=grad

Volume:verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

#Weckzeit=verb=stelle,valuePrefix=auf;für,values=AMAZON.TIME,valueSuffix=uhr
   alexaTypes #Type=<alias>[,<alias2>[,...]]
light=licht,lampen
blind=rolladen,rolläden,jalousie,jalousien,rollo,rollos
   alias      Alexa Connector
   cmdIcon    start:general_an
   devStateIcon stopped:control_home@red:start stopping:control_on_off@orange running.*:control_on_off@green:stop
   echoRooms  #<deviceId>=<room>
attr alexa fhemIntents #IntentName=<sample utterance>
gutenMorgen=guten morgen
guteNacht=gute nacht
   fhemIntents #IntentName=<sample utterance>
gutenMorgen=guten morgen
guteNacht=gute nacht
   group      Amazon
   persons    #<personId>=<name>
attr alexa stateFormat alexaFHEM
   room       System
   stateFormat alexaFHEM
   webCmd     start


List (Notify Restart)
Internals:
   DEF        global:INITIALIZED:.* sleep 30;set alexa restart
   FUUID      6191289e-f33f-c1dd-87ff-ae9a31214ba8db20
   NAME       AlexaConnectorRestart
   NOTIFYDEV  global
   NR         294
   NTFY_ORDER 50-AlexaConnectorRestart
   REGEXP     global:INITIALIZED:.*
   STATE      active
   TYPE       notify
   READINGS:
     2021-11-14 16:19:08   state           active
Attributes:


List (Global)
Internals:
   DEF        no definition
   FD         3
   NAME       global
   NR         1
   STATE      no definition
   TYPE       Global
   currentlogfile ./log/fhem-2021-11.log
   init_errors Messages collected while initializing FHEM:SecurityCheck:
  telnetPort is not password protected
  WEBtablet is not password protected
  WEB is not password protected
  WEBphone is not password protected

Protect this FHEM installation by configuring the allowed device allowed_WEBphone
You can disable this message with attr global motd none

   logfile    ./log/fhem-%Y-%m.log
Attributes:
   autoload_undefined_devices 1
   autosave   0
   configfile fhem.cfg
   latitude   47.53983
   logfile    ./log/fhem-%Y-%m.log
   longitude  7.62930
   modpath    .
   motd       none
   sendStatistics never
   statefile  ./log/fhem.save
   userattr   alexaName alexaProactiveEvents:1,0 alexaRoom cmdIcon devStateIcon:textField-long devStateStyle fp_Grundriss genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock,scene homebridgeMapping:textField-long icon sortby webCmd webCmdLabel:textField-long widgetOverride
   verbose    3
   version    fhem.pl:25197/2021-11-07

SamNitro

versuch mal
define AlexaConnectorRestart notify global:INITIALIZED sleep 30;;set alexa restart
(Intel-Nuc Proxmox) (Homematic) (EnOcean) (CUL868) (CUL433) (Zigbee2MQTT) (ESP8266) (Echo) (DUOFERN)

Fabiango

Hab es nun wie folgt gelöst und es funktioniert.
Frage nun nicht den Neustart ab sondern die CCU3 welche für die Homematic Geräte zuständig ist.

define AlexaConnectorRestart notify CCU_3:rpcstate:.* sleep 30;;set alexa restart

Fabiango

Zitat von: SamNitro am 14 November 2021, 16:44:42
versuch mal
define AlexaConnectorRestart notify global:INITIALIZED sleep 30;;set alexa restart

So wie von Dir Vorgeschlagen funktioniert zwar der Notify aber die Zeitverzögerung wird nicht berücksichtigt