Issue with STR and FLOAT

This is the complete sketch

The challenge i have is on line 203, where the wrong value is given.
The "return Str" on lines 331-335 is working and gives me to correct value back.

Some lines could be that you think: what has he done there.
It is hobby and still learning about things

#include "_Plugin_Helper.h"
#include <RCSwitch64.h>  

static RCSwitch64 Plugin_144_RC = RCSwitch64();
char Str[20];      

#define PLUGIN_144
#define PLUGIN_ID_144         144
#define PLUGIN_NAME_144       "RC-Switch TX"
#define PLUGIN_ValueNAME1_144 "RF"

boolean Plugin_144(byte function, struct EventStruct *event, String& string)
{
  boolean success = false;
  
  switch (function)
  {
    case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_144;
        //Device[deviceCount].Type = DEVICE_TYPE_DUAL;
        Device[deviceCount].Ports = 0;
        Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_DUAL;
        Device[deviceCount].PullUpOption = false;
        Device[deviceCount].InverseLogicOption = false;
        Device[deviceCount].FormulaOption = false;
        Device[deviceCount].ValueCount = 1;
        Device[deviceCount].SendDataOption = true;
        Device[deviceCount].TimerOption = false;
        Device[deviceCount].TimerOptional = false;
        Device[deviceCount].GlobalSyncOption = true;
        break;
      }

    case PLUGIN_GET_DEVICENAME:
      {
        string = F(PLUGIN_NAME_144);
        break;
      }

    case PLUGIN_GET_DEVICEVALUENAMES:
      {
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[0], PSTR(PLUGIN_ValueNAME1_144));
        break;
      }

    case PLUGIN_WEBFORM_LOAD:
      {  
        addFormPinSelect(F("TX-GPIO"),  F("taskdevicepin1"), CONFIG_PIN1);
        addFormPinSelect(F("RX-GPIO"),  F("taskdevicepin2"), CONFIG_PIN2);
//      addFormCheckBox(F("Use transceiver"), F("transceiver"), PCONFIG(1));    //future work
        addFormPinSelect(F("Enable-GPIO"),  F("taskdevicepin3"), CONFIG_PIN3);
        addFormPinSelect(F("TX_RX Toggle-GPIO"),  F("taskdevicetxpin"), PCONFIG(2));
        
        success = true;
        break;
      }

    case PLUGIN_WEBFORM_SAVE:
      {
//        PCONFIG(1)       = isFormItemChecked(F("transceiver"));    //future work
        PCONFIG(2)       = getFormItemInt(F("taskdevicetxpin"));
        success = true;
        break;
      }

    case PLUGIN_INIT:
      {
        if (CONFIG_PIN1 >= 0) //TX-pin
        {
          pinMode(CONFIG_PIN1, OUTPUT);
          String log = F("RC-Sw: Send Pin ");
          log += CONFIG_PIN1;
          log += F(" ");

          Plugin_144_RC.enableTransmit(CONFIG_PIN1);

          addLog(LOG_LEVEL_INFO, log);
        }

        if (CONFIG_PIN2 >= 0) // RX-pin
        {
          pinMode(CONFIG_PIN2, INPUT_PULLUP);
          String log = F("RC-Sw: Receive pin ");
          log += CONFIG_PIN2;
          log += F(" ");

          Plugin_144_RC.enableReceive(CONFIG_PIN2);

          addLog(LOG_LEVEL_INFO, log);
        }

        if (CONFIG_PIN3 >= 0)  //enable pin
          pinMode(CONFIG_PIN3, OUTPUT);
        if (PCONFIG(2) >= 0)  //TX_RX pin
          pinMode(PCONFIG(2), OUTPUT);  
        

        //Prefix Enable and TX_RX pin to low
        digitalWrite (CONFIG_PIN3, LOW);
        digitalWrite (PCONFIG(2), LOW);
        delayMicroseconds(500);


        //Set transceiver to RX after powerdown
        digitalWrite (CONFIG_PIN3, HIGH);
        delayMicroseconds(20);
        digitalWrite (PCONFIG(2), HIGH);
        delayMicroseconds(200);
        digitalWrite (PCONFIG(2), LOW);
        delayMicroseconds(40);
        digitalWrite (CONFIG_PIN3, LOW);
        delayMicroseconds(20);
        digitalWrite (CONFIG_PIN3, HIGH);
        delayMicroseconds(200);

        success = true;
        break;
      }

      case PLUGIN_ONCE_A_SECOND:
        {
          if (CONFIG_PIN2 >= 0) {
            if (UserVar[event->BaseVarIndex] != 0) {
              UserVar[event->BaseVarIndex] = (0);
            }
            
            if (Plugin_144_RC.available())
              {
                Serial.print("RF recieved");
                int valuerf = Plugin_144_RC.getReceivedValue();

                if (valuerf == 0) {
                  String log = F("RFcode: ");
                  log += String(valuerf);
                  log += " =Unknown encoding";
                  addLog(LOG_LEVEL_INFO, log);
        
                } else {

                   int databuffer[128]; // get a copy of the received timings before they are overwritten
                   int numberoftimings = 2 * Plugin_144_RC.getReceivedBitlength() + 2;
                   if(numberoftimings > 128) numberoftimings = 128;
                   for (int i = 0; i < numberoftimings; i++) {
                     databuffer[i] = Plugin_144_RC.getReceivedRawdata()[i];
                   }

                   String printEmpty = F("");
                   addLog(LOG_LEVEL_INFO, printEmpty);

                   String printSerial1 = F("RFcode: ");
                   printSerial1 += F("Protocol: ");
                   printSerial1 += ( Plugin_144_RC.getReceivedProtocol() );
                   printSerial1 += F(", ");
                   printSerial1 += ( Plugin_144_RC.getReceivedBitlength() );
                   printSerial1 += F(" bit");
                   addLog(LOG_LEVEL_INFO, printSerial1);
                   
                   unsigned int databitsoffset = abs( (int)Plugin_144_RC.getReceivedLevelInFirstTiming() - (int)Plugin_144_RC.getReceivedInverted());
                   
                   unsigned long dataduration = 0;
                   for (unsigned int i = 1 + databitsoffset; i < numberoftimings - 1 + databitsoffset; i++) {
                     dataduration += databuffer[i];
                   }
                   String printSerial2 = F("RFcode: ");
                   printSerial2 += F("Data bits of pulse train duration: ");
                   printSerial2 += ( dataduration );
                   addLog(LOG_LEVEL_INFO, printSerial2);

                   unsigned int averagebitduration = (int)(0.5 + ((double)dataduration)/Plugin_144_RC.getReceivedBitlength());
                   unsigned int protocolratio = (unsigned int)(0.5 + ((double)(averagebitduration - Plugin_144_RC.getReceivedDelay())) / (double)Plugin_144_RC.getReceivedDelay());
                   String printSerial3 = F("RFcode: ");
                   printSerial3 += F("Proposed protocol: { ");
                   printSerial3 += (Plugin_144_RC.getReceivedDelay());
                   printSerial3 += F(", { ");
                   printSerial3 += ( (databitsoffset==0) ? 
                   (int) (0.5 + (double)databuffer[2*Plugin_144_RC.getReceivedBitlength()+1]/(double)Plugin_144_RC.getReceivedDelay())
                   :
                   (int) (0.5 + (double)databuffer[0]/(double)Plugin_144_RC.getReceivedDelay())
                   );
                   printSerial3 += F(", ");
                   printSerial3 += ( (databitsoffset==0) ?
                   (int) (0.5 + (double)databuffer[0]/(double)Plugin_144_RC.getReceivedDelay())
                   :
                   (int) (0.5 + (double)databuffer[1]/(double)Plugin_144_RC.getReceivedDelay())
                   );
                   printSerial3 += F(" }, { ");
                   printSerial3 += F("1");
                   printSerial3 += F(", ");
                   printSerial3 += (protocolratio);
                   printSerial3 += F(" }, { ");
                   printSerial3 += (protocolratio);
                   printSerial3 += F(", ");
                   printSerial3 += F("1");
                   printSerial3 += F(" }, ");
                   printSerial3 += ((Plugin_144_RC.getReceivedInverted()) ? "true" : "false" );
                   printSerial3 += F(" }");
                   addLog(LOG_LEVEL_INFO, printSerial3);

                   binair(Plugin_144_RC.getReceivedValue(), Plugin_144_RC.getReceivedBitlength());

                   uint64_t number = atoll(Str);
                   UserVar[event->BaseVarIndex] = (number);
                   sendData(event);

                }

              Plugin_144_RC.resetAvailable();
            }
            success = true;
            break;
          }
        }
  
    case PLUGIN_WRITE:
      {
        if (PCONFIG(2) >= 0) {
          String command = parseString(string, 1);

          if (command == F("rc")) {
            String param;
            byte paramIdx = 2;

            string.replace("  ", " ");
            string.replace(" =", "=");
            string.replace("= ", "=");

            param = parseString(string, paramIdx++);
            while (param.length()) {
              addLog(LOG_LEVEL_DEBUG_MORE, param);

              int index = param.indexOf('=');
              if (index > 0) {
                String paramKey = param.substring(0, index);
                String paramVal = param.substring(index+1);
                paramKey.toUpperCase();

                addLog(LOG_LEVEL_DEBUG_MORE, paramKey);
                addLog(LOG_LEVEL_DEBUG_MORE, paramVal);

                if (paramKey == F("SEND")) {
                  if (paramVal.indexOf("F") >= 0)
                    Plugin_144_RC.sendTriState(&(paramVal[0]));
                  else
                    Plugin_144_RC.send(&(paramVal[0]));
                }
                if (paramKey == F("ON")) {
                  if (paramVal.length()==10)   //simple 10 DIP switch
                    Plugin_144_RC.switchOn(&(paramVal.substring(0, 5)[0]), &(paramVal.substring(5)[0]));
                  else if (paramVal.length()==2)   //2x rotary switch 1..4
                    Plugin_144_RC.switchOn(paramVal[0]-'0', paramVal[1]-'0');
                  else if (paramVal.length()==3)   //Intertechno outlets
                    Plugin_144_RC.switchOn(paramVal[0], paramVal[1]-'0', paramVal[2]-'0');
                }
                if (paramKey == F("OFF")) {
                  if (paramVal.length()==10)   //simple 10 DIP switch
                    Plugin_144_RC.switchOff(&(paramVal.substring(0, 5)[0]), &(paramVal.substring(5)[0]));
                  else if (paramVal.length()==2)   //2x rotary switch 1..4
                    Plugin_144_RC.switchOff(paramVal[0]-'0', paramVal[1]-'0');
                  else if (paramVal.length()==3)   //Intertechno outlets
                    Plugin_144_RC.switchOn(paramVal[0], paramVal[1]-'0', paramVal[2]-'0');
                }
                if (paramKey == F("PROTOCOL")) {
                  Plugin_144_RC.setProtocol(paramVal.toInt());
                }
                if (paramKey == F("PULSE")) {
                  Plugin_144_RC.setPulseLength(paramVal.toInt());
                }
                if (paramKey == F("REPEAT")) {
                  Plugin_144_RC.setRepeatTransmit(paramVal.toInt());
                }
              }

              param = parseString(string, paramIdx++);
            }

            success = true;
          }

          break;
        }
      }

    case PLUGIN_READ:
      {
        //no values
        success = true;
        break;
      }

  }
  return success;
}

