Skip to content

Commit

Permalink
More dev...
Browse files Browse the repository at this point in the history
(cherry picked from commit 65e4cbe309d1879c6aea476cbd712b08fa9c50d6)
  • Loading branch information
mathieucarbou committed Jul 29, 2024
1 parent e87448f commit d63970c
Show file tree
Hide file tree
Showing 48 changed files with 824 additions and 619 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Changelog
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: github_release
uses: mikepenz/release-changelog-builder-action@v4
uses: mikepenz/release-changelog-builder-action@v5
with:
failOnError: true
commitMode: true
Expand Down
16 changes: 8 additions & 8 deletions data/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ <h1>YaSolR Configuration</h1>

"Output 1 Control": "TITLE",
o1_resistance: ["Output 1 Resistance (Ohm)", "uint"],
o1_dim_limit: ["Dimmer Duty Cycle Limiter (%)", "uint"],
o1_dim_max_t: ["Dimmer Temperature Limiter (stop routing when temperature reached)", "uint"],
o1_dim_limit: ["Dimmer Duty Cycle Limiter (%)", "percent"],
o1_dim_max_t: ["Dimmer Temperature Limiter (stop routing when temperature reached)", "percent"],
o1_excess_ratio: ["Grid Excess Reserved to Output 1. Output 2 will take the remaining. If 100%, Output 2 will be activated only if there is some remaining excess.", "percent"],
o1_ad_enable: ["Dimmer Automatic Control", "switch"],
o1_ab_enable: ["Bypass Automatic Control", "switch"],
Expand All @@ -77,8 +77,8 @@ <h1>YaSolR Configuration</h1>

"Output 2 Control": "TITLE",
o2_resistance: ["Output 2 Resistance (Ohm)", "uint"],
o2_dim_limit: ["Dimmer Duty Cycle Limiter (%)", "uint"],
o2_dim_max_t: ["Dimmer Temperature Limiter (stop routing when temperature reached)", "uint"],
o2_dim_limit: ["Dimmer Duty Cycle Limiter (%)", "percent"],
o2_dim_max_t: ["Dimmer Temperature Limiter (stop routing when temperature reached)", "percent"],
o2_excess_ratio: ["Grid Excess Reserved to Output 2. Output 2 will take the remaining after output 1. If 100%, Output 2 will try to consume 100% of the remaining.", "percent"],
o2_ad_enable: ["Dimmer Automatic Control", "switch"],
o2_ab_enable: ["Bypass Automatic Control", "switch"],
Expand Down Expand Up @@ -164,10 +164,10 @@ <h1>YaSolR Configuration</h1>
o2_relay_type: ["Output 2 Bypass Relay Type", "select", "NO,NC"],
relay1_type: ["Relay 1 Type", "select", "NO,NC"],
relay2_type: ["Relay 2 Type", "select", "NO,NC"],
o1_dim_min: ["Output 1 Dimmer Remap Min (%)", "uint"],
o1_dim_max: ["Output 1 Dimmer Remap Max (%)", "uint"],
o2_dim_min: ["Output 2 Dimmer Remap Min (%)", "uint"],
o2_dim_max: ["Output 2 Dimmer Remap Max (%)", "uint"],
o1_dim_min: ["Output 1 Dimmer Remap Min (%)", "percent"],
o1_dim_max: ["Output 1 Dimmer Remap Max (%)", "percent"],
o2_dim_min: ["Output 2 Dimmer Remap Min (%)", "percent"],
o2_dim_max: ["Output 2 Dimmer Remap Max (%)", "percent"],

"PID Calibration": "TITLE",
pid_view_enable: ["View PID Data", "switch"],
Expand Down
21 changes: 11 additions & 10 deletions include/YaSolR.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down Expand Up @@ -47,7 +47,7 @@
#else
#include <ESPDash.h>
#include <ElegantOTA.h>
#include <WebSerial.h>
#include <MycilaWebSerial.h>
#endif

#include <YaSolRDefines.h>
Expand Down Expand Up @@ -96,9 +96,6 @@ extern Mycila::Task restartTask;
extern Mycila::Task trialTask;
#endif

extern Mycila::TaskManager jsyTaskManager;
extern Mycila::Task jsyTask;

extern Mycila::TaskManager mqttTaskManager;
extern Mycila::Task haDiscoveryTask;
extern Mycila::Task mqttConfigTask;
Expand All @@ -107,19 +104,23 @@ extern Mycila::Task mqttPublishStaticTask;
extern Mycila::Task mqttPublishConfigTask;

