Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

280 lines
8.5 KiB

  1. //--------------------------------------------------------------------------------
  2. // PROGMEM definitions
  3. //--------------------------------------------------------------------------------
  4. //--------------------------------------------------------------------------------
  5. // Reset reasons
  6. //--------------------------------------------------------------------------------
  7. PROGMEM const char custom_reset_hardware[] = "Hardware button";
  8. PROGMEM const char custom_reset_web[] = "Reboot from web interface";
  9. PROGMEM const char custom_reset_terminal[] = "Reboot from terminal";
  10. PROGMEM const char custom_reset_mqtt[] = "Reboot from MQTT";
  11. PROGMEM const char custom_reset_rpc[] = "Reboot from RPC";
  12. PROGMEM const char custom_reset_ota[] = "Reboot after successful OTA update";
  13. PROGMEM const char custom_reset_http[] = "Reboot from HTTP";
  14. PROGMEM const char custom_reset_nofuss[] = "Reboot after successful NoFUSS update";
  15. PROGMEM const char custom_reset_upgrade[] = "Reboot after successful web update";
  16. PROGMEM const char custom_reset_factory[] = "Factory reset";
  17. PROGMEM const char* const custom_reset_string[] = {
  18. custom_reset_hardware, custom_reset_web, custom_reset_terminal,
  19. custom_reset_mqtt, custom_reset_rpc, custom_reset_ota,
  20. custom_reset_http, custom_reset_nofuss, custom_reset_upgrade,
  21. custom_reset_factory
  22. };
  23. //--------------------------------------------------------------------------------
  24. // Capabilities
  25. //--------------------------------------------------------------------------------
  26. PROGMEM const char espurna_modules[] =
  27. #if ALEXA_SUPPORT
  28. "ALEXA "
  29. #endif
  30. #if BROKER_SUPPORT
  31. "BROKER "
  32. #endif
  33. #if DEBUG_SERIAL_SUPPORT
  34. "DEBUG_SERIAL "
  35. #endif
  36. #if DEBUG_TELNET_SUPPORT
  37. "DEBUG_TELNET "
  38. #endif
  39. #if DEBUG_UDP_SUPPORT
  40. "DEBUG_UDP "
  41. #endif
  42. #if DEBUG_WEB_SUPPORT
  43. "DEBUG_WEB "
  44. #endif
  45. #if DOMOTICZ_SUPPORT
  46. "DOMOTICZ "
  47. #endif
  48. #if HOMEASSISTANT_SUPPORT
  49. "HOMEASSISTANT "
  50. #endif
  51. #if I2C_SUPPORT
  52. "I2C "
  53. #endif
  54. #if INFLUXDB_SUPPORT
  55. "INFLUXDB "
  56. #endif
  57. #if LLMNR_SUPPORT
  58. "LLMNR "
  59. #endif
  60. #if MDNS_SERVER_SUPPORT
  61. "MDNS_SERVER "
  62. #endif
  63. #if MDNS_CLIENT_SUPPORT
  64. "MDNS_CLIENT "
  65. #endif
  66. #if MQTT_SUPPORT
  67. "MQTT "
  68. #endif
  69. #if NETBIOS_SUPPORT
  70. "NETBIOS "
  71. #endif
  72. #if NOFUSS_SUPPORT
  73. "NOFUSS "
  74. #endif
  75. #if NTP_SUPPORT
  76. "NTP "
  77. #endif
  78. #if RF_SUPPORT
  79. "RF "
  80. #endif
  81. #if SCHEDULER_SUPPORT
  82. "SCHEDULER "
  83. #endif
  84. #if SENSOR_SUPPORT
  85. "SENSOR "
  86. #endif
  87. #if SPIFFS_SUPPORT
  88. "SPIFFS "
  89. #endif
  90. #if SSDP_SUPPORT
  91. "SSDP "
  92. #endif
  93. #if TELNET_SUPPORT
  94. "TELNET "
  95. #endif
  96. #if TERMINAL_SUPPORT
  97. "TERMINAL "
  98. #endif
  99. #if THINGSPEAK_SUPPORT
  100. "THINGSPEAK "
  101. #endif
  102. #if UART_MQTT_SUPPORT
  103. "UART_MQTT "
  104. #endif
  105. #if WEB_SUPPORT
  106. "WEB "
  107. #endif
  108. "";
  109. //--------------------------------------------------------------------------------
  110. // Sensors
  111. //--------------------------------------------------------------------------------
  112. #if SENSOR_SUPPORT
  113. PROGMEM const char espurna_sensors[] =
  114. #if AM2320_SUPPORT
  115. "AM2320_I2C "
  116. #endif
  117. #if ANALOG_SUPPORT
  118. "ANALOG "
  119. #endif
  120. #if BH1750_SUPPORT
  121. "BH1750 "
  122. #endif
  123. #if BMX280_SUPPORT
  124. "BMX280 "
  125. #endif
  126. #if CSE7766_SUPPORT
  127. "CSE7766 "
  128. #endif
  129. #if DALLAS_SUPPORT
  130. "DALLAS "
  131. #endif
  132. #if DHT_SUPPORT
  133. "DHTXX "
  134. #endif
  135. #if DIGITAL_SUPPORT
  136. "DIGITAL "
  137. #endif
  138. #if ECH1560_SUPPORT
  139. "ECH1560 "
  140. #endif
  141. #if EMON_ADC121_SUPPORT
  142. "EMON_ADC121 "
  143. #endif
  144. #if EMON_ADS1X15_SUPPORT
  145. "EMON_ADX1X15 "
  146. #endif
  147. #if EMON_ANALOG_SUPPORT
  148. "EMON_ANALOG "
  149. #endif
  150. #if EVENTS_SUPPORT
  151. "EVENTS "
  152. #endif
  153. #if GEIGER_SUPPORT
  154. "GEIGER "
  155. #endif
  156. #if GUVAS12SD_SUPPORT
  157. "GUVAS12SD "
  158. #endif
  159. #if HCSR04_SUPPORT
  160. "HCSR04 "
  161. #endif
  162. #if HLW8012_SUPPORT
  163. "HLW8012 "
  164. #endif
  165. #if MHZ19_SUPPORT
  166. "MHZ19 "
  167. #endif
  168. #if PMSX003_SUPPORT
  169. "PMSX003 "
  170. #endif
  171. #if PZEM004T_SUPPORT
  172. "PZEM004T "
  173. #endif
  174. #if SENSEAIR_SUPPORT
  175. "SENSEAIR "
  176. #endif
  177. #if SHT3X_I2C_SUPPORT
  178. "SHT3X_I2C "
  179. #endif
  180. #if SI7021_SUPPORT
  181. "SI7021 "
  182. #endif
  183. #if TMP3X_SUPPORT
  184. "TMP3X "
  185. #endif
  186. #if V9261F_SUPPORT
  187. "V9261F "
  188. #endif
  189. "";
  190. PROGMEM const unsigned char magnitude_decimals[] = {
  191. 0,
  192. 1, 0, 2,
  193. 3, 0, 0, 0, 0, 0, 0, 0,
  194. 0, 0, 0,
  195. 0, 0, 0,
  196. 0, 0, 3, 3,
  197. 4, 4 // Geiger Counter decimals
  198. };
  199. PROGMEM const char magnitude_unknown_topic[] = "unknown";
  200. PROGMEM const char magnitude_temperature_topic[] = "temperature";
  201. PROGMEM const char magnitude_humidity_topic[] = "humidity";
  202. PROGMEM const char magnitude_pressure_topic[] = "pressure";
  203. PROGMEM const char magnitude_current_topic[] = "current";
  204. PROGMEM const char magnitude_voltage_topic[] = "voltage";
  205. PROGMEM const char magnitude_active_power_topic[] = "power";
  206. PROGMEM const char magnitude_apparent_power_topic[] = "apparent";
  207. PROGMEM const char magnitude_reactive_power_topic[] = "reactive";
  208. PROGMEM const char magnitude_power_factor_topic[] = "factor";
  209. PROGMEM const char magnitude_energy_topic[] = "energy";
  210. PROGMEM const char magnitude_energy_delta_topic[] = "energy_delta";
  211. PROGMEM const char magnitude_analog_topic[] = "analog";
  212. PROGMEM const char magnitude_digital_topic[] = "digital";
  213. PROGMEM const char magnitude_events_topic[] = "events";
  214. PROGMEM const char magnitude_pm1dot0_topic[] = "pm1dot0";
  215. PROGMEM const char magnitude_pm2dot5_topic[] = "pm2dot5";
  216. PROGMEM const char magnitude_pm10_topic[] = "pm10";
  217. PROGMEM const char magnitude_co2_topic[] = "co2";
  218. PROGMEM const char magnitude_lux_topic[] = "lux";
  219. PROGMEM const char magnitude_uv_topic[] = "uv";
  220. PROGMEM const char magnitude_distance_topic[] = "distance";
  221. PROGMEM const char magnitude_hcho_topic[] = "hcho";
  222. PROGMEM const char magnitude_geiger_cpm_topic[] = "ldr_cpm"; // local dose rate [Counts per minute]
  223. PROGMEM const char magnitude_geiger_sv_topic[] = "ldr_uSvh"; // local dose rate [µSievert per hour]
  224. PROGMEM const char* const magnitude_topics[] = {
  225. magnitude_unknown_topic, magnitude_temperature_topic, magnitude_humidity_topic,
  226. magnitude_pressure_topic, magnitude_current_topic, magnitude_voltage_topic,
  227. magnitude_active_power_topic, magnitude_apparent_power_topic, magnitude_reactive_power_topic,
  228. magnitude_power_factor_topic, magnitude_energy_topic, magnitude_energy_delta_topic,
  229. magnitude_analog_topic, magnitude_digital_topic, magnitude_events_topic,
  230. magnitude_pm1dot0_topic, magnitude_pm2dot5_topic, magnitude_pm10_topic,
  231. magnitude_co2_topic, magnitude_lux_topic, magnitude_uv_topic,
  232. magnitude_distance_topic, magnitude_hcho_topic,
  233. magnitude_geiger_cpm_topic, magnitude_geiger_sv_topic // Geiger Counter topics
  234. };
  235. PROGMEM const char magnitude_empty[] = "";
  236. PROGMEM const char magnitude_celsius[] = "°C";
  237. PROGMEM const char magnitude_fahrenheit[] = "°F";
  238. PROGMEM const char magnitude_percentage[] = "%";
  239. PROGMEM const char magnitude_hectopascals[] = "hPa";
  240. PROGMEM const char magnitude_amperes[] = "A";
  241. PROGMEM const char magnitude_volts[] = "V";
  242. PROGMEM const char magnitude_watts[] = "W";
  243. PROGMEM const char magnitude_kw[] = "kW";
  244. PROGMEM const char magnitude_joules[] = "J";
  245. PROGMEM const char magnitude_kwh[] = "kWh";
  246. PROGMEM const char magnitude_ugm3[] = "µg/m³";
  247. PROGMEM const char magnitude_ppm[] = "ppm";
  248. PROGMEM const char magnitude_lux[] = "lux";
  249. PROGMEM const char magnitude_uv[] = "uv";
  250. PROGMEM const char magnitude_distance[] = "m";
  251. PROGMEM const char magnitude_mgm3[] = "mg/m³";
  252. PROGMEM const char magnitude_geiger_cpm[] = "cpm"; // Counts per Minute: Unit of local dose rate (Geiger counting)
  253. PROGMEM const char magnitude_geiger_sv[] = "µSv/h"; // µSievert per hour: 2nd unit of local dose rate (Geiger counting)
  254. PROGMEM const char* const magnitude_units[] = {
  255. magnitude_empty, magnitude_celsius, magnitude_percentage,
  256. magnitude_hectopascals, magnitude_amperes, magnitude_volts,
  257. magnitude_watts, magnitude_watts, magnitude_watts,
  258. magnitude_percentage, magnitude_joules, magnitude_joules,
  259. magnitude_empty, magnitude_empty, magnitude_empty,
  260. magnitude_ugm3, magnitude_ugm3, magnitude_ugm3,
  261. magnitude_ppm, magnitude_lux, magnitude_uv,
  262. magnitude_distance, magnitude_mgm3,
  263. magnitude_geiger_cpm, magnitude_geiger_sv // Geiger counter units
  264. };
  265. #endif