# Constants (script variables)
Here is the latest, up to date constants list.
This file was autogenerated by running 'node scripts/getcommands.js' in the repository.
All descriptions were taken from code.
Constants can be accessed in commands, so things like setChannel 15 2*$CH14+5 can work.
Do not add anything here, as it will overwritten with next rebuild.
| Code        | Description  |
|:------------- | -----:|
| MQTTOn |  Legacy variable, without $ prefix. Returns 1 if MQTT is connected, otherwise 0. |
| $MQTTOn |  Returns 1 if MQTT is connected, otherwise 0. |
| $CH*** |  Provides channel access, so you can do math expressions on channel values. $CH1 is channel 1, $CH20 is channel 20, $CH140 is channel 140, etc |
| $CH** |  Provides channel access, as above. |
| $CH* |  Provides channel access, as above. |
| $FLAG** |  Provides flag access, as above. |
| $FLAG* |  Provides flag access, as above. |
| $led_dimmer |  Current value of LED dimmer, 0-100 range |
| $led_enableAll |  Returns 1 if LED is enabled, otherwise 0. |
| $led_hue |  Current LED Hue value |
| $led_red |  Current LED red value |
| $led_green |  Current LED green value |
| $led_blue |  Current LED blue value |
| $led_saturation |  Current LED saturation value |
| $led_temperature |  Current LED temperature value |
| $activeRepeatingEvents |  Current number of active repeating events |
| $Flash* |  Provides flashvarse channel access, as above. |
| $voltage |  Current value of voltage from energy metering chip. You can use those variables to make, for example, a change handler that fires when voltage is above 245, etc. |
| $current |  Current value of current from energy metering chip |
| $power |  Current value of power from energy metering chip |
| $frequency |  Current value of frequency from energy metering chip |
| $energy |  Current value of energy counter from energy metering chip |
| $yesterday |  Yesterdays energy consuption |
| $today |  Todays energy consuption |
| $day |  Current weekday from device clock |
| $hour |  Current hour from device clock |
| $minute |  Current minute from device clock |
| $second |  Current second from device clock |
| $mday |  Current mday from device clock |
| $month |  Current month from device clock |
| $year |  Current Year from device clock |
| $isDST |  Returns 1 if DST (daylight saving time) is active, otherwise 0 |
| $sunrise |  Next sunrise as a TimerSeconds from midnight - will also print time to log |
| $sunset |  Next sunset as a TimerSeconds from midnight - will also print time to log |
| $NTPOn |  Returns 1 if NTP is on and already synced (so device has correct time), otherwise 0. |
| $batteryVoltage |  Battery driver voltage |
| $batteryLevel |  Battery driver level |
| $uptime |  Time since reboot in seconds |
| $failedBoots |  Get number of failed boots (too quick reboots). Remember that you can change the uptime required to mark boot as 'okay' in general/flags menu |
| $rand01 |  Random float between [0,1] |
| $rand |  Random unsigned value |
| $rebootReason |  Reboot reason |
| $intTemp |  Internal temperature (of WiFi module sensor) |
