SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hello SmartConnector Community,
I've been reviewing the posts here for a while, but unfortunately there is not a very large audience. If there were, I would guess that much simpler questions would have been asked. But it's getting bigger so I'm going to ask that simple question 🙂
I'm pretty new to SmartConnector. Actually, I'm pretty new to software also. I will mention about what I have to do. I would be very grateful if you could guide me in simple terms. What is required of me is to integrate an existing fire system software with EBO. Let's call this software x software. This x software gives me required information via API. I generally need to show this information on the EBO side. In rare cases, there will be things that I need to post from the EBO side to the x software side. So there is a two-way flow of data.
While the summary is like this, I reviewed all the sample projects on the SmartConnector side. I could not read any Endpoint on the EBO side. Only EWS Server has a fine flow. I'm trying to write a Custom EWS Server myself. But It would be nice to proceed in the right direction, whichever is an easy method or the more correct method. I would be very grateful if you could guide me on this.
Kind regards,
Ahmet
Link copied. Please paste this link to share this article on your social media post.
Hi,
Well that depends on your task, what i have done is create a ValueReceiveProcessor that runs forever with a variable as delay for the requests.
#region FeedbackInterval
[Required, Range(1, 300), DefaultValue(5), Tooltip("Inval speed of feedback polling in seconds")]
public int FeedbackInterval { get; set; }
#endregion
public class ValueReceiveProcessor : ProcessorBase, ILongRunningProcess
{
#region Execute_Subclass - Override
protected override IEnumerable<Prompt> Execute_Subclass()
{
for (;;)
{
CheckCancellationToken();
// Perform here your class to do the actual request
Task.Delay(FeedbackInterval * 1000).Wait();
}
}
#endregion
}
And then i created a ValuePush processor that fetch changes from EBO to push to the API
#region Lastrun
public DateTime LastRun = DateTime.Now.ToUniversalTime();
#endregion
public class ValuePushProcessor : ProcessorBase, ILongRunningProcess
{
#region Execute_Subclass - Override
protected override IEnumerable<Prompt> Execute_Subclass()
{
for (;;)
{
CheckCancellationToken();
WriteUpdatesFromEBO();
Task.Delay(100).Wait();
}
}
#endregion
#region WriteUpdatesFromEBO
protected void WriteUpdatesFromEBO()
{
// Reload database context to get latest values (update of DataAdapter)
DataAdapter.CreateDatabaseContext();
// Get changed items from the DataAdapter
var updatedValueItems = DataAdapter.ValueItems.Where(vi => vi.LastModified > LastRun).ToList();
// Send command based on changed value to Versosol API
foreach (var updatedValueItem in updatedValueItems)
{
// Do stuff on a changed item in the EWS server
}
LastRun = DateTime.Now.ToUniversalTime();
}
#endregion
}
Link copied. Please paste this link to share this article on your social media post.
Hi,
The SmartConnectorWeatherSample code should cover 99% of your request..
Here are the introduction videos that takes you step by step to the process
BR,
Erwin
Link copied. Please paste this link to share this article on your social media post.
Hi Ahmet,
If your fire system supports OPC server connectivity, then you don't need to develop anything. You can simply use the EBO-OPC Client software. See this link.
Regards,
Michael
Link copied. Please paste this link to share this article on your social media post.
Thanks for reply Erwin,
You can be sure that I have reviewed the developer guide completely and watched the videos(I might be as professional as others maybe). But unfortunately they do not fully meet what I want. At least I can describe it this way, for example. In the SmartConnectorWeatherSamples project, UpdateProcessor has to be run repeatedly to update the data. I want to make it permanent. at least send a request to the API that I provide data from outside at certain periods.
In this sense, only the EWS Server is running all the time and I guess this can provide what I want. Am I thinking right about this? Should I work on Custom EWS Server to keep data up to date from API? Or should I design a LongRunningProcessor that comes to my mind and make periodic requests over the processor? Do you have any comments about this? Am I thinking wrong on some point?
Kind Regards,
Ahmet
Link copied. Please paste this link to share this article on your social media post.
Thank you Michael.
Maybe i should ask this to relevant people. I know they don't have at the moment. But maybe they might choose this solution and make some changes. Thank you.
Kind Regards,
Ahmet
Link copied. Please paste this link to share this article on your social media post.
Hi,
Well that depends on your task, what i have done is create a ValueReceiveProcessor that runs forever with a variable as delay for the requests.
#region FeedbackInterval
[Required, Range(1, 300), DefaultValue(5), Tooltip("Inval speed of feedback polling in seconds")]
public int FeedbackInterval { get; set; }
#endregion
public class ValueReceiveProcessor : ProcessorBase, ILongRunningProcess
{
#region Execute_Subclass - Override
protected override IEnumerable<Prompt> Execute_Subclass()
{
for (;;)
{
CheckCancellationToken();
// Perform here your class to do the actual request
Task.Delay(FeedbackInterval * 1000).Wait();
}
}
#endregion
}
And then i created a ValuePush processor that fetch changes from EBO to push to the API
#region Lastrun
public DateTime LastRun = DateTime.Now.ToUniversalTime();
#endregion
public class ValuePushProcessor : ProcessorBase, ILongRunningProcess
{
#region Execute_Subclass - Override
protected override IEnumerable<Prompt> Execute_Subclass()
{
for (;;)
{
CheckCancellationToken();
WriteUpdatesFromEBO();
Task.Delay(100).Wait();
}
}
#endregion
#region WriteUpdatesFromEBO
protected void WriteUpdatesFromEBO()
{
// Reload database context to get latest values (update of DataAdapter)
DataAdapter.CreateDatabaseContext();
// Get changed items from the DataAdapter
var updatedValueItems = DataAdapter.ValueItems.Where(vi => vi.LastModified > LastRun).ToList();
// Send command based on changed value to Versosol API
foreach (var updatedValueItem in updatedValueItems)
{
// Do stuff on a changed item in the EWS server
}
LastRun = DateTime.Now.ToUniversalTime();
}
#endregion
}
Link copied. Please paste this link to share this article on your social media post.
Erwin thank you so much.
I needed something like this. Your answer will be the solution i believe also. I wish I had asked earlier. Thanks again.
Best Regards,
Ahmet
Link copied. Please paste this link to share this article on your social media post.
Hi,
Keep in mind that i use NuGet Package SmartConnector.Utilities and for this you need to copy SmartConnector.Utilities.dll thogether with the .dll assembly to the SC folder when deploying.
Some code might make use of this classes
BR,
Erwin
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.