Flukso To PVoutput - Script

Hey guys,
I have created a script so the flukso can be used again! hopefully those with fluksos see this before binning them!

Script – https://github.com/B-Mqn/FluksoToPVoutput/

Discussion Forum – https://forum.pvoutput.org/t/flukso-to-pvoutput-script-discussion/7405

bazzle's picture

Id like to give it a go., thank you.
Ive got a spare NUC. Any idea if I can use that?

B-Man's picture

I don't see why not

the readme is for linux specifically the pi.

if you have linux on the nuc then it should be very similar otherwise if its windows you just need to install the items a little different.
id just google how to install the item on windows.

its honestly not that hard get in there and give it a go. not much can really go wrong. I honestly wouldn't have too much more experience than you I just googled how to do everything I have done.

bazzle's picture

I am starting tonight, will run Unbuntu installed with dual boot and try more during the week, cheers.
I am also looking at raspberry pi 400 etc.

PVCastaert's picture

thankx, its works

jr

bazzle's picture

@PVcasaert, what system and setup are you using it on please?

Baz

B-Man's picture

@pvcastaert

great to see :)

the only thing I have found so far is if you set rules the new values aren't used if your use that power value (v1-12) in another rule...

Ciarly's picture

Great.
I don't have a PI at my disposal. is it possible to use a small Synology NAS? If yes, but I need your help.
thank you very much

B-Man's picture

If it can run python it should work.
Read the instructions
See if you can get it working

PVCastaert's picture

I use my RPI 3B with pihole on it
Follow B-mans How to.
Works fine for me,
I use V2 and V4 to upload
Values are the same as my HA values.

Regard JOS

Ciarly's picture

How long after you started the service did Pvoutput display the data? Thank you

B-Man's picture

@ciarly 5 minutes or there abouts.

run `python3 /home/pi/mqtt_pvoutput.py` in terminal to see the script running. should be able to see where it fails if it does.
.

B-Man's picture

@pvcastaert never mind... guessing your not from Australia :)

Ciarly's picture

There must be an error
/usr/bin/python3 /volume1/homes/Carlo/flukpv/mqtt_pvoutput.py
Traceback (most recent call last):
File "/volume1/homes/Carlo/flukpv/mqtt_pvoutput.py", line 20, in
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'

Help me please
thank you

Ciarly's picture

Hello.
On the command 'sudo systemctl status mqtt_pvoutput.service' I receive the following response:

Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/1111111111111111111/gauge: [1717603934,319,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/222222222222222222222/gauge: [1717603935,1871,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/1111111111111111111/gauge: [1717603935,319,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/222222222222222222222/gauge: [1717603936,1868,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/1111111111111111111/gauge: [1717603936,317,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/222222222222222222222/gauge: [1717603937,1870,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/1111111111111111111/gauge: [1717603937,314,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/222222222222222222222/gauge: [1717603938,1868,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/1111111111111111111/gauge: [1717603938,315,"W"]
Jun 05 18:12:19 SynologyD python3[9905]: Received message on topic /sensor/222222222222222222222/gauge: [1717603939,1870,"W"]

Sembrerebbe tutto corretto ma su PVOutput non vedo nulla.
Un aiuto, grazie

Ciarly's picture

Done, thanks, I corrected my mistake

B-Man's picture

@Ciarly
can you explain what the problem was and how you fixed it for others that might make the same mistake?

Ciarly's picture

I am a little ashamed, but I simply had not entered my id and the pvoutput apikey correctly, hahaha

Ciarly's picture

Hi.
now i'm having trouble identifying the sensor variable v, i don't know what to enter: v1 or v2, v3 or v4.
now i have to sleep because i don't understand anything anymore
thanks

B-Man's picture

The file has a link to the pvoutput api v1-v12 values.
Scroll down until you see them and then assign sl correct sensor to those values.
Of the top of my head
V2 for solar and v4 for consumption. Pvoutput should auto fill v1 and v3

Pjedr's picture

Hello all,

It works for me also using the same sendor id as on pvoutput where you filled in a 32 characters long field.
"The flukso device sensor to download data from"

I have 5 id's total, for eacht sensorport used, i got them from the local fluksobox via http, just go to your sensor settings.

The only problem is that my fifth sensor, needs to go to another PVOUTPUT_SYSTEMID, so i need to tweak the script more later when i have the time, or have some hint to do it.

B-Man's picture

@pjedr
To handle this, I run the script twice, changing the name for the second instance. either way you need to send to pvouput twice anyway... and if something breaks you will know what one is causing the problem :)

Here’s how you can do it:

Copy the files and add a "2" at the end of the names (e.g., service2, backlog2, script2).
Edit the service file to reference the script with the new name.
Follow the README instructions to activate the second service with the new name.
Edit the second script to point to backlog2 and use the new system ID.
Include only the sensors you need in each script.
This way, you can manage multiple sensors with different PVOutput system IDs efficiently.

B-Man's picture

@bazzle how did you go getting it running?

beadybee's picture

Got it working without too much trouble (Ubuntu server). Thank you @B-MAN

B-Man's picture

@beadybee Great to hear.
I think bazzle was going to give it a go in ubuntu. Any tips for him where you might have had to stray from the readme?

I also have a new script on the way... I ended up creating one for the counter part of the sensor
to do my water usage.
and that seemed to work ok so then combined them together... testing stage atm. I do have an issue trying to use counter for power sensor. but the gauge side works and does what's required anyway so not too stressed.
rules seems to work as expected. I think I had a few little issues with the rules in the current script.
also some more features like aligning it to the 5 minute hourly so you can see the updates soon after the time changes xx:00, xx:05, xx:10,xx:15, etc rather than 5 minute interval that could be at xx:07 or xx:08 etc.

Pjedr's picture

Hi @B-MAN,
Well, I succeeded already to have separate pvoutput systems in one script, used by one service, so only the mqttt client is running once. I like to keep it efficïently.
What I did was to duplicate almost all functions and parameters to track it as separate systems.
Only the mqtt client and readings list is still a single item.
:-)

B-Man's picture

great that you got it working.

B-Man's picture

UPDATE
Updated new version - https://github.com/B-Mqn/FluksoToPvoutput
this runs a new name and files so will need to follow the readme section from "How to Install" step 6 and down. if not running the script currently just start from the start.

Fixed rules and allowed more options with allowing IF rules
aligned with 5 min hourly intervals
added gauge and counter sensor types so water/gas should work aswell now
and lots of bugfixes

beadybee's picture

@B_MAN - funny that you issued an update just after I got it working! I had to install pip and of course use a different local directory to /home/pi - also I initially missed changing the User name in the mqtt_pvoutput.service file which resulted in a strange message about restarting the service too quickly but I think that was all. Oh and used python3 rather than python everywhere. Anything particular to do to remove the old version other than just deleting mqtt_pvoutput.service from /etc/systemd/system ?