Skip to content

Commit

Permalink
system time and outdoor temperature added
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhu- committed Feb 8, 2025
1 parent 3f86c55 commit 67a5a58
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <ArduinoJson.h>

#include <sstream>

#include "bus.hpp"
#include "mqtt.hpp"

Expand Down Expand Up @@ -276,6 +278,29 @@ void Schedule::processPassive(const std::vector<uint8_t> &master,
}
}

if (master[2] == 0x07 && master[3] == 0x00) {
std::string topic = "ebus/system/time";
std::string payload = "20";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 13, 1));
payload += "-";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 11, 1));
payload += "-";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 10, 1));
payload += " ";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 9, 1));
payload += ":";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 8, 1));
payload += ":";
payload += ebus::Sequence::to_string(ebus::Sequence::range(master, 7, 1));
mqttClient.publish(topic.c_str(), 0, true, payload.c_str());

topic = "ebus/system/outdoor";
std::ostringstream ostr;
ostr << ebus::byte_2_data2b(ebus::Sequence::range(master, 5, 2));
ostr << " °C";
mqttClient.publish(topic.c_str(), 0, true, ostr.str().c_str());
}

Command *pasCommand = store.findPassiveCommand(master);
if (pasCommand != nullptr) {
if (pasCommand->master)
Expand Down

0 comments on commit 67a5a58

Please sign in to comment.