BUG? Sending data to server

Don't know much about your hardware, but...

void turnOnWiFi()
{
...
      turnOnWiFi();
...
}

Surely that would be better written without the recursion.

void turnOnWiFi()
{
...
      if(connection_retries == 10)
      {
        Serial.println("Failed connecting to wifi. Going to sleep.");
...
}

So you try to connect to the WiFi 10 times...

void sendValues()
{
  client.setCACert(root_ca);

  if (client.connect("homesp.cz", 443))
  {
    client.println("POST /add.php HTTP/1.1");
    client.println("Host: homesp.cz");
    client.println("Content-Type: application/x-www-form-urlencoded");
    client.println("Content-Length: " + String(data.length()));
    client.println();
    client.println(data);
  }
}

But you only try to establish the connection to the server once. Try printing some debug to see if the connect is failing.

Also, consider explicitly flushing or closing the connection after the send to exclude any possibility that you end up in sleep mode before the data has been completely sent.

  if(did_once == false)

Where do you set did_once to true?