E-mail about channel state-data

Hi!
I have created dashboard with all channels based on device monitor adapter. I want to create e-mail notifier when there are no data in some channel.
How I understand, first I need to add new Adapter with type E-mail notifier. What should be setted in Connection string?
Then I guess Notification channel should be added in Grafana. At the moment it gives me error when testing - SMTP not configured…

Can you please give instructions step by step, how to get e-mail when there are no data in channel?

I usually use this adapter:

  • Email Notification - (action) sends an e-mail when time-series values trigger a Boolean expression as True

When you add the adapter, you need to trigger off a measurement value, commonly a boolean value like an alarm that is triggered when the value is > 0. There connection string parameters on the adapter to set the SMTP server and other e-mail properties.

Thanks,
Ritchie

How can I check if notification was sent from OH, or status about what adapter did/did not?

This is my example configuration for adapter. E-mail is not recieving.
VariableList={x = PPA:399; y = PPA:399}; ExpressionText=x+y > 0; Body=test; From=OHmanager@tester.lv; SmtpServer=mail.xxxxxx.lv; Subject=Status; ToRecipients=andis.xxxxxxxx@xxxxxxxxx.lv

Open the remote console application, standalone app, or from inside UI or web-based manager application, and enter the command ls /a (or list /a) - this will enumerate all action adapters. For reference ls /i will enumerate input adapters, ls /o will enumerate output adapters and ls /f will enumerate filter adapters.

One of these should be your e-mail notification adapter. This will have a name and an associated run-time ID. Enter the following command ls <id> (or ls <name>) where <id> is the run-time ID of your adapter (or where <name> is the given name of your adapter). For example, if your e-mail adapter had an ID of 12, you would enter ls 12 into the console and press enter. Note that text you are typing can be interrupted by ongoing service messages, in these cases just keep typing, your keystrokes are being recorded and will still provide proper feedback.

The status information that gets returned for your adapter will include statistics on the number of expression successes, failures and total e-mail operations as well as other operational adapter details.

Hope that helps!

Thanks,
Ritchie

This is the adapter info what I got from console:


Do you see there something incorrect/suspicious?

Yes - it shows that the operational status is “Stopped” - this could indicate a configuration issue.

With the remote console open, try the following command INIT 36 - and see if any initialization errors are indicated.

This is what I got in console:
init_36.zip (1.1 KB)

So this line:

[Action Adapter Collection] Failed to initialize adapter EMAIL!NOTIFIER: An item with the same key has already been added.

Can you send a copy of your connection string?

You mean this?

VariableList={x = PPA:399; y = PPA:399}; ExpressionText=x+y > 0; Body=test; From=OHmanager@tester.lv; SmtpServer=mail.xxxxxx.lv; Subject=Status; ToRecipients=andis.xxxxxxxx@xxxxxxxxx.lv

One more thing. In Grafana notification channel settings, after presing Test button, I got this message:

In your connection string:
VariableList={x = PPA:399; y = PPA:399}; ExpressionText=x+y > 0; Body=test; From=OHmanager@tester.lv; SmtpServer=mail.xxxxxx.lv; Subject=Status; ToRecipients=andis.xxxxxxxx@xxxxxxxxx.lv*

You have a variable named x and another named y both pointing to the same key PPA:399 - these need to point to unique keys. This is what’s causing the error you see during initialization.

Per Grafana issue - you will need to manually specify the SMTP server in the Grafana configuration file to get e-mailed alerts.

If you are using Grafana installed with the openHistorian, you can find this file in a location similar to the following:
C:\Program Files\openHistorian\Grafana\conf\custom.ini

Find the section labeled [smtp] to enter your Simple Mail Transport Protocol settings, like DNS name or IP of your SMTP server used to relay e-mail.

Grafana will need to be restarted to apply any changes. If you are running the Grafana instance from within openHistorian, you can restart Grafana by reinitializing the GRAFANA!PROCESS adapter which can be found in the openHistorian Manager UI under the “Actions / Manage Custom Actions” menu. You can also restart Grafana by running the openHistorian Remote Console application and typing the following: init GRAFANA!PROCESS.