omoerbeek / e2pv Goto Github PK
View Code? Open in Web Editor NEWListen to Enecsys Gateway posts and send data to PVOutput
License: ISC License
Listen to Enecsys Gateway posts and send data to PVOutput
License: ISC License
The script is only capable of handling one connection. That is fine, but new conections are accepted by the OS since we do not close the accepting socket. This is confusing at least.
After rebooting the gateway, the existing connection is not terminated, the timeout mechanism does not seem to work in that case.
Hi,
I'm trying out this script you wrote so (when it works) we can deploy this on all installations that are deployed by our company. But I'm getting some errors with it. It points to line 306 on my modified version:
$ok = socket_bind($socket, '0.0.0.0', 5040);
The only thing I added is some things to the MySQL statement's which shouldn't interfere with this function. But to be save, here is my modified version http://pastebin.com/f6ktRxd2 and here the config http://pastebin.com/7x6jjGrD
Also when I just manually run this script I notice it won't stop and let me run another command (if you know what I mean) and when I run sudo netstat -a -p -n
it shows the socket 0.0.0.0:5040 is still open.
Hope you can help me with this...
-Zandor Smith
PS Nederland ftw!
new data is now sent each 540 seconds (9 minutes).
pv output converts it to each ten minutes (HH:M0)
i suggest to rewrite the '540' line to something that will trigger when:
I now got this replacement:
$min = idate('i') % 10;
[..]
// } elseif ($last < $time - 540) {
} elseif ($last < $time - 300 && $min < 5 ) {
I'm a happy user from the moment that the Enecsys servers went down. As of 2 days ago the script doesn't run anymore. I realized that this started with updating of PHP from PHP 7.4 to PHP 8.
My line 390 might be different, so I will put the corresponding lines below.
PHP Fatal error: Uncaught Error: Object of class Socket could not be converted to string in /home/pi/enecsys/e2pv.php:390
Stack trace:
#0 /home/pi/enecsys/e2pv.php(448): loop()
#1 {main}
thrown in /home/pi/enecsys/e2pv.php on line 390
My e2pv.php lines (it is both line 390 and 391 (according https://phpstan.org/ the problem is on both lines):
$selarray[(string)$client] = $client;
$connections[(string)$client] = $conn;
phpstan also mentions the following when I check the script:
Cannot cast Socket to string. (line 390)
Cannot cast Socket to string. (line 391)
(when I start the script with PHP 7.4, it runs as it used to and the gateway connects directly)
At sunrise, a single values gets recorded which triggers a new submit to pvoutput. The average temp is then based on only one new value, and a bunch of old values from yesterday.
Is it possible to split the inverter data to the MySQL table? Like so:
Inverter | Data | Time |
---|---|---|
111111 | 10kWh | 10:30 |
222222 | 11kWh | 10:30 |
333333 | 12kWh | 10:30 |
111111 | 11kWh | 10:40 |
222222 | 12kWh | 10:40 |
333333 | 13kWh | 10:40 |
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.