SMASpot Monitoring in Domoticz

From Domoticz
Jump to: navigation, search

Installing SBFspot

First install bluetooth and SBFspot.

It is important that you log in use the following commands with the user that owns domoticz (for example the 'pi' users)

Things to remember:

  1. - Do not use a windows editor, just use 'vi' [ or the simple nano ] to edit the config file
  2. - Always login with the same user as domoticz (pi user for raspberry pi)
  3. - Follow the wiki to the letter
  4. - If you upgrade from an older version, check if you have all parameters from the latest configuration file in your config file, if needed, add the missing parts
  5. - the wiki is for a unix installation, the output path can not be C:\Temp
  6. - first test if it works, check if you get have data files (cvs/spot files)
  7. - if you change something in the configuration file, disable/enable SMASpot in domoticz to read the new configuration file


Installation Requirements

sudo apt-get install bluetooth libbluetooth-dev

From version 3.0 no longer uploads to PVoutput.org. This functionality is now in the hands of an upload service (Windows) or daemon (Linux). So libcurl3-dev is needed only if you are uploading data to PVoutput.org.

sudo apt-get install libcurl3-dev


DataBase Installation Requirements

SBFspot V3.1.2 uses database to store data from SMA inverter. It can be choosen the database to be used between MySQL and SQLite. To install SQLlite database execute:

sudo apt-get install sqlite3
sudo apt-get install libsqlite3-dev

While if you want to install MySQL the following code shall be executed:

sudo apt-get install libmysqlclient-dev

Creating Output Path

mkdir sbfdata

Compiling SBFspot

mkdir SBFspot
cd SBFspot
wget https://sbfspot.codeplex.com/downloads/get/1488527
tar -xvf SBFspot_SRC_312_Linux_Win32.tar.gz

sudo apt-get install libboost-all-dev

Compilation/Installation:
SQLite: sudo make install_sqlite or
MySQL: sudo make install_mysql

Compilation Only: make release_sqlite or
make release_mysql

Installation Only:

sudo make install_release_sqlite or
sudo make install_release_mysql
In the following paragraph SQLite database has been considered

Configuring SMAspot


Run the bluetooth scan tool to get the mac address from your inverter.

Or
Use your SMA inverter speedwire IP adress in the Ă‹dit config file" step.
hcitool scan

Edit config file (SBFspot.cfg)
vi SBFspot.cfg

Fill in the BT_Address=xx:xx:xx:xx:xx:xx

Or
Opt out the BT_Address= like this: #BT_Address=
And opt in the IP_Address=000.000.000.00 and change it to your inverters IP Address
Set the OutputPath
in this case OutputPath=/home/pi/smadata/%Y

Move SBFspot.cfg to /home/pi/SBFspot/SBFspot/bin/Release_SQLite
mv SBFspot.cfg bin/Release_SQLite

cd /home/pi/SBFspot/bin/Release_SQLite/

chmod 644 SBFspot.cfg

Creating Database

cd /home/pi/SBFdata
sqlite3 SBFspot.db < /home/pi/SBFspot/SBFspot/CreateSQLiteDB.sql

Test SMASpot

cd /home/pi/SMAspot/SBFspot/bin/Release_SQLite
./SBFspot -v

If it's already dark, use ./SBFspot -v -finq

Create crontab to run it scheduled every 5 minutes

crontab -e

Add the following line:
*/5 5-23 * * * /home/pi/SBFspot/bin/Release_SQLite/SBFspot -v > /dev/null

Change '/5' with '/1' if you want to run every minute

Add SBFspot to Domoticz

In Domoticz hardware section, add SBFSpot.
The configuration line will be /home/pi/SBFspot/SBFspot/bin/Release_SQLite/SBFspot.cfg

Note that since the 19th November 2015 build it is possible to use SBFSpot files that record logs for multiple inverters by suffixing the configuration line with a colon, followed by the inverter serial number. For example:

/usr/local/sbfspot.3/SBFspot.cfg:1234567890