Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to Domoticz #14

Closed
Reneke43 opened this issue May 5, 2016 · 15 comments
Closed

Upload to Domoticz #14

Reneke43 opened this issue May 5, 2016 · 15 comments

Comments

@Reneke43
Copy link

Reneke43 commented May 5, 2016

There are several upload options in the script. However, I would like to upload the data to Domoticz. For this you can use JSON to upload the data to virtual hardware.
I'm struggling how to get this done by modifying the Perl script.

@solmoller
Copy link
Owner

Sounds like a feasible route you have selected - did you get it to work?

@Reneke43
Copy link
Author

I've been building other automation in Domoticz for my home. (Like a nice theater mode dimming the lights on movie start for example ;-))
Your comment triggered me to continue with this project.
Domoticz has several options to upload data. The script writes JSON text to /tmp/eversolar. This could also be used to modify a dummy electricity sensor by uploading the data to Domoticz with an URL like
http://domoticz_ip:domoticz_port/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=POWER;ENERGY

@solmoller
Copy link
Owner

solmoller commented Jan 16, 2017 via email

@Reneke43
Copy link
Author

I got it working. I added a section Domoticz to the .ini file and the script. Also added a small instruction to the README.md. Also I edited the index.html so that it updates every 10 seconds. A bit more realtime ;-)
I've added my working eversolar folder, so there is data included from my inverter. I don't know how to wipe it, but I guess you do.
For now it only uploads realtime generated power. I will continue to work to add more data sensors to Domoticz. (Current, Voltage, Inverter temperature...)
eversolar-monitor-code.zip

@solmoller
Copy link
Owner

Thanks for submitting the code, will you be progressing shortly? I'll definately add it to the code, it's good to have the project back. Incidentally, github offers quite substantial support for having multiple developers sharing a project, you might want to look into how it works.

@ronneman
Copy link

@Reneke43 ,

Any progress on the Domoticz integration. I am looking forward to this functionality as well.

@solmoller
Copy link
Owner

So this should be added to the ini:
`# upload to Domoticz home automation server (more information: https://www.domoticz.com)
enabled = 0
address = "x.x.x.x"

Domoticz server ip. Can be localhost when running this script on the same system as this script.

port = 8080

Domoticz port (8080 is default)

IDX = xxx

virtual sensor IDX number. This can be found on the Domoticz hardware page.

`

And this to the pl:
`
$config->define("domoticz_enabled=s");
$config->define("domoticz_address=s");
$config->define("domoticz_port=s");
$config->define("domoticz_IDX=s")

Data to Domoticz

        ##
        ##
        ##
        ###############################################################################

        if($config->domoticz_enabled) {

            my $domoticz_address = $config->domoticz_address;
            my $domoticz_port = $config->domoticz_port;
            my $domoticz_IDX = $config->domoticz_IDX;

            my $cmd = `curl -s "http://$domoticz_address:$domoticz_port/json.htm?type=command&param=udevice&idx=$domoticz_IDX&nvalue=0&svalue=$pac;$e_today_wh" `;
	chomp($cmd);
            pmu_log("Severity 3, ".$inverters{$inverter}{"serial"}." uploading to domoticz, response: $cmd");

        }

`

Is that all, or did you change other places?

@solmoller
Copy link
Owner

Updated the code, can you test it, please?

@solmoller solmoller added the Fixed label Dec 3, 2017
@Reneke43
Copy link
Author

Reneke43 commented Dec 3, 2017

I've just downloaded the code. I'll test tomorrow when I have some daylight over here :-)

@solmoller
Copy link
Owner

solmoller commented Dec 3, 2017 via email

@solmoller
Copy link
Owner

I have added your name to the code as "Reneke43", If you'd like your full name in let me know.

@Ctenberge
Copy link

I tried to add Domoticz and succeeded mostly, no errors in the eversolar section, only I get never data in the dummy device.
Domoticz runs on another Pi and I am a bit confused here. I followed your instructions for the eversolar.ini file and do not understand enabled should be 0 (zero) where normally one would expect a 1 (one).
I tried both by the way and did'nt get any result. No power is being shown.
What is missing?

@Ctenberge
Copy link

Ctenberge commented Feb 1, 2018

I found it. For some reason this line was commented
my $cmd = curl -s "http://$domoticz_address:$domoticz_port/json.htm?type=command&param=udevice&idx=$domoticz_IDX&nvalue=0&svalue=$pac;$e_today_wh" ;

removed the comment and now it works.
Thanks

@solmoller
Copy link
Owner

Thanks for the fix, version 0.171 released with your name in it

@Ctenberge
Copy link

Ctenberge commented Feb 4, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants