Ginlong Solis inverter via mqtt to nodered to Domoticz
Posted: Wednesday 07 April 2021 23:23
Ginlong Solis inverter via mqtt
nodered
Domoticz
This guide needs to be refined
But if you have skills enough this could already work for you
I've managed to readout the inverter and send the data to Domoticz.
Required:
* The inverter installed and connected to the internet
* Node-red
* The altered pythonscript
* Domoticz
Step 1:
check if your ginlong-solis inverter is connected to the internet:
https://m.ginlong.com/
The username (email) and the password are needed in the python script!
Step2:
install node-red
I used a Raspberry Pi for this project:
https://nodered.org/docs/getting-started/raspberrypi
Step3:
Install mosquitto if you allready haven't
http://www.steves-internet-guide.com/in ... tto-linux/
Step4:
I used the "ginlong-scraper.py" from https://github.com/dkruyt/ginlong-scraper
I copied the file to home/pi/ginlong-scraper
Then I've eddited the file as follows:
install all this:
sudo apt install python3-pip
pip3 install requests
pip3 install schedule
pip3 install paho-mqtt
Step6:
automatic run the script at boot:
type: crontab -e
in crontab add the end:
@reboot /usr/bin/python3 /home/pi/ginlong-scraper/ginlong-scraper.py
Change the location "home/pi" if needed
Reboot the server/pi now please
Now the setup is complete, configure nodered and domoticz:
In domoticz add new hardware: "MQTT Client"
Fill in the 4 parameters from the MQTT server (Remote adress, port, username, password)
First lets test MQTT by downloading a MQTT explorer:
http://mqtt-explorer.com/
I use the portable
Open the app and fill in again the same MQTT parameters that you already used a few times.
Click connect and hopefully everything works. Wait 1 minute,
The pythonscripts runs every minute.
You should at least see a "domoticz" and "pv" topic.
the pv is the pythonscript unless you've altered the name in the script
Leave the MQTT Explorer open, it will help you to configure nodered
Go to nodered via the ip of the server like: 192.168.0.100:1880
In node red build the flow as follows:
"mqtt in"->"rbe"->"template"->"mqtt out"
When creating a MQTT block the first time:
The MQTT server is again to be defined with the same credentials.
So same server ip, port, username and password (from mosquitto server)
"mqtt in":
Server: Select the MQTT server
Topic: check the MQTT Explorer to select a topic
http://users.telenet.be/afbksu/1.jpg
http://users.telenet.be/afbksu/2.jpg
"rbe":
change only Modeto: "block unless value changes"
"template":
Property: msg.payload
Template: {"command" : "udevice", "idx": 778, "nvalue": 999, "svalue":"{{payload}}"}
Only change the idx to the idx you want to change in domoticz!
"mqtt out":
This guide needs to be refined
But if you have skills enough this could already work for you
I've managed to readout the inverter and send the data to Domoticz.
Required:
* The inverter installed and connected to the internet
* Node-red
* The altered pythonscript
* Domoticz
Step 1:
check if your ginlong-solis inverter is connected to the internet:
https://m.ginlong.com/
The username (email) and the password are needed in the python script!
Step2:
install node-red
I used a Raspberry Pi for this project:
https://nodered.org/docs/getting-started/raspberrypi
Step3:
Install mosquitto if you allready haven't
http://www.steves-internet-guide.com/in ... tto-linux/
Step4:
I used the "ginlong-scraper.py" from https://github.com/dkruyt/ginlong-scraper
I copied the file to home/pi/ginlong-scraper
Then I've eddited the file as follows:
- Spoiler: show
install all this:
sudo apt install python3-pip
pip3 install requests
pip3 install schedule
pip3 install paho-mqtt
Step6:
automatic run the script at boot:
type: crontab -e
in crontab add the end:
@reboot /usr/bin/python3 /home/pi/ginlong-scraper/ginlong-scraper.py
Change the location "home/pi" if needed
Reboot the server/pi now please
Now the setup is complete, configure nodered and domoticz:
In domoticz add new hardware: "MQTT Client"
Fill in the 4 parameters from the MQTT server (Remote adress, port, username, password)
First lets test MQTT by downloading a MQTT explorer:
http://mqtt-explorer.com/
I use the portable
Open the app and fill in again the same MQTT parameters that you already used a few times.
Click connect and hopefully everything works. Wait 1 minute,
The pythonscripts runs every minute.
You should at least see a "domoticz" and "pv" topic.
the pv is the pythonscript unless you've altered the name in the script
Leave the MQTT Explorer open, it will help you to configure nodered
Go to nodered via the ip of the server like: 192.168.0.100:1880
In node red build the flow as follows:
"mqtt in"->"rbe"->"template"->"mqtt out"
When creating a MQTT block the first time:
The MQTT server is again to be defined with the same credentials.
So same server ip, port, username and password (from mosquitto server)
"mqtt in":
Server: Select the MQTT server
Topic: check the MQTT Explorer to select a topic
http://users.telenet.be/afbksu/1.jpg
http://users.telenet.be/afbksu/2.jpg
"rbe":
change only Modeto: "block unless value changes"
"template":
Property: msg.payload
Template: {"command" : "udevice", "idx": 778, "nvalue": 999, "svalue":"{{payload}}"}
Only change the idx to the idx you want to change in domoticz!
"mqtt out":