/* extended logging, for in terminal monitor */
static char * dec2binWzerofill(unsigned long long Dec, unsigned int bitLength);
static char * dec(unsigned long long Dec);

void binair(unsigned long long decimal, unsigned int length) {
      if (decimal == 0) {
        Serial.print("Unknown encoding.");
      } else {
        const char* b = dec2binWzerofill(decimal, length);

        String printBinary = F("RFcode: ");              
        printBinary += F("Binary: "); 
        printBinary += b;
        addLog(LOG_LEVEL_INFO, printBinary);

        String printDecimal = F("RFcode: ");
        printDecimal += F("Decimal: ");
        const char* d = dec(decimal);
        printDecimal += d;
        addLog(LOG_LEVEL_INFO, printDecimal);
 
        String url = String(NetworkLocalIP().toString()) + "/control?cmd=RC";
        String printString = F("RFcode: http://");
        printString += url;
        printString += F(",PROTOCOL=");
        printString += ( Plugin_144_RC.getReceivedProtocol() );
        printString += F(",SEND=");
        printString += b;
        printString += F("");
        addLog(LOG_LEVEL_INFO, printString);

        String printEmpty = F("");
        addLog(LOG_LEVEL_INFO, printEmpty);
      }
}

static char * dec (unsigned long long Dec) {
      static char Str[20];      
      sprintf(Str, "%lld", Dec);
      return Str;
}

static char * dec2binWzerofill(unsigned long long Dec, unsigned int bitLength) {

        static char bin[128];
        unsigned int i=0;

        while (Dec > 0) {
                bin[64+i++] = ((Dec & 1) > 0) ? '1' : '0';
                Dec = Dec >> 1;
        }

        for (unsigned int j = 0; j< bitLength; j++) {
                if (j >= bitLength - i) {
                        bin[j] = bin[ 63 + i - (j - (bitLength - i)) ];
                } else {
                        bin[j] = '0';
                }
        }
        bin[bitLength] = '\0';
        
        return bin;
}