Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/smarthomeNG/plugins into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
onkelandy committed Jan 2, 2024
2 parents 873fb35 + aca74b7 commit c0e5210
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 72 deletions.
64 changes: 64 additions & 0 deletions database/user_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,67 @@ Die `log` Tabelle enthält die folgenden Spalten:
Es gibt aktuell nur eine Möglichkeit die Anzahl der Datensätze pro Item zu begrenzen:
Durch die Angabe des Item Attributs ``database_maxage`` wird das maximale Alter der Einträge eines Items begrenzt.
Regelmässig werden Werte deren Zeitstempel älter ist als die angegebene Zeitspanne aus der Datenbank gelöscht.

Datenbankfunktionen für Datenreihen/Plots
=========================================

Nachfolgende Tabelle zeigt die implementierten Datenbankfunktionen für Plots. Die Funktionen werden dabei auf die verfügbaren Datenbankwerte eines bestimmten Intervalls, definiert
mit t_start und t_end, ausgeführt und liefern Datenreihen zurück.

=============== ================================================================
Funktion Bedeutung
=============== ================================================================
avg Mittelwert
integrate Diskretes Integral der Werte über der Zeit
differentiate Diskretes Differential der Werte über der Zeit
diff Differenz zu dem vorherigen Wert
duration Dauer des Wertes
count Anzahl aller Werte, die eine bestimmte Bedingung erfüllen
countall Anzahl aller Werte
min Minimalwert
max Maximalwert
on Prozentzahl der Werte > 0
sum Summe der Werte
raw Rohwerte ohne Berechnung
=============== ================================================================

Über das SmartVisu Widget plot.period können die genannten Datenbankfunktionen genutzt werden, um Plots der Werte zu erstellen.
Beispiele finden sich in der SmartVisu Dokumentation unter plot.period.

Datenbankfunktionen für Einzelauswertungen
==========================================

Das Plugin stellt außerdem Funktionen bereit, um Berechnungen über alle Werte innerhalb eines definierten Intervalls (t_start und t_end) zu machen und als
**genau ein** Wert zurückzugeben. Diese Funktionen können dann z.B. aus Logiken heraus verwendet werden.

Folgende Funktionen werden hier unterstützt:

=============== ================================================================
Funktion Bedeutung
=============== ================================================================
avg Mittelwert
integrate Diskretes Integral über der Zeit
count Anzahl aller Werte, die eine bestimmte Bedingung erfüllen
countall Anzahl aller Werte
min Minimalwert
max Maximalwert
diff Differenz
on Prozentzahl der Werte > 0
sum Summe aller Werte
raw Rohwerte
=============== ================================================================

Beispiele:

Integral aller Werte der letzten Woche, z.B. um Leistungen zu einem Verbrauch aufzuintegrieren

.. code-block:: yaml
item.db('integrate','1w')
Differenz der Datenbank zwischen heute und vor einem Jahr:

.. code-block:: yaml
item.db('diff','365d', 'now')
12 changes: 6 additions & 6 deletions enigma2/sv_widgets/widget_enigma2.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

