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.

302 lines
8.9 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 HOMEASSISTANT_SUPPORT
  55. "HOMEASSISTANT "
  56. #endif
  57. #if I2C_SUPPORT
  58. "I2C "
  59. #endif
  60. #if INFLUXDB_SUPPORT
  61. "INFLUXDB "
  62. #endif
  63. #if IR_SUPPORT
  64. "IR "
  65. #endif
  66. #if LED_SUPPORT
  67. "LED "
  68. #endif
  69. #if LLMNR_SUPPORT
  70. "LLMNR "
  71. #endif
  72. #if MDNS_CLIENT_SUPPORT
  73. "MDNS_CLIENT "
  74. #endif
  75. #if MDNS_SERVER_SUPPORT
  76. "MDNS_SERVER "
  77. #endif
  78. #if MQTT_SUPPORT
  79. "MQTT "
  80. #endif
  81. #if NETBIOS_SUPPORT
  82. "NETBIOS "
  83. #endif
  84. #if NOFUSS_SUPPORT
  85. "NOFUSS "
  86. #endif
  87. #if NTP_SUPPORT
  88. "NTP "
  89. #endif
  90. #if RFM69_SUPPORT
  91. "RFM69 "
  92. #endif
  93. #if RF_SUPPORT
  94. "RF "
  95. #endif
  96. #if SCHEDULER_SUPPORT
  97. "SCHEDULER "
  98. #endif
  99. #if SENSOR_SUPPORT
  100. "SENSOR "
  101. #endif
  102. #if SPIFFS_SUPPORT
  103. "SPIFFS "
  104. #endif
  105. #if SSDP_SUPPORT
  106. "SSDP "
  107. #endif
  108. #if TELNET_SUPPORT
  109. "TELNET "
  110. #endif
  111. #if TERMINAL_SUPPORT
  112. "TERMINAL "
  113. #endif
  114. #if THINGSPEAK_SUPPORT
  115. "THINGSPEAK "
  116. #endif
  117. #if UART_MQTT_SUPPORT
  118. "UART_MQTT "
  119. #endif
  120. #if WEB_SUPPORT
  121. "WEB "
  122. #endif
  123. "";
  124. //--------------------------------------------------------------------------------
  125. // Sensors
  126. //--------------------------------------------------------------------------------
  127. #if SENSOR_SUPPORT
  128. PROGMEM const char espurna_sensors[] =
  129. #if AM2320_SUPPORT
  130. "AM2320_I2C "
  131. #endif
  132. #if ANALOG_SUPPORT
  133. "ANALOG "
  134. #endif
  135. #if BH1750_SUPPORT
  136. "BH1750 "
  137. #endif
  138. #if BMX280_SUPPORT
  139. "BMX280 "
  140. #endif
  141. #if CSE7766_SUPPORT
  142. "CSE7766 "
  143. #endif
  144. #if DALLAS_SUPPORT
  145. "DALLAS "
  146. #endif
  147. #if DHT_SUPPORT
  148. "DHTXX "
  149. #endif
  150. #if DIGITAL_SUPPORT
  151. "DIGITAL "
  152. #endif
  153. #if ECH1560_SUPPORT
  154. "ECH1560 "
  155. #endif
  156. #if EMON_ADC121_SUPPORT
  157. "EMON_ADC121 "
  158. #endif
  159. #if EMON_ADS1X15_SUPPORT
  160. "EMON_ADX1X15 "
  161. #endif
  162. #if EMON_ANALOG_SUPPORT
  163. "EMON_ANALOG "
  164. #endif
  165. #if EVENTS_SUPPORT
  166. "EVENTS "
  167. #endif
  168. #if GEIGER_SUPPORT
  169. "GEIGER "
  170. #endif
  171. #if GUVAS12SD_SUPPORT
  172. "GUVAS12SD "
  173. #endif
  174. #if HLW8012_SUPPORT
  175. "HLW8012 "
  176. #endif
  177. #if MHZ19_SUPPORT
  178. "MHZ19 "
  179. #endif
  180. #if NTC_SUPPORT
  181. "NTC "
  182. #endif
  183. #if PMSX003_SUPPORT
  184. "PMSX003 "
  185. #endif
  186. #if PZEM004T_SUPPORT
  187. "PZEM004T "
  188. #endif
  189. #if SENSEAIR_SUPPORT
  190. "SENSEAIR "
  191. #endif
  192. #if SHT3X_I2C_SUPPORT
  193. "SHT3X_I2C "
  194. #endif
  195. #if SI7021_SUPPORT
  196. "SI7021 "
  197. #endif
  198. #if SONAR_SUPPORT
  199. "SONAR "
  200. #endif
  201. #if TMP3X_SUPPORT
  202. "TMP3X "
  203. #endif
  204. #if V9261F_SUPPORT
  205. "V9261F "
  206. #endif
  207. "";
  208. PROGMEM const unsigned char magnitude_decimals[] = {
  209. 0,
  210. 1, 0, 2, // THP
  211. 3, 0, 0, 0, 0, 0, 0, 0, // Power decimals
  212. 0, 0, 0, // analog, digital, event
  213. 0, 0, 0, // PM
  214. 0, 0, 3, 3, 0,
  215. 4, 4, // Geiger Counter decimals
  216. 0
  217. };
  218. PROGMEM const char magnitude_unknown_topic[] = "unknown";
  219. PROGMEM const char magnitude_temperature_topic[] = "temperature";
  220. PROGMEM const char magnitude_humidity_topic[] = "humidity";
  221. PROGMEM const char magnitude_pressure_topic[] = "pressure";
  222. PROGMEM const char magnitude_current_topic[] = "current";
  223. PROGMEM const char magnitude_voltage_topic[] = "voltage";
  224. PROGMEM const char magnitude_active_power_topic[] = "power";
  225. PROGMEM const char magnitude_apparent_power_topic[] = "apparent";
  226. PROGMEM const char magnitude_reactive_power_topic[] = "reactive";
  227. PROGMEM const char magnitude_power_factor_topic[] = "factor";
  228. PROGMEM const char magnitude_energy_topic[] = "energy";
  229. PROGMEM const char magnitude_energy_delta_topic[] = "energy_delta";
  230. PROGMEM const char magnitude_analog_topic[] = "analog";
  231. PROGMEM const char magnitude_digital_topic[] = "digital";
  232. PROGMEM const char magnitude_event_topic[] = "event";
  233. PROGMEM const char magnitude_pm1dot0_topic[] = "pm1dot0";
  234. PROGMEM const char magnitude_pm2dot5_topic[] = "pm2dot5";
  235. PROGMEM const char magnitude_pm10_topic[] = "pm10";
  236. PROGMEM const char magnitude_co2_topic[] = "co2";
  237. PROGMEM const char magnitude_lux_topic[] = "lux";
  238. PROGMEM const char magnitude_uv_topic[] = "uv";
  239. PROGMEM const char magnitude_distance_topic[] = "distance";
  240. PROGMEM const char magnitude_hcho_topic[] = "hcho";
  241. PROGMEM const char magnitude_geiger_cpm_topic[] = "ldr_cpm"; // local dose rate [Counts per minute]
  242. PROGMEM const char magnitude_geiger_sv_topic[] = "ldr_uSvh"; // local dose rate [µSievert per hour]
  243. PROGMEM const char magnitude_count_topic[] = "count";
  244. PROGMEM const char* const magnitude_topics[] = {
  245. magnitude_unknown_topic, magnitude_temperature_topic, magnitude_humidity_topic,
  246. magnitude_pressure_topic, magnitude_current_topic, magnitude_voltage_topic,
  247. magnitude_active_power_topic, magnitude_apparent_power_topic, magnitude_reactive_power_topic,
  248. magnitude_power_factor_topic, magnitude_energy_topic, magnitude_energy_delta_topic,
  249. magnitude_analog_topic, magnitude_digital_topic, magnitude_event_topic,
  250. magnitude_pm1dot0_topic, magnitude_pm2dot5_topic, magnitude_pm10_topic,
  251. magnitude_co2_topic, magnitude_lux_topic, magnitude_uv_topic,
  252. magnitude_distance_topic, magnitude_hcho_topic,
  253. magnitude_geiger_cpm_topic, magnitude_geiger_sv_topic,
  254. magnitude_count_topic
  255. };
  256. PROGMEM const char magnitude_empty[] = "";
  257. PROGMEM const char magnitude_celsius[] = "°C";
  258. PROGMEM const char magnitude_fahrenheit[] = "°F";
  259. PROGMEM const char magnitude_percentage[] = "%";
  260. PROGMEM const char magnitude_hectopascals[] = "hPa";
  261. PROGMEM const char magnitude_amperes[] = "A";
  262. PROGMEM const char magnitude_volts[] = "V";
  263. PROGMEM const char magnitude_watts[] = "W";
  264. PROGMEM const char magnitude_kw[] = "kW";
  265. PROGMEM const char magnitude_joules[] = "J";
  266. PROGMEM const char magnitude_kwh[] = "kWh";
  267. PROGMEM const char magnitude_ugm3[] = "µg/m³";
  268. PROGMEM const char magnitude_ppm[] = "ppm";
  269. PROGMEM const char magnitude_lux[] = "lux";
  270. PROGMEM const char magnitude_uv[] = "uv";
  271. PROGMEM const char magnitude_distance[] = "m";
  272. PROGMEM const char magnitude_mgm3[] = "mg/m³";
  273. PROGMEM const char magnitude_geiger_cpm[] = "cpm"; // Counts per Minute: Unit of local dose rate (Geiger counting)
  274. PROGMEM const char magnitude_geiger_sv[] = "µSv/h"; // µSievert per hour: 2nd unit of local dose rate (Geiger counting)
  275. PROGMEM const char* const magnitude_units[] = {
  276. magnitude_empty, magnitude_celsius, magnitude_percentage,
  277. magnitude_hectopascals, magnitude_amperes, magnitude_volts,
  278. magnitude_watts, magnitude_watts, magnitude_watts,
  279. magnitude_percentage, magnitude_joules, magnitude_joules,
  280. magnitude_empty, magnitude_empty, magnitude_empty,
  281. magnitude_ugm3, magnitude_ugm3, magnitude_ugm3,
  282. magnitude_ppm, magnitude_lux, magnitude_uv,
  283. magnitude_distance, magnitude_mgm3,
  284. magnitude_geiger_cpm, magnitude_geiger_sv, // Geiger counter units
  285. magnitude_empty
  286. };
  287. #endif