Using IOTstack, Telegraph, Graphana and MQTT Classic data

Started by ClassicCrazy, December 05, 2021, 03:03:52 PM

Previous topic - Next topic

Graham

Quote from: ClassicCrazy on January 11, 2022, 01:39:31 PM
Here is a quick video tour of my solar system and the  messing around I have been doing on the solar system and monitoring.
https://www.ebay.com/itm/384229223436
...

Larry, I don't see the link to the video, the first link is to ebay (same as the last link)

Graham
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ClassicCrazy

Quote from: Graham on January 12, 2022, 08:25:07 AM
Quote from: ClassicCrazy on January 11, 2022, 01:39:31 PM
Here is a quick video tour of my solar system and the  messing around I have been doing on the solar system and monitoring.

...

Larry, I don't see the link to the video, the first link is to ebay (same as the last link)

Graham

Graham -
Yeah I goofed up the link
Here it is - also I corrected it in the other post.
https://youtu.be/qj97LjGcj1Y
I hooked up the PZEM-017 and got it working - well for awhile !
I was using the factory software and amp reading was off .
Then I thought yeah I had different shunt on there so I  half read the instructions on how to do it. 
The software had a Calibrate command - and oops that screwed it up !
Reading some other instructions said basically don't use the Calibrate - oops too late.
There was another spot in software to set the shunt.
Anyway might fixable  by modbus ? But I just ordered another one.
Do you want the one I messed up ? Maybe you have the modbus skills to recalibrate it right.
If you want it I will send it to you - message me .
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Graham

Quote from: ClassicCrazy on January 12, 2022, 05:33:37 PM
Graham -
Yeah I goofed up the link
Here it is - also I corrected it in the other post.
https://youtu.be/qj97LjGcj1Y
I hooked up the PZEM-017 and got it working - well for awhile !
I was using the factory software and amp reading was off .
Then I thought yeah I had different shunt on there so I  half read the instructions on how to do it. 
The software had a Calibrate command - and oops that screwed it up !
Reading some other instructions said basically don't use the Calibrate - oops too late.
There was another spot in software to set the shunt.
Anyway might fixable  by modbus ? But I just ordered another one.
Do you want the one I messed up ? Maybe you have the modbus skills to recalibrate it right.
If you want it I will send it to you - message me .
Larry
sure, it would be fun to see if I can fix it, I'll send you a PM with my address etc.

If you're using telegraf as the mqtt subscriber for influxdb, you should be able to add the tasmota topic to the telegraf.conf file to get the telemetry data to grafana. I have a bunch of sonoff/tasmota switches, so I'll try it here to see if I can get that to work.

I started to update the wiki at https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack to include influx/telegraf/grafana, you're more of an expert on grafana, let me know if I should add more details on the last section


Graham.


...

I added "tele/tasmotaPower_6839BD/SENSOR" to the telegraf.conf topics area and got the extra field keys for the sonoff P2. You can use the TelePeriod command in the tasmota console to change the publish rate for the sensor (default is 300s)

Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ClassicCrazy

Quote from: Graham on January 13, 2022, 09:13:09 AM
I added "tele/tasmotaPower_6839BD/SENSOR" to the telegraf.conf topics area and got the extra field keys for the sonoff P2. You can use the TelePeriod command in the tasmota console to change the publish rate for the sensor (default is 300s)

Graham - I got my Sonoff POW added to mqtt_consumer via telegraph and seems to be working.
I haven't set it up on Grafana yet.
Thanks for that -  I never would have imagined it would be that easy to do !
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ClassicCrazy

I was able to get  the Sonoff data into Grafana .  I am getting better at figuring out how to set up things in Grafana .
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ClassicCrazy

#20
Here is the my latest Midnite Grafana dashboard flow with any additional improvements I have made since last time I posted it.
I just added shunt watts and also data from the Sonoff POW.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Wizbandit

I didn't like the version of Grafana with auto-size fonts.  I use v7.4.3 which has text size settings.
This is my ugly 1 of 5 Classics...

ClassicCrazy

#22
Quote from: Wizbandit on January 16, 2022, 12:34:58 PM
I didn't like the version of Grafana with auto-size fonts.  I use v7.4.3 which has text size settings.
This is my ugly 1 of 5 Classics...