{% macro config_info(id, gad_model, gad_webif, gad_enigma, gad_image, gad_dhcp, gad_ip, gad_gw, gad_mask, gad_mac) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

<div id="{{ uid }}">
Expand Down Expand Up @@ -54,7 +54,7 @@
*/

{% macro config_info2(id, gad_box) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

<div id="{{ uid }}">
Expand Down Expand Up @@ -88,7 +88,7 @@
*/

{% macro status_info(id, gad_standby, gad_servicename, gad_eventtitle, gad_eventdesc, gad_vwidth, gad_vheight, gad_vpid, gad_apid) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

<div id="{{ uid }}">
Expand Down Expand Up @@ -120,7 +120,7 @@
*/

{% macro status_info2(id, gad_box) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

<div id="{{ uid }}">
Expand Down Expand Up @@ -152,7 +152,7 @@
*/

{% macro status_channel(id, gad_box) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

<div id="{{ uid }}">
Expand All @@ -178,7 +178,7 @@
*/

{% macro remote2(id, gad_boxremote, gad_size, alternative) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% set uid = uid(page, id) %}

{% if config_version == 2.9 %}
Expand Down
4 changes: 2 additions & 2 deletions hue/sv_widgets/widget_hue.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
*/
{% macro control(id,g_power,g_reach,g_r,g_g,g_b,g_alert,g_effect,g_bri,g_sat,g_hue) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}

<table height="90%" width="90%" align="center">
<tr>
Expand Down Expand Up @@ -76,7 +76,7 @@
*
*/
{% macro control_group(id,g_power,g_alert,g_effect,g_bri,g_sat,g_hue) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}

<table height="90%" width="90%" align="center">
<tr>
Expand Down
4 changes: 2 additions & 2 deletions hue2/sv_widgets/widget_hue2.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/
{% macro color_control(id, g_lamp, g_alert_effect) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}

<table height="90%" width="90%" align="center">
<tr>
Expand Down Expand Up @@ -69,7 +69,7 @@
*
*/
{% macro attributes(id, g_lamp) %}
{% import "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}

Name: {{ basic.print(id~'.lightname', g_lamp~'.lightname') }} <br>
Type: {{ basic.print(id~'.lighttype', g_lamp~'.lighttype') }} <br>
Expand Down
4 changes: 2 additions & 2 deletions indego4shng/sv_widgets/indego2_widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*
*/
{% macro status(id, item) %}
{% import "basic.html" as basic %}
{% import "indego_widget.html" as indego %}
{% import config_version_full >= "3.2.c" ? "@widgets/basic.html" : "basic.html" as basic %}
{% import config_version_full >= "3.2.c" ? "@widgets/indego_widget.html" : "indego_widget.html" as indego %}


/** # Get general Informations if files are existing ----------------------- */
Expand Down
7 changes: 0 additions & 7 deletions indego4shng/sv_widgets/indego_widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

{% macro spinner(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.spinner" data-item="{{ item }}" data-designType="{{ _backend }}">

<html>
Expand All @@ -33,7 +32,6 @@

{% macro alerts(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.alerts" data-item="{{ item }}" data-designType="{{ _backend }}"></div>
{% endmacro %}

Expand Down Expand Up @@ -76,7 +74,6 @@
*/

{% macro symbol(id, items, pic, val, mode,text, ignore_text) %}
{% import "basic.html" as basic %}
<div id="{{ uid(page, id) }}" data-widget="indego.symbol" data-item="{{ implode(items) }}" data-val="{{ val|default('1') }}"
data-mode="{{ mode|default('or') }}" class="symbol hide">
{% if not text is empty %}<font style="font-size:200%" color="red"><strong>{{ text }}</strong></font><br><br>{% endif %}
Expand All @@ -93,7 +90,6 @@
*********************************************/
{% macro smartmow_calendar(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.smartmow_calendar" data-item="{{ item }}" data-designType="{{ _backend }}"></div>
{% endmacro %}

Expand All @@ -105,7 +101,6 @@
*********************************************/
{% macro mow_calendar(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.calendar" data-item="{{ item }}" data-designType="{{ _backend }}"></div>
{% endmacro %}

Expand All @@ -120,7 +115,6 @@

{% macro predictive_calendar(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.calendar_predictive_list" data-item="{{ item }}" data-designType="{{ _backend }}"></div>
{% endmacro %}

Expand Down Expand Up @@ -158,6 +152,5 @@
*********************************************/
{% macro mode(id, item,_backend ) %}

{% import "basic.html" as basic %}
<div{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="indego.mode" data-item="{{ item }}" data-designType="{{ _backend }}"></div>
{% endmacro %}
4 changes: 2 additions & 2 deletions mvg_live/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ for result in results:
line_string += '<div style="background-color: #fff; width: 120px; ">%s %s</div></td></tr>' % (datetime.fromtimestamp(result['time']).strftime("%H:%M"),calculated_delay) #calculated_delay)
html_string += line_string
i = i + 1
if i == 7:
break
if i == 7:
break

html_string += '</table>'
sh.general.travel_info.mvg_station.search.result(html_string)
Expand Down
35 changes: 0 additions & 35 deletions mvg_live/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,3 @@ plugin_functions:
de: "Name der Haltestelle. Schauen Sie auf der MVG live Webseite nach gültigen Namen."
en: "Name of the stop or station. Visit the MVG live web site to find valid names."

timeoffset:
type: int
description:
de: "Keine Verbindungen in weniger als dieser Zeitdauer anzeigen. Sinnvoll, wenn man einige Minuten von der Haltstelle entfernt ist. Default: 0"
en: "Do not display connections departing sooner than this number of minutes. Useful if you are a couple of minutes away from the stop. Default: 0"

entries:
type: int
description:
de: "Anzahl der Einträge, die geholt werden sollen. Default: 10"
en: "Number of entries to retrieve. Default: 10."

ubahn:
type: bool
description:
de: "Falls 'False', keine U-Bahn Abfahrtzeiten anzeigen. Default: True."
en: "If 'False', do not display U-Bahn (subway) departures. Default: True."

tram:
type: bool
description:
de: "Falls 'False', keine Tram Abfahrtzeiten anzeigen. Default: True."
en: "If 'False', do not display tram departures. Default: True."

bus:
type: bool
description:
de: "Falls 'False', keine Bus Abfahrtzeiten anzeigen. Default: True."
en: "If 'False', do not display bus departures. Default: True."

sbahn:
type: bool
description:
de: "Falls 'False', keine S-Bahn Abfahrtzeiten anzeigen. Default: True."
en: "If 'False', do not display S-Bahn (suburban train) departures. Default: True."
3 changes: 0 additions & 3 deletions openweathermap/readme_en.rst.off
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ An example usage of those virtual matchstrings is the rain_overview-widget for S

.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.rain_overview('visual_id', 'weather.rain_past_12h', 'weather.rain_next_12h', 'weather.as_of') }}


Expand Down Expand Up @@ -902,7 +901,6 @@ This can be used from SmartVisu with a widget that is provided along with this p

.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.irrigation('valve_1', 'The greenhouse', 'garden.irrigation_valve1') }}


Expand Down Expand Up @@ -1066,7 +1064,6 @@ This can be used from SmartVisu with a widget that is provided along with this p

.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.irrigation_weekly('valve_2', 'Lawn in the backyard', 'garden.irrigation_valve2') }}


Expand Down
3 changes: 0 additions & 3 deletions openweathermap/user_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ Hier ein Beispiel für die Verwendung der virtuellen Matchstrings mit dem smartV
.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.rain_overview('visual_id', 'weather.rain_past_12h', 'weather.rain_next_12h', 'weather.as_of') }}


Expand Down Expand Up @@ -865,7 +864,6 @@ Das Beispiel, passend zur YAML von oben:

.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.irrigation('valve_1', 'The greenhouse', 'garden.irrigation_valve1') }}


Expand Down Expand Up @@ -1035,7 +1033,6 @@ Das Beispiel, passend zur YAML von oben:

.. code:: html

{% import "widgets_openweathermap.html" as owm %}
{{ owm.irrigation_weekly('valve_2', 'Lawn in the backyard', 'garden.irrigation_valve2') }}


Expand Down
3 changes: 3 additions & 0 deletions resol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def sock(self):
self.logger.info("2) Connecting socket")
try:
self.sock.connect((self._ip, self._port))
except socket.timeout as e:
self.logger.warning("Timeout exception during socket connect: %s" % str(e))
return
except Exception as e:
self.logger.error("Exception during socket connect: %s" % str(e))
return
Expand Down
7 changes: 7 additions & 0 deletions solarforecast/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@ parameters:
type: num
mandatory: False
default: 0.0
valid_min: -90
valid_max: 90
description:
de: '(Optional) Breitengrad der Solaranlage in dezimalen Grad'
en: '(Optional) Latitude of solar system in decimal degree. Otherwise taken from smarthome config.'
longitude:
type: num
mandatory: False
default: 0.0
valid_min: -180
valid_max: 180
description:
de: '(Optional) Längengrad der Solaranlage in dezimalen Grad. '
en: '(Optional) Longitude of solar system in decimal degree. Otherwise taken from smarthome config.'
declination:
type: num
mandatory: True
valid_min: 0
valid_max: 90
description:
de: 'Deklinationswinkel Solaranlage in Grad'
en: 'Panel declination in degree'
Expand All @@ -51,6 +57,7 @@ parameters:
kwp:
type: num
mandatory: True
valid_min: 0
description:
de: 'Leistung der Solaranlage in kW Peak'
en: 'Power of solar system in kw peak'
Expand Down
Loading

0 comments on commit c0e5210

Please sign in to comment.