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.

391 lines
11 KiB

6 years ago
  1. //--------------------------------------------------------------------------------
  2. // PROGMEM definitions
  3. //--------------------------------------------------------------------------------
  4. //--------------------------------------------------------------------------------
  5. // Various strings
  6. //--------------------------------------------------------------------------------
  7. PROGMEM const char pstr_unknown[] = "UNKNOWN";
  8. //--------------------------------------------------------------------------------
  9. // Reset reasons
  10. //--------------------------------------------------------------------------------
  11. PROGMEM const char custom_reset_hardware[] = "Hardware button";
  12. PROGMEM const char custom_reset_web[] = "Reboot from web interface";
  13. PROGMEM const char custom_reset_terminal[] = "Reboot from terminal";
  14. PROGMEM const char custom_reset_mqtt[] = "Reboot from MQTT";
  15. PROGMEM const char custom_reset_rpc[] = "Reboot from RPC";
  16. PROGMEM const char custom_reset_ota[] = "Reboot after successful OTA update";
  17. PROGMEM const char custom_reset_http[] = "Reboot from HTTP";
  18. PROGMEM const char custom_reset_nofuss[] = "Reboot after successful NoFUSS update";
  19. PROGMEM const char custom_reset_upgrade[] = "Reboot after successful web update";
  20. PROGMEM const char custom_reset_factory[] = "Factory reset";
  21. PROGMEM const char* const custom_reset_string[] = {
  22. custom_reset_hardware, custom_reset_web, custom_reset_terminal,
  23. custom_reset_mqtt, custom_reset_rpc, custom_reset_ota,
  24. custom_reset_http, custom_reset_nofuss, custom_reset_upgrade,
  25. custom_reset_factory
  26. };
  27. //--------------------------------------------------------------------------------
  28. // Capabilities
  29. //--------------------------------------------------------------------------------
  30. PROGMEM const char espurna_modules[] =
  31. #if ALEXA_SUPPORT
  32. "ALEXA "
  33. #endif
  34. #if API_SUPPORT
  35. "API "
  36. #endif
  37. #if BROKER_SUPPORT
  38. "BROKER "
  39. #endif
  40. #if BUTTON_SUPPORT
  41. "BUTTON "
  42. #endif
  43. #if DEBUG_SERIAL_SUPPORT
  44. "DEBUG_SERIAL "
  45. #endif
  46. #if DEBUG_TELNET_SUPPORT
  47. "DEBUG_TELNET "
  48. #endif
  49. #if DEBUG_UDP_SUPPORT
  50. "DEBUG_UDP "
  51. #endif
  52. #if DEBUG_WEB_SUPPORT
  53. "DEBUG_WEB "
  54. #endif
  55. #if DOMOTICZ_SUPPORT
  56. "DOMOTICZ "
  57. #endif
  58. #if ENCODER_SUPPORT
  59. "ENCODER "
  60. #endif
  61. #if HOMEASSISTANT_SUPPORT
  62. "HOMEASSISTANT "
  63. #endif
  64. #if I2C_SUPPORT
  65. "I2C "
  66. #endif
  67. #if INFLUXDB_SUPPORT
  68. "INFLUXDB "
  69. #endif
  70. #if IR_SUPPORT
  71. "IR "
  72. #endif
  73. #if LED_SUPPORT
  74. "LED "
  75. #endif
  76. #if LLMNR_SUPPORT
  77. "LLMNR "
  78. #endif
  79. #if MDNS_CLIENT_SUPPORT
  80. "MDNS_CLIENT "
  81. #endif
  82. #if MDNS_SERVER_SUPPORT
  83. "MDNS_SERVER "
  84. #endif
  85. #if MQTT_SUPPORT
  86. "MQTT "
  87. #endif
  88. #if NETBIOS_SUPPORT
  89. "NETBIOS "
  90. #endif
  91. #if NOFUSS_SUPPORT
  92. "NOFUSS "
  93. #endif
  94. #if NTP_SUPPORT
  95. "NTP "
  96. #endif
  97. #if RFM69_SUPPORT
  98. "RFM69 "
  99. #endif
  100. #if RF_SUPPORT
  101. "RF "
  102. #endif
  103. #if SCHEDULER_SUPPORT
  104. "SCHEDULER "
  105. #endif
  106. #if SENSOR_SUPPORT
  107. "SENSOR "
  108. #endif
  109. #if SPIFFS_SUPPORT
  110. "SPIFFS "
  111. #endif
  112. #if SSDP_SUPPORT
  113. "SSDP "
  114. #endif
  115. #if TELNET_SUPPORT
  116. "TELNET "
  117. #endif
  118. #if TERMINAL_SUPPORT
  119. "TERMINAL "
  120. #endif
  121. #if THERMOSTAT_SUPPORT
  122. "THERMOSTAT "
  123. #endif
  124. #if THERMOSTAT_DISPLAY_SUPPORT
  125. "THERMOSTAT_DISPLAY "
  126. #endif
  127. #if THINGSPEAK_SUPPORT
  128. "THINGSPEAK "
  129. #endif
  130. #if UART_MQTT_SUPPORT
  131. "UART_MQTT "
  132. #endif
  133. #if WEB_SUPPORT
  134. "WEB "
  135. #endif
  136. "";
  137. PROGMEM const char espurna_ota_modules[] =
  138. #if OTA_ARDUINOOTA_SUPPORT
  139. "ARDUINO "
  140. #endif
  141. #if (OTA_CLIENT == OTA_CLIENT_ASYNCTCP)
  142. "ASYNCTCP "
  143. #endif
  144. #if (OTA_CLIENT == OTA_CLIENT_HTTPUPDATE)
  145. #if (SECURE_CLIENT == SECURE_CLIENT_NONE)
  146. "*HTTPUPDATE "
  147. #endif
  148. #if (SECURE_CLIENT == SECURE_CLIENT_AXTLS)
  149. "*HTTPUPDATE_AXTLS "
  150. #endif
  151. #if (SECURE_CLIENT == SECURE_CLIENT_BEARSSL)
  152. "*HTTPUPDATE_BEARSSL "
  153. #endif
  154. #endif // OTA_CLIENT_HTTPUPDATE
  155. #if OTA_MQTT_SUPPORT
  156. "MQTT "
  157. #endif
  158. #if WEB_SUPPORT
  159. "WEB "
  160. #endif
  161. "";
  162. //--------------------------------------------------------------------------------
  163. // Sensors
  164. //--------------------------------------------------------------------------------
  165. #if SENSOR_SUPPORT
  166. PROGMEM const char espurna_sensors[] =
  167. #if AM2320_SUPPORT
  168. "AM2320_I2C "
  169. #endif
  170. #if ANALOG_SUPPORT
  171. "ANALOG "
  172. #endif
  173. #if BH1750_SUPPORT
  174. "BH1750 "
  175. #endif
  176. #if BMP180_SUPPORT
  177. "BMP180 "
  178. #endif
  179. #if BMX280_SUPPORT
  180. "BMX280 "
  181. #endif
  182. #if CSE7766_SUPPORT
  183. "CSE7766 "
  184. #endif
  185. #if DALLAS_SUPPORT
  186. "DALLAS "
  187. #endif
  188. #if DHT_SUPPORT
  189. "DHTXX "
  190. #endif
  191. #if DIGITAL_SUPPORT
  192. "DIGITAL "
  193. #endif
  194. #if ECH1560_SUPPORT
  195. "ECH1560 "
  196. #endif
  197. #if EMON_ADC121_SUPPORT
  198. "EMON_ADC121 "
  199. #endif
  200. #if EMON_ADS1X15_SUPPORT
  201. "EMON_ADX1X15 "
  202. #endif
  203. #if EMON_ANALOG_SUPPORT
  204. "EMON_ANALOG "
  205. #endif
  206. #if EVENTS_SUPPORT
  207. "EVENTS "
  208. #endif
  209. #if GEIGER_SUPPORT
  210. "GEIGER "
  211. #endif
  212. #if GUVAS12SD_SUPPORT
  213. "GUVAS12SD "
  214. #endif
  215. #if HLW8012_SUPPORT
  216. "HLW8012 "
  217. #endif
  218. #if LDR_SUPPORT
  219. "LDR "
  220. #endif
  221. #if MHZ19_SUPPORT
  222. "MHZ19 "
  223. #endif
  224. #if MICS2710_SUPPORT
  225. "MICS2710 "
  226. #endif
  227. #if MICS5525_SUPPORT
  228. "MICS5525 "
  229. #endif
  230. #if NTC_SUPPORT
  231. "NTC "
  232. #endif
  233. #if PMSX003_SUPPORT
  234. "PMSX003 "
  235. #endif
  236. #if PULSEMETER_SUPPORT
  237. "PULSEMETER "
  238. #endif
  239. #if PZEM004T_SUPPORT
  240. "PZEM004T "
  241. #endif
  242. #if SDS011_SUPPORT
  243. "SDS011 "
  244. #endif
  245. #if SENSEAIR_SUPPORT
  246. "SENSEAIR "
  247. #endif
  248. #if SHT3X_I2C_SUPPORT
  249. "SHT3X_I2C "
  250. #endif
  251. #if SI7021_SUPPORT
  252. "SI7021 "
  253. #endif
  254. #if SONAR_SUPPORT
  255. "SONAR "
  256. #endif
  257. #if T6613_SUPPORT
  258. "T6613 "
  259. #endif
  260. #if TMP3X_SUPPORT
  261. "TMP3X "
  262. #endif
  263. #if V9261F_SUPPORT
  264. "V9261F "
  265. #endif
  266. #if VEML6075_SUPPORT
  267. "VEML6075 "
  268. #endif
  269. #if VL53L1X_SUPPORT
  270. "VL53L1X "
  271. #endif
  272. #if EZOPH_SUPPORT
  273. "EZOPH "
  274. #endif
  275. #if ADE7953_SUPPORT
  276. "ADE7953 "
  277. #endif
  278. "";
  279. PROGMEM const unsigned char magnitude_decimals[] = {
  280. 0,
  281. 1, 0, 2, // THP
  282. 3, 0, 0, 0, 0, 0, 0, 0, // Power decimals
  283. 0, 0, 0, // analog, digital, event
  284. 0, 0, 0, // PM
  285. 0, 0,
  286. 0, 0, 3, // UVA, UVB, UVI
  287. 3, 0,
  288. 4, 4, // Geiger Counter decimals
  289. 0,
  290. 0, 0, 0, 3 // NO2, CO, Ohms, pH
  291. };
  292. PROGMEM const char magnitude_unknown_topic[] = "unknown";
  293. PROGMEM const char magnitude_temperature_topic[] = "temperature";
  294. PROGMEM const char magnitude_humidity_topic[] = "humidity";
  295. PROGMEM const char magnitude_pressure_topic[] = "pressure";
  296. PROGMEM const char magnitude_current_topic[] = "current";
  297. PROGMEM const char magnitude_voltage_topic[] = "voltage";
  298. PROGMEM const char magnitude_active_power_topic[] = "power";
  299. PROGMEM const char magnitude_apparent_power_topic[] = "apparent";
  300. PROGMEM const char magnitude_reactive_power_topic[] = "reactive";
  301. PROGMEM const char magnitude_power_factor_topic[] = "factor";
  302. PROGMEM const char magnitude_energy_topic[] = "energy";
  303. PROGMEM const char magnitude_energy_delta_topic[] = "energy_delta";
  304. PROGMEM const char magnitude_analog_topic[] = "analog";
  305. PROGMEM const char magnitude_digital_topic[] = "digital";
  306. PROGMEM const char magnitude_event_topic[] = "event";
  307. PROGMEM const char magnitude_pm1dot0_topic[] = "pm1dot0";
  308. PROGMEM const char magnitude_pm2dot5_topic[] = "pm2dot5";
  309. PROGMEM const char magnitude_pm10_topic[] = "pm10";
  310. PROGMEM const char magnitude_co2_topic[] = "co2";
  311. PROGMEM const char magnitude_lux_topic[] = "lux";
  312. PROGMEM const char magnitude_uva_topic[] = "uva";
  313. PROGMEM const char magnitude_uvb_topic[] = "uvb";
  314. PROGMEM const char magnitude_uvi_topic[] = "uvi";
  315. PROGMEM const char magnitude_distance_topic[] = "distance";
  316. PROGMEM const char magnitude_hcho_topic[] = "hcho";
  317. PROGMEM const char magnitude_geiger_cpm_topic[] = "ldr_cpm"; // local dose rate [Counts per minute]
  318. PROGMEM const char magnitude_geiger_sv_topic[] = "ldr_uSvh"; // local dose rate [µSievert per hour]
  319. PROGMEM const char magnitude_count_topic[] = "count";
  320. PROGMEM const char magnitude_no2_topic[] = "no2";
  321. PROGMEM const char magnitude_co_topic[] = "co";
  322. PROGMEM const char magnitude_resistance_topic[] = "resistance";
  323. PROGMEM const char magnitude_ph_topic[] = "ph";
  324. PROGMEM const char* const magnitude_topics[] = {
  325. magnitude_unknown_topic, magnitude_temperature_topic, magnitude_humidity_topic,
  326. magnitude_pressure_topic, magnitude_current_topic, magnitude_voltage_topic,
  327. magnitude_active_power_topic, magnitude_apparent_power_topic, magnitude_reactive_power_topic,
  328. magnitude_power_factor_topic, magnitude_energy_topic, magnitude_energy_delta_topic,
  329. magnitude_analog_topic, magnitude_digital_topic, magnitude_event_topic,
  330. magnitude_pm1dot0_topic, magnitude_pm2dot5_topic, magnitude_pm10_topic,
  331. magnitude_co2_topic, magnitude_lux_topic,
  332. magnitude_uva_topic, magnitude_uvb_topic, magnitude_uvi_topic,
  333. magnitude_distance_topic, magnitude_hcho_topic,
  334. magnitude_geiger_cpm_topic, magnitude_geiger_sv_topic,
  335. magnitude_count_topic,
  336. magnitude_no2_topic, magnitude_co_topic, magnitude_resistance_topic, magnitude_ph_topic
  337. };
  338. PROGMEM const char magnitude_empty[] = "";
  339. PROGMEM const char magnitude_celsius[] = "°C";
  340. PROGMEM const char magnitude_fahrenheit[] = "°F";
  341. PROGMEM const char magnitude_percentage[] = "%";
  342. PROGMEM const char magnitude_hectopascals[] = "hPa";
  343. PROGMEM const char magnitude_amperes[] = "A";
  344. PROGMEM const char magnitude_volts[] = "V";
  345. PROGMEM const char magnitude_watts[] = "W";
  346. PROGMEM const char magnitude_kw[] = "kW";
  347. PROGMEM const char magnitude_joules[] = "J";
  348. PROGMEM const char magnitude_kwh[] = "kWh";
  349. PROGMEM const char magnitude_ugm3[] = "µg/m³";
  350. PROGMEM const char magnitude_ppm[] = "ppm";
  351. PROGMEM const char magnitude_lux[] = "lux";
  352. PROGMEM const char magnitude_distance[] = "m";
  353. PROGMEM const char magnitude_mgm3[] = "mg/m³";
  354. PROGMEM const char magnitude_geiger_cpm[] = "cpm"; // Counts per Minute: Unit of local dose rate (Geiger counting)
  355. PROGMEM const char magnitude_geiger_sv[] = "µSv/h"; // µSievert per hour: 2nd unit of local dose rate (Geiger counting)
  356. PROGMEM const char magnitude_resistance[] = "ohm";
  357. PROGMEM const char* const magnitude_units[] = {
  358. magnitude_empty, magnitude_celsius, magnitude_percentage,
  359. magnitude_hectopascals, magnitude_amperes, magnitude_volts,
  360. magnitude_watts, magnitude_watts, magnitude_watts,
  361. magnitude_percentage, magnitude_joules, magnitude_joules,
  362. magnitude_empty, magnitude_empty, magnitude_empty,
  363. magnitude_ugm3, magnitude_ugm3, magnitude_ugm3,
  364. magnitude_ppm, magnitude_lux,
  365. magnitude_empty, magnitude_empty, magnitude_empty,
  366. magnitude_distance, magnitude_mgm3,
  367. magnitude_geiger_cpm, magnitude_geiger_sv, // Geiger counter units
  368. magnitude_empty, //
  369. magnitude_ppm, magnitude_ppm, // NO2 & CO2
  370. magnitude_resistance,
  371. magnitude_empty // pH
  372. };
  373. #endif