modified: srcdev/INSTALL.md

This commit is contained in:
TC
2023-11-04 12:35:52 +01:00
parent 1197c53c5f
commit 9c23214d4c
8 changed files with 32 additions and 46 deletions

View File

@@ -13,7 +13,6 @@
![i386-shield]
[kawa-logo]: https://github.com/tcich/ha-addon-energa-meter/blob/main/img/buycoffeeto-btn-primary-outline.png
[kawa]: https://buycoffee.to/tcich

View File

@@ -76,6 +76,20 @@ sensor:
unit_of_measurement: "kWh"
value_template: "{{ value_json.countner.meter_value | round(2) }}"
```
## Suma liczników, bilans
W celu uzyskania sumy liczników, bilansu, itp należy użyć templates:
```
template:
- sensor:
- name: "Suma liczników"
unit_of_measurement: "kWh"
state: "{{ states('sensor.123456789_apt1') | float + states('sensor.123456789_apt2') | float | round(2) }}"
- sensor:
- name: "Bilans/różnica liczników"
unit_of_measurement: "kWh"
state: "{{ states('sensor.123456789_apt1') | float - states('sensor.123456789_apt2') | float | round(2) }}"
```
### Opis konfiguracji
| element konfiguracji | Opis |

View File

@@ -1,6 +1,6 @@
name: "Energa meter (dev)"
description: "Energa meter addon"
version: "0.1.5"
version: "0.1.6"
slug: "energa_meter_dev"
init: false
options:

View File

@@ -358,7 +358,7 @@ class MojLicznik:
def save_main_charts(self, mp, vals, m_type):
for val in vals:
#try:
logger.info(f"save_main_charts: mp: {mp}, val: {val}, meter_type: {m_type}")
logger.debug(f"save_main_charts: mp: {mp}, val: {val}, meter_type: {m_type}")
z = val["zones"]
if z[0]:
# MainChartTable.get_or_create(tm = val["tm"], zone = 1, value = z[0], tarAvg=val["tarAvg"], est=val["est"], cplt=val["cplt"])
@@ -433,7 +433,7 @@ class MojLicznik:
# meter_type = 'A+'
chart_url = f"{self.meter_url}/dp/resources/chart?mainChartDate={tsm_date}&type={chart_type}&meterPoint={meter_point}&mo={urllib.parse.quote_plus(meter_type)}"
logger.info(f"chart_url: {chart_url}")
logger.debug(f"chart_url: {chart_url}")
try:
response = self.session.get(chart_url)
data = json.loads(response.text)

View File

@@ -72,7 +72,7 @@ if __name__ == "__main__":
else:
username = os.getenv("USERNAME")
password = os.getenv("PASSWORD")
log_level = os.getenv("LOGLEVEL")
log_level = os.getenv("LOG_LEVEL")
logger_name = "energaMeter"

View File

@@ -1,27 +0,0 @@
#!/bin/bash
USERNAME="$ENERGA_USERNAME"
PASSWORD="$ENERGA_PASSWORD"
LOG_LEVEL="$LOG_LEVEL"
if [ -z "$USERNAME" ]; then
echo "Błąd: Zmienna ENERGA_USERNAME jest pusta. Proszę podać wartość."
exit 1
fi
if [ -z "$PASSWORD" ]; then
echo "Błąd: Zmienna ENERGA_PASSWORD jest pusta. Proszę podać wartość."
exit 1
fi
echo "Uruchamiam API"
python api.py &
echo "Uruchamiam MAIN"
python main.py
echo "Uruchamiam CRON"
while true; do
python cron.py
echo "Czekam..."
sleep 1800
done