Random not random?

Can anyone tell me why I can't seem to get the random numbers to give any value besides the low limit?

Full code:

#include <FastLED.h>

#define LED_PIN 9                           // data pin
#define NUM_LEDS 50
#define COLOR_ORDER GRB
#define LED_TYPE WS2811
#define MAX_BRIGHTNESS 50                  // watch the power!
#define FPS 50
#define FLASHES 8


CRGB leds[NUM_LEDS];

uint8_t hue = 0;
uint8_t pattern = 0;
unsigned int dimmer = 1;
unsigned long previousMillis = 0; // last time update
unsigned long interval = 30000;   // interval at which to do something i.e. lightning (milliseconds)

void setup()  {
  FastLED.addLeds<WS2811, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(50);
  randomSeed(analogRead(A5));
}

void loop() {
  unsigned long currentMillis = millis();      //time
  long randNumber = random(3, 9);

  if (currentMillis - previousMillis > randNumber * interval) {    //lightning trigger
    previousMillis = currentMillis;

    for (int flashCounter = 0; flashCounter < random8(3, FLASHES); flashCounter++)
    {
      if (flashCounter == 0) dimmer = 5;    // the brightness of the leader is scaled down by a factor of 5
      else dimmer = random8(1, 3);          // return strokes are brighter than the leader

      FastLED.showColor(CHSV(255, 0, 255 / dimmer));
      delay(random8(10, 40));                // each flash only lasts 4-10 milliseconds
      FastLED.showColor(CHSV(255, 0, 0));

      if (flashCounter == 0) delay (150);   // longer delay until next flash after the leader
      delay(50 + random8(100));             // shorter delay between strokes
    }
  }

  else  {
    for (int i = 0; i < NUM_LEDS; i++)  {
      leds[i] = CHSV(hue, 255, 255);
    }

    EVERY_N_MILLISECONDS(200) {
      hue++;

      FastLED.show();
    }
  }
}

The pertinent part in question being:

void setup()  {
  FastLED.addLeds<WS2811, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(50);
  randomSeed(analogRead(A5));
}

void loop() {
  unsigned long currentMillis = millis();      //time
  long randNumber = random(3, 9);

  if (currentMillis - previousMillis > randNumber * interval) {    //lightning trigger
    previousMillis = currentMillis;

always seems to give a value of 3.

What am I doing wrong?

For any time less than 3 * interval ( or 90 seconds) the if statement will be false. When you reach the 90 second mark, you have a 30 second interval in which a random number of 3 will produce a true result, and any other random number will produce false. The loop will get executed multiple times within that 30 seconds interval, so it is very unlikely random() will never produce a 3 during that time.

david_2018:
For any time less than 3 * interval ( or 90 seconds) the if statement will be false. When you reach the 90 second mark, you have a 30 second interval in which a random number of 3 will produce a true result, and any other random number will produce false. The loop will get executed multiple times within that 30 seconds interval, so it is very unlikely random() will never produce a 3 during that time.

I think I follow.
Is there a different method achieve a random multiple of 30 seconds that would work in this case that you might suggest?

Move the random number selection to inside the millis test block.

aarg:
Move the random number selection to inside the millis test block.

Ok, I've tried putting it everywhere I can think it should go, to no success. Care to give me a little bit more of a hint?

Post some examples of what you tried, and explain how they failed.