Final project questions before implementation

Hi:
I’ve created a Blynk project that monitors my security alarm and allows remote arming and disarming along with providing alarm status. A email is sent when the alarm is armed or an alarm is trigger. My monitoring company charges $10 / month for this remote service. So this was my justification.

I have also implemented a local Blynk server running on a Rasberry Pi 3B. With the capability to access it from anywhere.

But my app still requires the following features / questions:

  1. Capability to save an activity log to a CSV file automatically on the server or have it emailed every 30 days. This will provide a activity log for my insurance company that show monitoring activity. I have looked at the History Widget but is lacks the automatic feature.
  2. Provide a private IOS / Android APP to those authorized. So is there a way to “privately” publish my App?
  3. Customize UI interface so user know they have the right APP. Running an APP call Blynk doesn’t work for me.
  4. Also does the Blynk local server have the 15 second limitation for sending emails and SMS messages too? I already developed the code to handle this limitation but wanted to know if it was needed?

Now for the bad news. This is a private app and not for resale. But I would be willing to help others that have a DMP security system to implement the same.

All thoughts and ideas welcome. Thank you for Blynk.

5310

It depends how much data you have to send. If it’s minimal you could automatically email it via the app every 30 days. If there is a lot of data the app could email you every 30 days with the url for the automatic pin data history download in csv format. I believe the csv contains 3 months data so it wouldn’t matter if you didn’t click the url in the email for a few days after receiving the email.

It would depend on the scale of your operation. The normal process is for the app to go on the Google and Apple stores. Technically they could be private (not published on the store) but this is likely to cost you more because it’s not the normal procedure for apps. The apps will only work with tokens / hardware so I’m not sure why a public app would be a problem.

That is normal for published apps

You can remove the limitation.

Hi:

Thanks for the quick reply.

Can you give we a little more direction on “HOW TO” accomplish items 1 and 5.

Item 1 has minimal data so what do you suggest I use?.

And how do I remove the limitation? I thought maybe it was eliminated just by using a local server.

I look forward to your response.

5310

Easy bit first:

server.properties file on a local server has this entry, just adjust the 15 (seconds) accordingly.

#this setting defines how often we can send mail/tweet/push or any other notification. Specified in seconds
notifications.frequency.user.quota.limit=15
1 Like

@5310

Do be aware though that service providers have their own limits, so if you have a 1s trigger that is constantly activated that could be 86,400 emails per day. Well above Gmail’s maximum of 500 per day.

You say you don’t have much data yet you want to reduce the 15s minimum notification period.

Can you elaborate on the amount of data you are working with.

Is it as low as a single 0 or 1 every day for the month (or potentially even less if data only occurs when an alarm triggers etc) or dozens of pins with associated Strings etc.

1 Like

@5310 very good questions.

  1. This will be the feature of the new graph we are working right now. The new graph will be released in 1-2 weeks. Scheduled reports in 1-2 months;
      • this is paid features - http://www.blynk.io/plans/. On the local server you cna restrict access to specific account emails if needed.
  2. see @Costas answer

Costas:
I’m only looking to capture alarm activity so it would be minimal. Date, time and the text string that was emailed when the activity occurred and any actual alarm triggers. My guess would be less than 10 per day most likely less. So the new History Widget features you’re implementing would probably work just fine.

I would be happy test them for you. .I’ve always believe in paying it forward and your team has been so responsive and helpful. So let me know if I can help.

Wish I knew about the notification limit feature. I think I spent more time coding the email timing function to only send one email every 15secs than the rest of the app. You see, when an alarm is triggered multiple emails are needed to be sent. I was a learning experience.

It looks like I’ll miss many of the new features you are implementing in Blynk because I don’t think I’ll ever be more the a newbie developer.

5310

To different people?

If so it would be better to have an email forwarding system, received by 1 and forwarded to 10 others.[quote=“5310, post:7, topic:16143”]
My guess would be less than 10 per day most likely less.
[/quote]

Must have a lot of burglars in your area :slight_smile:

Good one about the area. The emails are sent went the system is armed or disarmed. So some days there’ll be none and others more. Email forwarding was an idea but I’d need multiple emails because based on the type of alarm they are sent to different individuals. The arming / disarm are sent only those that have access. Others get real fire or burglary alarms so they can call the appropriate authorities.

I’ve tested by email code and is works for sending the needed emails every 15 seconds. So if there is a burglary alarm, four emails are sent in just over 1 minute. Two end up as SMS message and the other regular emails. So I think I’m good on this one.

But how do I turn the virtual writes of date, time and text into a CSV file and then email the file on a set number of days timetable? If the App can’t, I was thinking of using the local server to email it. How is the file named and is it placed in the dataFolder as I suspect? Do you have a code snippet to share?

5310

That feature was removed a long time ago. In the docs for local server you will see reference to db set up, which is disabled by default. So setting up the database would be one way for you to go.

Are using the Pi as the server and the MCU or do you have a separate MCU like an ESP8266?

A typical message might be 50 characters and with 10 per day and 30 days per month it will go over the 1 or 2 kb maximum email size that you can send with BLYNK_MAX_SENDBYTES.

Once I know which MCU you are using I’ll advise further.

@5310 a screenshot of an email you can code up in your Blynk project to be automatically sent to you every 30 days.

Add RTC widget, add 1 to a counter when time is 00:01:00, virtualWrite counter to Blynk server, sync counter pin in BLYNK_CONNECTED() in case your MCU reboots during the 30 days. When counter equals 30, reset the counter and call emailReminder().

void emailReminder(){
    char auth[] = "1234567890abcdefghij098765432101";
    char blynk_server[] = "blynk-cloud.com";
    String emailbody = "Please click the following url to obtain pin data for the last 3 months<br>";
    emailbody += "http://" + String(blynk_server) + "/" + String(auth) + "/data/V25<br>";
    emailbody += "Thanks for using My Smartphone Alarm App";
    Blynk.email("yourname@gmail.com", "My Alarm Smartphone App", emailbody);
  }

Just a temporary hack for now. Ensure pin data is only updated at 1 minute intervals or longer. If you don’t you will see average data in the csv not actual data.

1 Like

If you want an easier way to do this:

Make a value widget, say vpin 4, and write each action to that vpin with a timestamp associated with it. Make a webhook to write the value of that vpin to an mqtt online service like io.adafruit.com, make an IFTTT to record the value of your io.adafruit.com feed to a google sheets file.

1 Like

@taitrt why not just send the data straight to Google Sheets with Blynk’s Webhook widget? It cuts out the need for io.adafruit.com and IFTTT, works well.

1 Like

Ah, I guess the best answer is that I don’t know how to do it that way! I didn’t know there was a google sheets web api, although I guess that makes sense that they have one. I agree, your way is better.