SBFSpot Monitoring in Domoticz

From Domoticz
Jump to navigation Jump to search

SBFspot, formerly known as SMAspot, is an open source project to get actual and archive data out of an SMA® inverter over Bluetooth or Ethernet (Speedwire®) It works on either Linux (Raspberry Pi) and Windows.

Installing SBFspot

There are excellent instructions here: https://github.com/SBFspot/SBFspot/wiki/Installation-Linux-SQLite

If you're planning to run SBFspot on Raspberry Pi, you can skip this installation instruction and just run sbfspot-config


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

Add SBFspot to Domoticz

In Domoticz hardware section, add "SBFSpot (SMA)",

For Location: enter the SBFspot.cfg path (e.g. /usr/local/bin/sbfspot.3/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:

/home/pi/SBFspot/SBFspot/bin/Release_SQLite/SBFspot.cfg:1234567890


Data retrieval method

Internally, domoticz relies on SBFspot to generate logfiles in the spot format. It is therefore important that SBFspot is kept running in the background (e.g. as cronjob). See SBFspot.cpp for details.

  1. Search for 'OutputPath', 'Plantname', 'DateFormat', and 'TimeFormat' in the config file
  2. Build output path filename from given config strings (sprintf(szLogFile, "%s%s-Spot-%s.csv", strftime_t(m_SBFDataPath.c_str(), atime), m_SBFPlantName.c_str(), szDateStr);)
  3. Read the output file SMA_POLL_INTERVAL per minute (default once per minute), but only if the seconds in current time are >20 (probably to give SBFspot time to query)
  4. Check if the last line is newer than the one we have, if so, store and update power data

References