Temperature does not trigger the rule

As EG_Vi_spu is of type Number, you will have to use

Echo_TTS.sendCommand("Pufferspeicher Temperatur hat " + EG_Vi_spu.state.toString + " Grad Celsius erreicht. Ohne Wärmeabfuhr schaltet die Stromproduktion in circa 15 Minuten ab.")
1 Like

I got the rule working.
Problem was, that the Expire Binding was not intalled.
1 Problem is left.
The message gives me the temperature in a wrong format. Like for example 28.5 Degrees. In german it should be 28,9 Degrees because Alexa reads it like a date 28th of may. So I need to replace the “.” with a “,” or pass only 29 to Alexa.
Ang ideas how?
Here the rule:

rule "Stromproduktion"
when
    //Item EG_Vi_spu changed
    Item Dummy changed
then
    logInfo("Test","Stromproduktion Speichertemperatur geändert, Rule Triggered")
    if (EG_Vi_spu.state == NULL) return;
    logInfo("Test","EG_Vi_spu.state 1 " +EG_Vi_spu.state)
    logInfo("Test","Timer Status davor " +EG_Vi_spu_Timer.state)
    if (EG_Vi_spu_Timer.state == ON) return; // do nothing if timer is on
    logInfo("Test","Timer Status danach " +EG_Vi_spu_Timer.state)
    if (EG_Vi_evrule == 100 && EG_Vi_nbrule == 100) return;
    logInfo("Test","EV + NB "+ EG_Vi_evrule.state + EG_Vi_nbrule.state)
    if (EG_Vi_spu.state < 20) EG_Vi_spu_Timer.postUpdate(OFF)
    //else // do you need this else?
    logInfo("Test","EG_Vi_spu.state 2 " +EG_Vi_spu.state)

    var Number hour = now.getHourOfDay
    if (hour >= 7 && hour <= 23 ) {
        if (EG_Vi_spu.state > 30) {
            Echo_TTS.sendCommand("Pufferspeicher Temperatur hat " + EG_Vi_spu.state + "Grad erreicht. Ohne Wärmeabfuhr schaltet die Stromproduktion in circa 15 Minuten ab.")
            logInfo("Test","state > 55")
            EG_Vi_spu_Timer.sendCommand(ON)
            //hour = null // why set to null?
        }
        else if (EG_Vi_spu.state > 25) {
            Echo_TTS.sendCommand("Pufferspeicher Temperatur hat " + EG_Vi_spu.state + "Grad erreicht. Ohne Wärmeabfuhr schaltet die Stromproduktion in circa 30 Minuten ab.")
            logInfo("Test","state > 50")
            EG_Vi_spu_Timer.sendCommand(ON)
            //hour = null
        }
    }
end

This might work to replace the period with a comma:

Echo_TTS.sendCommand("Pufferspeicher Temperatur hat " + EG_Vi_spu.state.toString.replace(".", ",") + " Grad erreicht. Ohne Wärmeabfuhr schaltet die Stromproduktion in circa 30 Minuten ab.")
1 Like

This works perfectly!
Thank you all for your help!
I am really happy with the result!
:+1:

That made me chuckle. Damned machines know best :wink: