Comments (7)
Ursache ist wahrscheinlich, dass im JSON das datetime-Objekt nicht ausgewertet ist.:
{'cmd': 'series', 'series': [(1672386364233, 24.3), (1672386665008, 24.3), (1672386965805, 24.4), (1672387266567, 24.5), (1672387567398, 24.0), (1672387567398, 24.0), (1672387714496, 24.0)], 'sid': 'env.system.memory.percent|raw|1h|now|100', 'params': {'update': True, 'item': 'env.system.memory.percent', 'func': 'raw', 'start': 1672387714496, 'end': 'now', 'step': 36000, 'sid': 'env.system.memory.percent|raw|1h|now|100'}, 'update': datetime.datetime(2022, 12, 30, 9, 9, 10, 501995, tzinfo=tzfile('/usr/share/zoneinfo/Europe/Berlin'))}
.
Hier müsste entweder das datetime-Objekt in Anführungszeichen stehen
'update': 'datetime.datetime(2022, 12, 30, 9, 9, 10, 501995, tzinfo=tzfile("/usr/share/zoneinfo/Europe/Berlin")'
oder (sinnvoller) als Ergebnis:
'update' : '2022-12-30T09:09:10Z+01:00'
from smarthome.
Beim Kommando "series_cancel" ist dies in den Log-Infos des Websocket-Moduls auch zu beobachten:
2023-01-17 14:06:54 INFO modules.websocket cancel_series: reply={'cmd': 'series', 'series': [(1673874414093, 63057920.0), ... komplette Datenreihe ... (1673960505797, 63287296.0)], 'series_ext': [(1673960806658, 63287296.0), (1673960814098, 63287296.0)], 'sid': 'env.core.memory|avg|1d|now|100', 'params': {'update': True, 'item': 'env.core.memory', 'func': 'avg', 'start': 1673960814098, 'end': 'now', 'step': 864000, 'sid': 'env.core.memory|avg|1d|now|100'}, 'update': datetime.datetime(2023, 1, 17, 14, 21, 18, 203993, tzinfo=tzfile('/usr/share/zoneinfo/Europe/Berlin'))}
2023-01-17 14:06:54 INFO modules.websocket cancel_series: self.sv_update_series={'192.168.2.112:52100': {'env.core.memory|avg|1d|now|100': {'update': datetime.datetime(2023, 1, 17, 14, 21, 3, 800367, tzinfo=tzfile('/usr/share/zoneinfo/Europe/Berlin')), 'params': {'update': True, 'item': 'env.core.memory', 'func': 'avg', 'start': 1673960799779, 'end': 'now', 'step': 864000, 'sid': 'env.core.memory|avg|1d|now|100'}}}}
from smarthome.
Von Andre kam folgender Lösungsvorschlag:
Im DB-Plugin in Zeile 885
'update': self.shtime.now() + datetime.timedelta(seconds=int(logs['step'] / 1000))
in
'update': str(self.shtime.now() + datetime.timedelta(seconds=int(logs['step'] / 1000)))
ändern.
Dies hier zur weiteren Diskussion.
from smarthome.
Das ist kein Bug. Der Eval Syntax Checker bildet exakt nach, was im eval passiert und eval würde auf genau den selben Fehler laufen.
Das Executor Plugin stellt eine andere Umgebung zur Verfügung und kann daher auch mit obigem Problem umgehen (eval jedoch nicht).
Für viele (aber nicht alle) ähnlich gelagerte Probleme (Syntax Checker meldet Error) kann man das Problem lösen, indem man den Ausdruck im eval Checker noch in einen String wandelt.
from smarthome.
Das stimmt natürlich im Hinblick auf den eval Syntax Checker. Aber ist es nicht trotzdem sinnvoller, im DB-Plugin die Update-Zeit im Klartext zu schreiben, so dass diese auch weiterverarbeitet werden kann?
from smarthome.
Mit der Wandlung würde das zwar im eval funktionieren, aber funktioniert es auch in den weiteren Use cases, die Zeit-Rechnugn machen (z.b. Bereitstellung für die smartVISU) oder wäre es dafür ein breaking change?
Ich bin mit dem database Plugin zuwenig „verheiratet“, um sicher zu beurteilen, ob das an anderen Stellen breaken würde.
from smarthome.
SmartHomeNG v1.9.4 has been released
from smarthome.
Related Issues (20)
- SHNG should log when it restarts in interactive or foreground mode HOT 1
- lib.network: KNX plugin: Thread can only be started once HOT 14
- Multiple Log entries created due to multiple event listener HOT 3
- Error on restarting if shng is not running HOT 2
- Feature request: Delete 0 byte cache files in Admin Interface HOT 7
- extend websocket protocol for series HOT 2
- Admin interface HOT 1
- Feature Request: Enable "Watch Attribute" in AdminIF in Logics Editor for Logic Parameters
- Feature Request: Add small graph in AdminIF / Items / Item Informationen for items having database enabled
- admin interface: Warning after changing plugin loglevel HOT 8
- shpypi exception on version check of "pymodbus" HOT 4
- implement suspend/resume for plugins HOT 8
- Startup problems on v1.9.4 HOT 23
- Admin interface: support new log levels HOT 1
- HTTP Module: improve handling of page length and responsive design HOT 2
- CherryPy ValueError on restart HOT 2
- cache value not converted to current item type
- Issues with (re)loading logics from the editor page of the admin gui HOT 7
- structs not checked for wrong configurations? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarthome.