Latest Domoticz and SBFspot 3.9.5 not working?

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
rasper
Posts: 21
Joined: Sunday 10 January 2016 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Netherlands
Contact:

Latest Domoticz and SBFspot 3.9.5 not working?

Post by rasper »

Has anyone the latest SBFspot (3.9.5) and Domoticz (either latest stable or beta) working? I installed SBfspot using the standard way:

Code: Select all

curl -s https://raw.githubusercontent.com/sbfspot/sbfspot-config/master/sbfspot-config | sudo bash
and SBfspot is working correctly when used from command line. When adding SBFspot to domoticz hardware I do not get any new devices (accept new devices is on) and when importing data from the sma hardware item in Domoticz it doesn’t import anything. It states no sensors found, so suspect it can’t find the database or csv files (these are generated too). Debug logging does not say anything where domoticz is looking for the data.

Anyone the golden tip?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Latest Domoticz and SBFspot 3.9.5 not working?

Post by waltervl »

Did you check this wiki page for instructions and file locations: https://www.domoticz.com/wiki/SMASpot_M ... n_Domoticz
I do not know if it is up to date. Latest modified in april 2020 so if something changed in SFBSpot during that time it could influence Domoticz integration.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rasper
Posts: 21
Joined: Sunday 10 January 2016 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Latest Domoticz and SBFspot 3.9.5 not working?

Post by rasper »

waltervl wrote: Tuesday 09 August 2022 16:16 Did you check this wiki page for instructions and file locations: https://www.domoticz.com/wiki/SMASpot_M ... n_Domoticz
I do not know if it is up to date. Latest modified in april 2020 so if something changed in SFBSpot during that time it could influence Domoticz integration.
Yes, I did, maybe should try to set-up an older version of SBFspot, but am reluctant to stick with an old version unable to update.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Latest Domoticz and SBFspot 3.9.5 not working?

Post by waltervl »

So do you have sbfspot running as a service or with crontab?
Did you copy the cfg file to the correct location?
On the wiki it is explained were to look, do you see that file?
Is your sbfspot cfg file correct?

Add SBFspot to Domoticz

In Domoticz hardware section, add "SBFSpot (SMA)", for location, enter the SBFspot.cfg path (e.g. /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:

/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.

Search for 'OutputPath', 'Plantname', 'DateFormat', and 'TimeFormat' in the config file
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);)
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)
Check if the last line is newer than the one we have, if so, store and update power data
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rasper
Posts: 21
Joined: Sunday 10 January 2016 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Latest Domoticz and SBFspot 3.9.5 not working?

Post by rasper »

Had some time to look into it a bit more, SBFspot works, files are generated, but not being picked up by Domoticz. When trying to import historical data, I get the error “can not find sensor in database”. I looked into the SBFspot.cpp sourcecode and it seems I hit this part of the code:

Code: Select all


		//Lets create the sensor, and try again
		SendMeter(0, 1, 0, 0, "SolarMain");
		result = m_sql.safe_query("SELECT ID FROM DeviceStatus WHERE (HardwareID==%d) AND (DeviceID=='%q') AND (Type==%d) AND (Subtype==%d)",
			m_HwdID, "00000001", int(pTypeGeneral), int(sTypeKwh));
		if (result.empty())
		{
			Log(LOG_ERROR, "SBFSpot Import Old Month Data: FAILED - Cannot find sensor in database");
			return;
		}

It seems that Domoticz creates the sensor but then cant find it? Despite the error, I afterwards do have the SolarMain device in Domoticz, but without any data….

Anyone some idea?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Latest Domoticz and SBFspot 3.9.5 not working?

Post by waltervl »

What does the log of Domoticz say? As it should give some hints on this.

History data will probably only work if there are sensors created. Did you check the devices list for new devices and activated the devices created by the gateway by pressing on the green arrow?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest