Open ans-gw opened 2 years ago
Hi, unfortunately this fork do not have activity. last changes was 9 months ago. You can try my fork. I have tried to combine all the changes from all forks. PV and Load in watthour I have removed because not ok in HA. You can create in HA a sensor: Riemann sum integral sensor and utility meter for that.
Ok,I will try. Actually i have already Utility meter in my ha. I take data PV_input_power from my inverter using using a voltronic/mqtt mod from here https://hub.docker.com/r/insanityflea/voltronic-mqtt. and can see here too:https://github.com/syssi/esphome-pipsolar/issues/16 With this mod i can get data from inverter Pv_input_power... You can take a look and see which mods have made. Unfortunatelly i cant do myself,i no have that knowledge.
Thank you
Hi, unfortunately this fork do not have activity. last changes was 9 months ago. You can try my fork. I have tried to combine all the changes from all forks. PV and Load in watthour I have removed because not ok in HA. You can create in HA a sensor: Riemann sum integral sensor and utility meter for that.
I just try It...Mqtt device is added to Ha but i no get any data in HA. If i check Mqtt data with Mqtt explorer can see the data.... no understand...someting no working.
Look in devices for new device. Here you sold see the new sensors. Like this
..yes i can see new device,but dta are all o..battery logo near Mqtt is empty and 0%.
Ok, but you said that in mqtt broker you have values, no? Or in broker you have only the subscriber topics? It is coming values for states? Did you run in console the the command for test to see if it reply with data?
I have the value in "Mqtt discovery" on my windows laptop only. I cant understand why no have value in new divece in Ha!?
in your laptop, what program to do use to see on my laptop it is like this:
the command to test in the console it is like this: sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1'
Mon May 9 06:20:50 2022 INVERTER: Debug set
Mon May 9 06:20:50 2022 DEBUG: Current CRC: 49 C1
Mon May 9 06:20:50 2022 DEBUG: Send buffer hex bytes: ( 51 4d 4f 44 49 c1 0d )
Mon May 9 06:20:50 2022 DEBUG: 7 bytes written, 7 bytes sent, 0 bytes remainin g
Mon May 9 06:20:50 2022 DEBUG: 8 bytes read, 8 total bytes: 28 42 e7 c9 0d 00 00 00
Mon May 9 06:20:50 2022 DEBUG: Found reply
Do you have like me? Did you check the credential in config/mqtt.json ? it should be right if you see data in mqtt explorer...
Yes...like you. I put my Mqtt user and passw in config/mqtt.json. I thinking to reinstall Ha from scratch,and try again...but need time. Wich version of Mosquitto are you using in Ha?
I have: Mosquitto broker Current version: 6.1.1
Indeed strange... To reinstall HA it is a very radical decision... witch maybe it is not a solution
maybe you changed the configuration after the HA discovered the inverter. try to delete from HA>devices>Mosquitto broker>the inverter>delete device and then restart HA. After a wile if the inverter it is not discovered by HA go in console and do: sudo docker-compose down and then: sudo docker-compose up -d
mmm...feel strang also to me... I try already to delte from HA>devices>Mosquitto broker>the inverter>..but same. The only thing different from your instruction is changing in inverter.conf port to ttyUSB1... can be this?..i dont think...
No, if sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1' it give you values and you see in mqtt explorer data comming every 11 seconds. the issue it is in HA... for curiosity please share a print screen exactly I like I have done from mqtt explorer. also for test, you can make a template mqtt sensor with the topic seen in mqtt explorer to see in HA if this sensor receive data from mqtt broker.
hi, sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1' dont give me any values. pi@InverterPi4:/opt/ha-inverter-mqtt-agent $ sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1' Tue May 10 18:51:38 2022 INVERTER: Debug set Tue May 10 18:51:48 2022 DEBUG: Unable to open device file (errno=2 No such file or directory) Tue May 10 18:51:58 2022 DEBUG: Unable to open device file (errno=2 No such file or directory) Tue May 10 18:52:08 2022 DEBUG: Unable to open device file (errno=2 No such file or directory) Tue May 10 18:52:18 2022 DEBUG: Unable to open device file (errno=2 No such file or directory) Tue May 10 18:52:28 2022 DEBUG: Start loop
I try to cancell ha-inverter-mqtt-agent,after i redownload your file,and modify only config/inverter.conf with my data... after i recompile ,but same before no have data from inverter.
Scanning dependencies of target inverter_poller [ 20%] Building CXX object CMakeFiles/inverter_poller.dir/inputparser.cpp.o [ 40%] Building CXX object CMakeFiles/inverter_poller.dir/inverter.cpp.o /opt/inverter-cli/inverter.cpp: In member function 'bool cInverter::query(const char)': /opt/inverter-cli/inverter.cpp:154:29: warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith] n = read(fd, (void*)buf+i, 120 - i); ^ [ 60%] Building CXX object CMakeFiles/inverter_poller.dir/main.cpp.o [ 80%] Building CXX object CMakeFiles/inverter_poller.dir/tools.cpp.o [100%] Linking CXX executable inverter_poller [100%] Built target inverter_poller Removing intermediate container 0fb954816281
i no understand .. thanks foe help
Hello, sorry to hear that. Unable to open device file (errno=2 No such file or directory) seems the problem it is with installation or connection from inverter to raspberry pi
did you follow my instructions from readme? without error? when you build it, is a warning error. that's ok: (warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith] n = read(fd, (void)buf+i, 120 - i);) 100% build it is ok.
if you do not have usb connection to inverter, yes indeed you need to change in config/inverter.conf following line with what you used before (device=/dev/hidraw0)
in config/mqtt.json you have to change with what you have for HA:
"server": "192.168.0.2",
"port": "1883",
"devicename": "mpp", "manufacturer": "MPPSolar", "model": "PIP3024MSXE", "serial": "92331908103079", "ver": "2019", "username": "mqtt", "password": "broker", but I supose this it is allready ok, because you see in mqtt broker
after you run (sudo docker-compose up -d) and you do not receive data after you run (sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1') make a restart of you raspberry pi (sudo restart) and wait 3-5 min run again (sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1') to see if it helps to make connection with cable
Ok,i will try again. The only thing i made different is: sudo mv ha-inverter-mqtt-agent ha-inverter-mqtt-agentold instead of sudo rm -rf ha-inverter-mqtt-agent,but i dont think this is the problem.
Last line of readme: sudo python3 /bin/monitor.py & mast make this too? Thank you very much
sudo mv ha-inverter-mqtt-agent ha-inverter-mqtt-agentold instead of sudo rm -rf ha-inverter-mqtt-agent,but i dont think this is the problem. i do not thinks it is a problem
Last line of readme: sudo python3 /bin/monitor.py & mast make this too? No! it is for my BMS
Ok..i got the data from inverter ,but: PV in watts = 0 W this i need. SCC voltage =0V no needed. mpp_COMMANDS =Unknown . dont know what it is.
The only way i menage to get PV in watts is with .diff file can find here. https://github.com/ned-kelly/docker-voltronic-homeassistant/issues/40, this file diff: https://skyboo.net/temp/ha_local_docker_build_v2.diff and this is a modify image that i actually use: docker image https://hub.docker.com/r/insanityflea/voltronic-mqtt
Hope you can implement this. Thank you very much.
Great! PV in watts = 0 W this i need. SCC voltage =0V no needed.
From a little more reading, it seems your inverter is using a different protocol for qpigs. Hope it only add at the end new variables. please look in manual folder and open pdf at page 4th. then search another pdf on web for protocol for your inverter and try to help me to make a comparation between them and share it here the pdf and what you found. If it is compatible the logic, I will try to look in my free time to see if I can modify the code. I also am not a programmer and spend a lot of time reading all the forks to understand.
_mppCOMMANDS =Unknown . dont know what it is.
this sensor it is for reading what commands you send to inverter from HA. My changes in code it is accepting almost all the commands from the protocol (no more limit of 5 characters).
_The only way i menage to get PV in watts is with .diff file can find here. https://github.com/ned-kelly/docker-voltronic-homeassistant/issues/40, this file diff: https://skyboo.net/temp/ha_local_docker_build_v2.diff_
I look latter to see the differences. It is a lot to read.
and this is a modify image that i actually use: docker image https://hub.docker.com/r/insanityflea/voltronic-mqtt
It took a lot also for me to understand, but actually you do not need it because we build a locally image from what we locally change in folders(ned-kelly image it is old and insanityflea has his changes) if you will look in doker-compose.yml you will see that I comment the image and to use what I have copied locally from my fork.
Ok. This my qpgis response and Mgx protocol manual data.Hope can help you. this file .diff https://skyboo.net/temp/ha_local_docker_build_v2.diff has been made to get data from Pv_imput_power. or Pv_charging_Power. You can copy what is added on the diff. I m not able to do,im too noob.
QPIGS: 110 bytes read: (230.8 50.0 230.8 50.0 0484 0368 009 393 52.60 007 049 0048 00.7 351.5 00.00 00000 00010111 00 00 00410 010 410 is Pv_imput_power. or Pv_charging_Power
Computer: QPIGS
Data Description Notes a ( Start byte b BBB.B Grid voltage B is an Integer number 0 to 9. The units is V. C CC.C Grid frequency C s an Integer number 0 to 9. The units is Hz. D DDD.D AC output voltage D is an Integer number 0 to 9. The units is V. E EE.E AC output frequency E is an Integer number from 0 to 9. The units is Hz. F FFFF AC output apparent power F is an Integer number from 0 to 9. The unitsis VA G GGGG AC output active power G is an Integer ranging from 0 to 9. The unitsis W. H HHH Output load percent DEVICE: HHH is Maximum of W% or VA%. VA% is a percent of apparent power. W% is a percent of active power.The units is %. I III BUS voltage I is an Integer ranging from 0 to 9. The units is V. j JJ.JJ Battery voltage J is an Integer ranging from 0 to 9. The unitsis V. k KKK Battery charging current K is an Integer ranging from 0 to 9. The unitsis A. o OOO Battery capacity X is an Integer ranging from 0 to 9. The unitsis %. P TTTT Inverter heat sink temperature T is an integer ranging from 0 to 9. The unitsis ℃ r EE.E PV Input current for battery. E is an Integer ranging from 0 to 9. The unitsis A. t UUU.U PV Input voltage 1 U is an Integer ranging from 0 to 9. The unitsis V. u WW.WW Battery voltage from SCC W is an Integer ranging from 0 to 9. The units is V. w PPPPP Battery discharge current P is an Integer ranging from 0 to 9. The units is A. x b7b6b5b4 b3b2b1b0 Device status b7: PV or AC feed the load, 1:yes,0:no b6: configuration status: 1: Change 0: 6 unchanged b5: SCC firmware version 1: Updated 0: unchanged b4: Load status: 0: Load off 1:Load on b3: reserved b2: Charging status( Charging on/off) b1: Charging status( SCC charging on/off) b0: Charging status(AC charging on/off) b2b1b0: 000: Do nothing 110: Charging on with SCC charge on 101: Charging on with AC charge on 111: Charging on with SCC and AC charge on Keep b6~b4, b2 ~ b0, reserve other y QQ Battery voltage offset for fans on Q is an Integer ranging from 0 to 9. The unit is 10mV. z VV EEPROM version V is an Integer ranging from 0 to 9. MMMM M PV Charging power M is an Integer ranging from 0 to 9. The unit is watt. b10b9b8 Device status b10: flag for charging to floating mode b9: Switch On b8: flag for dustproof installed(1-dustproof installed,0-no dustproof)
Hello, Would you like to test lasted changes in my fork? Please take a back-up for live working system before and take in consideration that's my first attempt to modify and I did not test it on my system. Have mercy :) Hope it will work.
Hello, i just compiled and get this??!! : Scanning dependencies of target inverter_poller [ 20%] Building CXX object CMakeFiles/inverter_poller.dir/inputparser.cpp.o [ 40%] Building CXX object CMakeFiles/inverter_poller.dir/inverter.cpp.o /opt/inverter-cli/inverter.cpp: In member function 'bool cInverter::query(const char)': /opt/inverter-cli/inverter.cpp:154:29: warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith] n = read(fd, (void*)buf+i, 120 - i); ^ [ 60%] Building CXX object CMakeFiles/inverter_poller.dir/main.cpp.o [ 80%] Building CXX object CMakeFiles/inverter_poller.dir/tools.cpp.o [100%] Linking CXX executable inverter_poller [100%] Built target inverter_poller
Now is night cant test the solar data...tomorrow surely. Mqtt Device shows all data...exept for "mpp_COMMANDS"= unknown what is this mpp_COMMANDS?.
please let me know
Great! From where you are? Already told you. It is a sensor witch reads the commands you sent from HA to control the Inverter. Like ned Kelly explain in readme. Bonus also it reads the response of Inverter after accepting the command.
I m from Italy(around Venice) but I live in Thailand is a small island,Koh Lipe, near border with Malaysia, nice place but electricity cost 0,7 euro Khw! Ooo,very nice dasboard with dropdown menu for battery voltages and setting charging currents... how you did it? can you share yaml? you pubblish in homeassistant/sensor/voltronic or is changed the topic in your fork?
thank you very much
ok, so you are 4 hour ahead of Romania. with some helpers (inputs) and some automations. I will share it with some files in my fork if you think it is useful. It is another. In mqtt.json you have devicename and serial. it is an concatenation between them. in mqtt explorer you will see the topic witch you can use it in your automations.
I am curios how it is looking the output from: sudo docker exec -it voltronic-mqtt bash -c '/opt/inverter-cli/bin/inverter_poller -d -1'
Hello... unfortunatelly today was raining ,but i get some solar,so this is the answer: QPIGS: 110 bytes read: (229.2 50.0 229.2 50.0 1260 1224 025 403 54.00 016 063 0047 00.6 329.8 00.00 00000 00010111 00 00 00300 010 300 is shown as Pw_Charging_Power(its Ok).....Pw_in_watt is 0
QPIRI: 103 bytes read: (230.0 21.7 230.0 50.0 21.7 5000 5000 48.0 50.0 47.5 54.7 53.7 2 010 030 0 0 2 9 00 0 0 52.0 0 1 025 0.25 minute is Bulk charging time(C.V stage)...Mean how long inverter must stay at Bulk Charge(can select 5-900 minute). Would be nice to have it too.
I have put in home assistant folder the examples of what I have for sending commands to inverter, template sensor for warnings, etc. For the input buttons you will use the helpers in HA to create them. The names and the option of them look in automations examples.
Hello... unfortunatelly today was raining ,but i get some solar,so this is the answer: QPIGS: 110 bytes read: (229.2 50.0 229.2
QPIRI: 103 bytes read: (230.0 21.7 230.0 50.0 21.7 5000 5000 48.0 50.0 47.5 54.7 53.7 2 010 030 0 0 2 9 00 0 0 52.0 0 1 025 0.25 minute is Bulk charging time(C.V stage)...Mean how long inverter must stay at Bulk Charge(can select 5-900 minute). Would be nice to have it too.
Hello, naiss! rain is good :)
Do you have the protocol to sent me? like you did last time. to compare what we have to what we need to do? I think in old protocol we skip W X(we stop at VV.V battery recharge voltage)
QPIRI
VV.V Battery re-discharge voltage V is an Integer ranging from 0 to 9. The unit is V. W PV OK condition for parallel 0: As long as one unit of inverters has X PV power balance 0: PV input max current will be the max charged current; 1: PV input max power will be the sum of the max charged power and loads power. YYY Max. charging time at C.V stage Y is an Integer ranging from 0 to 9. The unit is minute.
I try this fork,very good jobregistering Mqtt device in Home Assistant, but unfortunatelly i cant get data from: Battery_charge_current_voltronic Battery_redischarge_voltage_voltronic PV_in_current_voltronic = NEEDED PV_in_watthour_voltronic PV_in_watts_voltronic = MOST NEEDED SCC_voltage_voltronic voltronic_COMMANDS
can it be fixed?
thank you