Well, you sure you made the new variable in variables? go to variables on the left of your screen. press the wheel in the right upper corner. press make new variable and make the $dark with value 0.
then make the rule. I have tried to make the rule and here it works.
hope this will help you.
$dark variable was already there, but didnt change when its day or night… seems the brackets in the rule are not working (anymore); so removed them and tried again…