extern Mycila::TaskManager pioTaskManager;
extern Mycila::Task calibrationTask;
extern Mycila::Task carouselTask;
extern Mycila::Task displayTask;
extern Mycila::Task ds18Task;
extern Mycila::Task lightsTask;

extern Mycila::TaskManager pzemTaskManager;
extern Mycila::Task pzemO1PairingTask;
extern Mycila::Task pzemO2PairingTask;
extern Mycila::Task pzemTask;

extern Mycila::TaskManager routerTaskManager;
extern Mycila::Task relayTask;
extern Mycila::Task routerTask;

extern Mycila::TaskManager jsyTaskManager;
extern Mycila::Task jsyTask;

extern Mycila::TaskManager pzemTaskManager;
extern Mycila::Task pzemTask;

extern Mycila::TaskManager routingTaskManager;
extern Mycila::Task routingTask;

// Tasks alone without a manager
Expand Down
2 changes: 1 addition & 1 deletion include/YaSolRDefines.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down
25 changes: 11 additions & 14 deletions include/YaSolRWebsite.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

#include <YaSolR.h>

#include <map>

#ifdef APP_MODEL_PRO
#define PUSH_BUTTON_CARD_CB ()
#else
#ifdef APP_MODEL_OSS
#define LINE_CHART BAR_CHART
#define AREA_CHART BAR_CHART
#define ENERGY_CARD GENERIC_CARD
#define PUSH_BUTTON_CARD BUTTON_CARD
#define PUSH_BUTTON_CARD_CB (int32_t value)
#endif

namespace YaSolR {
Expand Down Expand Up @@ -158,10 +154,8 @@ namespace YaSolR {
Card _output2AutoStartWDays = Card(&dashboard, WEEK_SELECTOR_CARD, YASOLR_LBL_069);

Tab _relaysTab = Tab(&dashboard, "\u2600 " YASOLR_LBL_071);
Card _relay1Load = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_072);
Card _relay1Switch = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_073);
Card _relay1SwitchRO = Card(&dashboard, STATUS_CARD, YASOLR_LBL_074);
Card _relay2Load = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_075);
Card _relay2Switch = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_076);
Card _relay2SwitchRO = Card(&dashboard, STATUS_CARD, YASOLR_LBL_077);

Expand Down Expand Up @@ -245,16 +239,19 @@ namespace YaSolR {
Card _displaySpeed = Card(&dashboard, SLIDER_CARD, YASOLR_LBL_142, "s", 1, 10, 1);
Card _displayType = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_143);
Card _displayRotation = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_144);
Card _output1RelayType = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_149);
Card _output2RelayType = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_150);
Card _relay1Type = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_151);
Card _relay2Type = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_152);
Card _output1ResistanceInput = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_145);
Card _output2ResistanceInput = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_146);
Card _output1RelayType = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_149);
Card _output2RelayType = Card(&dashboard, DROPDOWN_CARD, YASOLR_LBL_150);
Card _output1DimmerMapper = Card(&dashboard, RANGE_SLIDER_CARD, YASOLR_LBL_183, "%", 0, 100, 1);
Card _output2DimmerMapper = Card(&dashboard, RANGE_SLIDER_CARD, YASOLR_LBL_184, "%", 0, 100, 1);
Card _output1PZEMSync = Card(&dashboard, PUSH_BUTTON_CARD, YASOLR_LBL_147);
Card _output2PZEMSync = Card(&dashboard, PUSH_BUTTON_CARD, YASOLR_LBL_148);
Card _output1PZEMSync = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_147);
Card _output2PZEMSync = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_148);
Card _relay1Load = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_072);
Card _relay2Load = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_075);
Card _output1ResistanceInput = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_145);
Card _output2ResistanceInput = Card(&dashboard, TEXT_INPUT_CARD, YASOLR_LBL_146);
Card _resistanceCalibration = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_186);

