2020-11-06 22:19:16 +01:00
/** \addtogroup Homie
* @ {
*
2020-10-16 15:03:51 +02:00
* @ file HomieConfiguration . h
* @ author your name ( you @ domain . com )
* @ brief
* @ version 0.1
* @ date 2020 - 10 - 16
*
* @ copyright Copyright ( c ) 2020
* All Settings , configurable in Homie
2020-11-06 22:19:16 +01:00
*
2020-10-16 15:03:51 +02:00
*/
# ifndef HOMIE_PLANT_CONFIG_H
# define HOMIE_PLANT_CONFIG_H
2020-10-16 16:22:48 +02:00
# include "HomieTypes.h"
# define MAX_PLANTS 7
2020-10-16 15:03:51 +02:00
/**
2020-11-06 22:19:16 +01:00
* @ name Attributes
* generated Information
* @ {
* */
2020-10-16 15:03:51 +02:00
2020-11-06 22:19:16 +01:00
HomieNode plant0 ( " plant0 " , " Plant 0 " , " Plant " ) ; /**< dynamic Homie information for first plant */
HomieNode plant1 ( " plant1 " , " Plant 1 " , " Plant " ) ; /**< dynamic Homie information for second plant */
HomieNode plant2 ( " plant2 " , " Plant 2 " , " Plant " ) ; /**< dynamic Homie information for first plant */
HomieNode plant3 ( " plant3 " , " Plant 3 " , " Plant " ) ; /**< dynamic Homie information for first plant */
HomieNode plant4 ( " plant4 " , " Plant 4 " , " Plant " ) ; /**< dynamic Homie information for first plant */
HomieNode plant5 ( " plant5 " , " Plant 5 " , " Plant " ) ; /**< dynamic Homie information for first plant */
HomieNode plant6 ( " plant6 " , " Plant 6 " , " Plant " ) ; /**< dynamic Homie information for first plant */
2020-10-16 15:03:51 +02:00
HomieNode sensorLipo ( " lipo " , " Battery Status " , " Lipo " ) ;
HomieNode sensorSolar ( " solar " , " Solar Status " , " Solarpanel " ) ;
HomieNode sensorWater ( " water " , " WaterSensor " , " Water " ) ;
HomieNode sensorTemp ( " temperature " , " Temperature " , " temperature " ) ;
HomieNode stayAlive ( " stay " , " alive " , " alive " ) ;
2020-11-06 22:19:16 +01:00
/* @} */
2020-10-16 15:03:51 +02:00
/**
2020-11-06 22:19:16 +01:00
* @ name Settings
* General settings for the controller
* @ {
2020-10-16 15:03:51 +02:00
*/
2020-11-04 23:28:08 +01:00
HomieSetting < long > maxTimeBetweenMQTTUpdates ( " mqttSleep " , " time in seconds to start into mode2 " ) ;
2020-10-31 12:44:32 +01:00
HomieSetting < long > deepSleepTime ( " deepsleep " , " time in seconds to sleep (0 deactivats it) " ) ;
HomieSetting < long > deepSleepNightTime ( " nightsleep " , " time in seconds to sleep (0 uses same setting: deepsleep at night, too) " ) ;
2020-10-16 15:03:51 +02:00
HomieSetting < long > wateringDeepSleep ( " pumpdeepsleep " , " time seconds to sleep, while a pump is running " ) ;
2020-10-16 18:40:39 +02:00
HomieSetting < long > waterLevelMax ( " watermaxlevel " , " distance (mm) at maximum water level " ) ;
HomieSetting < long > waterLevelMin ( " waterminlevel " , " distance (mm) at minimum water level (pumps still covered) " ) ;
HomieSetting < long > waterLevelWarn ( " waterlevelwarn " , " warn (mm) if below this water level % " ) ;
HomieSetting < long > waterLevelVol ( " waterVolume " , " (ml) between minimum and maximum " ) ;
2020-11-04 21:57:40 +01:00
HomieSetting < const char * > ntpServer ( " ntpServer " , " NTP server (pool.ntp.org as default) " ) ;
2020-10-16 15:03:51 +02:00
2020-11-06 22:19:16 +01:00
/**
* @ }
*/
/**
* @ name Plant specific ones
* Setting for one plant
* @ {
* */
2020-10-16 15:03:51 +02:00
2020-11-04 21:57:40 +01:00
# define GENERATE_PLANT(plant, strplant) \
HomieSetting < long > mSensorDry # # plant = HomieSetting < long > ( " moistdry " strplant , " Plant " strplant " - Moist sensor dry threshold " ) ; \
HomieSetting < long > mPumpAllowedHourRangeStart # # plant = HomieSetting < long > ( " rangehourstart " strplant , " Plant " strplant " - Range pump allowed hour start (0-23) " ) ; \
HomieSetting < long > mPumpAllowedHourRangeEnd # # plant = HomieSetting < long > ( " rangehourend " strplant , " Plant " strplant " - Range pump allowed hour end (0-23) " ) ; \
2020-10-16 16:47:36 +02:00
HomieSetting < bool > mPumpOnlyWhenLowLight # # plant = HomieSetting < bool > ( " onlyWhenLowLightZ " strplant , " Plant " strplant " - Enable the Pump only, when there is light but not enought to charge battery " ) ; \
2020-11-04 21:57:40 +01:00
HomieSetting < long > mPumpCooldownInHours # # plant = HomieSetting < long > ( " cooldownpump " strplant , " Plant " strplant " - How long to wait until the pump is activated again (minutes) " ) ; \
PlantSettings_t mSetting # # plant = { & mSensorDry # # plant , & mPumpAllowedHourRangeStart # # plant , & mPumpAllowedHourRangeEnd # # plant , & mPumpOnlyWhenLowLight # # plant , & mPumpCooldownInHours # # plant } ;
2020-11-06 22:19:16 +01:00
/**
* @ }
*/
GENERATE_PLANT ( 0 , " 0 " ) ; /**< Homie settings for first plant */
GENERATE_PLANT ( 1 , " 1 " ) ; /**< Homie settings for second Plant */
GENERATE_PLANT ( 2 , " 2 " ) ; /**< Homie settings for third plant */
GENERATE_PLANT ( 3 , " 3 " ) ; /**< Homie settings for fourth plant */
GENERATE_PLANT ( 4 , " 4 " ) ; /**< Homie settings for fifth plant */
GENERATE_PLANT ( 5 , " 5 " ) ; /**< Homie settings for sixth plant */
GENERATE_PLANT ( 6 , " 6 " ) ; /**< Homie settings for seventh plant */
2020-10-16 16:22:48 +02:00
2020-11-06 22:19:16 +01:00
# endif /* HOMIE_PLANT_CONFIG_H @} */