Ankündigung

Einklappen
Keine Ankündigung bisher.

rdd4j Persistance

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    rdd4j Persistance

    Ich möchte das Item "Zaehlerstand" von Typ Number persistieren.

    In Items habe ich "Zaehlerstand" definiert:
    Number Zaehlerstand "Zählerstand [%.1f kWh]" (Energie) {homematic="address=CUX2700001, channel=1, parameter=METER"}

    In dem rdd4j Konfigurationsfile habe ich eingetragen.

    Leistung,Energie_Tag, Zaehlerstand, Ber_Leistung : strategy = everyChange, restoreOnStartup,everyMinute

    In dem rule File die Zeile
    diff = Zaehlerstand.state as DecimalType - Zaehlerstand.historicState(now.minusHours(24)).sta te as DecimalType

    PS: Warum state oben immer als "st ate" in der Forum angezeigt wird, verstehe ich nicht. Ich gehe von einem Bug in der Forumssoftware aus.

    PS: Ich sehe, dass immer ein Leerzeichen beim Word "state" angezeigt wird, dass scheint ein Bug in der Forumsoftware zu sein.
    Ich habe hier kein Leerzeichen im Text.



    scheinbar funktioniert der rdd4j persistance Service nicht. Denn die Zeile wirft immer einen Java Fehler aus.

    Hat jemand eine Idee?
    Ist das Konstrukt "Zaehlerstand.historicState(now.minusHours(24)).st ate as DecimalType" unter Umständen falsch?

    #2
    Mohsin

    sta te as DecimalType PS: Why is top always state as "st ate" in the forum indicated, I do not understand. I go by a bug in the forum software. PS: I see that always appears a space when Word "state" that seems to be a bug in the forum software. I have no space in the text. apparently does the rdd4j persistance not service. Because the line always throws a Java error. Has anyone an idea? If the construct "Zaehlerstand.historicState (now.minusHours (24)). st ate as DecimalType" may incorrectly?


    _____________
    Mohsin

    Kommentar


      #3
      state is not im my code. This is only the Forum bug.

      Kommentar


        #4
        Zitat von klayer Beitrag anzeigen
        [...] die Zeile wirft immer einen Java Fehler aus.

        Hat jemand eine Idee?
        Ist das Konstrukt "Zaehlerstand.historicState(now.minusHours(24)).st ate as DecimalType" unter Umständen falsch?
        Kann es sein, dass Du den Ausdruck klammern musst? Also
        Code:
        diff = (Zaehlerstand.state as DecimalType) - (Zaehlerstand.historicState(now.minusHours(24)).state as DecimalType)

        Kommentar


          #5
          Ach... und könnte es sein, dass das hintere .state garnicht gebraucht wird? Bin mir da grad nicht so sicher, finde aber auf die Schnelle auch keinen Codeschnipsel dazu...
          Schließlich beinhaltet der Begriff HistoricState dieses Wort schon, eventuell wird hier schon der Wert zurückgegeben, und nicht das Item.

          Kommentar


            #6
            @udo1toni
            Der Tip mit dem Klammern war die Lösung.
            Vielen Dank!!

            Kommentar


              #7
              sta te as DecimalType PS: Why is top always state as "st ate" in the forum indicated, I do not understand. I go by a bug in the forum software. PS: I see that always appears a space when Word "state" that seems to be a bug in the forum software. I have no space in the text. apparently does the rdd4j persistance not service. Because the line always throws a Java error. Has anyone an idea? If the construct "Zaehlerstand.historicState (now.minusHours (24)). st ate as DecimalType" may incorrectly?


              _____________
              Our excellent online pass4sure training programs will lead you to success in the wikipedia We also offer latest Swiss Federal Institute of Technology Zurich and HITACHI with 100% success guarantee. Our selftestengine is rare in IT MICROSOFT

              Kommentar

              Lädt...
              X