Tab _pidTab = Tab(&dashboard, "\u2699 " YASOLR_LBL_159);
Card _pidView = Card(&dashboard, BUTTON_CARD, YASOLR_LBL_169);
Expand Down
6 changes: 3 additions & 3 deletions include/i18n/en.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down Expand Up @@ -126,7 +126,7 @@
#define YASOLR_LBL_120 "LED Yellow"
#define YASOLR_LBL_121 "PZEM (TX) Serial RX"
#define YASOLR_LBL_122 "PZEM (RX) Serial TX"
#define YASOLR_LBL_123 "Pending..."
#define YASOLR_LBL_123 "Pending"
#define YASOLR_LBL_124 "Not started"
#define YASOLR_LBL_125 "Zero-Cross Detection"
#define YASOLR_LBL_126 "Hardware"
Expand Down Expand Up @@ -189,7 +189,7 @@
#define YASOLR_LBL_183 "Output 1 Dimmer Min/Max Remapping"
#define YASOLR_LBL_184 "Output 2 Dimmer Min/Max Remapping"
#define YASOLR_LBL_185 "Zero-Cross Pulse Period"
#define YASOLR_LBL_186
#define YASOLR_LBL_186 "Resistance Value Detection"
#define YASOLR_LBL_187
#define YASOLR_LBL_188
#define YASOLR_LBL_189
Expand Down
6 changes: 3 additions & 3 deletions include/i18n/fr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down Expand Up @@ -126,7 +126,7 @@
#define YASOLR_LBL_120 "LED Jaune"
#define YASOLR_LBL_121 "PZEM (TX) Serial RX"
#define YASOLR_LBL_122 "PZEM (RX) Serial TX"
#define YASOLR_LBL_123 "En attente..."
#define YASOLR_LBL_123 "En attente"
#define YASOLR_LBL_124 "Non démarré"
#define YASOLR_LBL_125 "Détection de passage par zéro"
#define YASOLR_LBL_126 "Matériel"
Expand Down Expand Up @@ -189,7 +189,7 @@
#define YASOLR_LBL_183 "Redéfinition Min/Max Variateur Sortie 1"
#define YASOLR_LBL_184 "Redéfinition Min/Max Variateur Sortie 2"
#define YASOLR_LBL_185 "Période des Zero-Cross"
#define YASOLR_LBL_186
#define YASOLR_LBL_186 "Détection valeur résistances"
#define YASOLR_LBL_187
#define YASOLR_LBL_188
#define YASOLR_LBL_189
Expand Down
2 changes: 1 addition & 1 deletion lib/MycilaAppInfo/MycilaAppInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#include <Esp.h>
#include <MycilaAppInfo.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/MycilaAppInfo/MycilaAppInfo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down
4 changes: 2 additions & 2 deletions lib/MycilaDimmer/MycilaDimmer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#include <MycilaDimmer.h>

Expand Down Expand Up @@ -50,7 +50,7 @@ void Mycila::Dimmer::begin(const int8_t pin) {
return;
}

LOGI(TAG, "Enable Dimmer on pin %" PRId8 "...", _pin);
LOGI(TAG, "Enable Dimmer on pin %" PRId8, _pin);

pinMode(_pin, OUTPUT);
digitalWrite(_pin, LOW);
Expand Down
6 changes: 3 additions & 3 deletions lib/MycilaDimmer/MycilaDimmer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down Expand Up @@ -42,8 +42,8 @@ namespace Mycila {
}
#endif

void setOn() { setDutyCycle(1); }
void setOff() { setDutyCycle(0); }
void on() { setDutyCycle(1); }
void off() { setDutyCycle(0); }
bool isOff() const { return _dutyCycle <= _dutyCycleMin; }
bool isOn() const { return _dutyCycle > _dutyCycleMin; }
bool isOnAtFullPower() const { return _dutyCycle >= _dutyCycleMax; }
Expand Down
6 changes: 3 additions & 3 deletions lib/MycilaDimmer/MycilaZCD.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#include <MycilaZCD.h>

Expand Down Expand Up @@ -43,7 +43,7 @@ void Mycila::ZCD::begin(const int8_t pin, const uint8_t frequency) {
return;
}

LOGI(TAG, "Enable Zero-Cross Detection on pin %" PRId8 " with frequency %" PRIu8 " Hz...", _pin, frequency);
LOGI(TAG, "Enable Zero-Cross Detection on pin %" PRId8 " with frequency %" PRIu8 " Hz", _pin, frequency);

// https://github.com/fabianoriccardi/dimmable-light/wiki/Notes-about-specific-architectures#interrupt-issue
Thyristor::semiPeriodShrinkMargin = 400;
Expand All @@ -57,7 +57,7 @@ void Mycila::ZCD::begin(const int8_t pin, const uint8_t frequency) {

void Mycila::ZCD::end() {
if (_enabled) {
LOGI(TAG, "Disable Zero-Cross Detection...");
LOGI(TAG, "Disable Zero-Cross Detection");
_enabled = false;
Thyristor::setFrequency(0);
Thyristor::end();
Expand Down
2 changes: 1 addition & 1 deletion lib/MycilaDimmer/MycilaZCD.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2023-2024 Mathieu Carbou and others
* Copyright (C) 2023-2024 Mathieu Carbou
*/
#pragma once

Expand Down
Loading

0 comments on commit d63970c

Please sign in to comment.