I am using Grafana 8.3.0
I use whatever docker version IOTStack installs . IOTStack makes it easy to automatically  install all the needed programs like Portainer, Influxdb, Telegraph, Mosquitto, etc.
Pretty sure I can set whatever  text size and fonts I want but havent' messed with that yet.   
Right now I am learning how to have Grafana do the math to add up totals from both of my Classics and display it properly. 
I had mistakes on other dashboards I shared and am now correcting them ( learning Grafana mostly by trial and error ).

Also here is my latest improved grafana dashboard

system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Graham

Quote from: ClassicCrazy on January 16, 2022, 01:49:21 PM
I am using Grafana 8.3.0
I use whatever docker version IOTStack installs . IOTStack makes it easy to automatically  install all the needed programs like Portainer, Influxdb, Telegraph, Mosquitto, etc.
...

You can use IOTStack to generate a docker-compose.yml file to start with, then edit the file to suite your needs.
Once you have the docker-compose.yml setup the way you want it, you can use the docker commands to create and start the containers
you can also setup bash aliases https://sensorsiot.github.io/IOTstack/Docker-commands/.

If you want to pull a specific version of an image, you can specify any version that is defined in dockerHub https://hub.docker.com/r/grafana/grafana/tags?page=1&ordering=last_updated

  grafana:
    container_name: grafana
    image: grafana/grafana:7.4.3
...


note: if you run the IOTStack/build stack after you edit your docker-compose.yml file it will overwrite your edits...

Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ClassicCrazy

#24
I was able to flash an ESP32 Devkit V1 board with Tasmota .
It wasn't documented very well  but is supported and also supports the Peacefair PZEM-016 AC monitor .
I used a RS485 to TTL adapter board to connect to ESP32, selected the pin options for PZEM in Tasmota configuration menu and it worked !
( should work with esp8266 too)
The CT from PZEM is snapped around  neutral wire from inverter to main breaker box. I have about 30 feel to cat 5 bringing signal from PZEM into house ( the PZEM board is out by breaker box)
Doesn't get much easier than that ( though it took me a few hours to find all the info I needed) .
Tasmota is great firmware to flash on ESP because drop down menu for every pin shows all available options for every type of sensor that may work .
I used this info for wiring https://community.home-assistant.io/t/how-to-connect-pzem-017-dc-with-nodemcu/160754/12
The PZEM is sending power back over cat 5 wire I am using and it powers the esp32.
I just need to configure the mqtt in Tasmota and should be able to bring it into Grafana by making the changes in telegraf.conf and setup database in influx as described in previous post.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ClassicCrazy

Integrated PZEM energy monitor into Grafana
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Graham

Quote from: ClassicCrazy on January 28, 2022, 06:57:53 PM
Integrated PZEM energy monitor into Grafana

Larry,
I recently updated the wiki in https://github.com/ClassicDIY/ClassicMQTT to add more details in the "Raspberry Pi setup using IOTStack" section.
I was wondering if we should add another section describing the integration of other devices like Tasmota.

Graham
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ClassicCrazy

Quote from: Graham on January 30, 2022, 08:21:30 AM
Quote from: ClassicCrazy on January 28, 2022, 06:57:53 PM
Integrated PZEM energy monitor into Grafana

Larry,
I recently updated the wiki in https://github.com/ClassicDIY/ClassicMQTT to add more details in the "Raspberry Pi setup using IOTStack" section.
I was wondering if we should add another section describing the integration of other devices like Tasmota.

Graham

Yeah why not ?  Tasmota makes it amazingly easy to add things to mqtt and Grafana .
I can help with some screenshots or how to .
That is a nice graphic you made.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Wizbandit

I actually built a prototype "Power Monitor" daughter board for the MNS COMBOX.  It has 10 CT's and 4 AC voltage inputs.  Not sure if it will make it to the final MNS DIY COMBOX as an option yet.  I have been "tweaking" it and playing with it on my home solar system.  It needs a simple user setup interface to be viable.  Right now all the running code is "hard-coded" to fit my setup.

4 - Classic's (~ 13Kw Installed PV)
1 Sunny Island 6K & Hawkes Bay "selling" (barn ~ 3Kw PV)
1 Sunny Boy 3.8 TL (barn ~ 3Kw PV)
1 Aurora Power-one 3K (Barn ~ 2Kw PV)

Graham

Quote from: Wizbandit on January 31, 2022, 08:53:51 AM
I actually built a prototype "Power Monitor" daughter board for the MNS COMBOX.  It has 10 CT's and 4 AC voltage inputs. ...

Nice Dashboard,
are you using MQTT or are you sending data directly to influxdb with the influxdb-python library ?


Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s