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.

382 lines
11 KiB

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