Skip to content

Commit d098724

Browse files
committed
room temp
1 parent 313c4ce commit d098724

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

main/main.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ void analog_read() {
3535
wifi_mqtt_client.publish(getTopicString(TOPIC_PH_VOLTAGE), ph_voltage);
3636
}
3737

38-
if (isTopicEnabled(TOPIC_ROOM_TEMPERATURE)) {
38+
if (isTopicEnabled(TOPIC_TEMPERATURE)) {
3939
float room_temperature = aht10_helper.read_temperature();
40-
wifi_mqtt_client.publish(getTopicString(TOPIC_ROOM_TEMPERATURE), room_temperature);
40+
wifi_mqtt_client.publish(getTopicString(TOPIC_TEMPERATURE), room_temperature);
4141

4242
if (isTopicEnabled(TOPIC_EC)) {
4343
float ec = tds_helper.analog_read(room_temperature);

main/topic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum Topic {
1717
TOPIC_PH_VOLTAGE,
1818
TOPIC_EC,
1919
TOPIC_HUMIDITY,
20-
TOPIC_ROOM_TEMPERATURE,
20+
TOPIC_TEMPERATURE,
2121
TOPIC_FLOATER,
2222
TOPIC_ENABLE,
2323
TOPIC_DISABLE,

main/topic.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const char* all_topics[TOPIC_COUNT] = {
1212
"sensors/ph_voltage",
1313
"sensors/ec",
1414
"sensors/humidity",
15-
"sensors/room_temperature",
15+
"sensors/temperature",
1616
"sensors/floater",
1717
"sensors/enable",
1818
"sensors/disable"
@@ -29,7 +29,7 @@ std::map<Topic, Status> topic_map = {
2929
{TOPIC_PH_VOLTAGE, ON},
3030
{TOPIC_EC, ON},
3131
{TOPIC_HUMIDITY, ON},
32-
{TOPIC_ROOM_TEMPERATURE, ON},
32+
{TOPIC_TEMPERATURE, ON},
3333
{TOPIC_FLOATER, ON},
3434
{TOPIC_ENABLE, ON},
3535
{TOPIC_DISABLE, ON},

main/wifi_mqtt_client.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ struct DeviceState {
77
unsigned long duration;
88
};
99

10-
DeviceState waterPump = {false, 0, 10000}; // 10 seconds for water
11-
DeviceState nutesPump = {false, 0, 6000}; // 6 seconds for nutrients
12-
DeviceState acidPump = {false, 0, 15000}; // 15 seconds for acid
13-
DeviceState basePump = {false, 0, 15000}; // 15 seconds for base
10+
DeviceState waterPump = {false, 0, 4000}; // 4 seconds for water
11+
DeviceState nutesPump = {false, 0, 4000}; // 4 seconds for nutrients
12+
DeviceState acidPump = {false, 0, 4000}; // 4 seconds for acid
13+
DeviceState basePump = {false, 0, 4000}; // 4 seconds for base
1414

1515
char device_id[40];
1616

@@ -161,5 +161,5 @@ void WiFiAndMQTTClient::publish(const char* topic, float value) {
161161
snprintf(print_msg, 100, "--- publishing message in topic %s ---", topic_with_device_id);
162162
Serial.println(print_msg);
163163
Serial.println(msg);
164-
(*wmm).client->publish(MQTT::Publish(topic_with_device_id, msg).set_qos(1));
164+
(*wmm).client->publish(topic_with_device_id, msg);
165165
}

0 commit comments

Comments
 (0)