Author Topic: Lua code to delete Alerts  (Read 239 times)

Offline lakewoodjazz

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +1/-0
Lua code to delete Alerts
« on: January 06, 2019, 12:48:01 am »
Can anyone help write a lua code to use in a scene to delete all the Alerts? Currently we have a max of 50?

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1469
  • Karma: +96/-31
Re: Lua code to delete Alerts
« Reply #1 on: January 07, 2019, 06:47:46 am »
The alerts are stored in a file and there are several posts on this forum how to play with that.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline lakewoodjazz

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +1/-0
Re: Lua code to delete Alerts
« Reply #2 on: January 08, 2019, 07:34:31 am »
Hi Rene
Thanks for getting back to me. I have searched  the forum with no success asking "Removing Alerts files", "lua code to delete Alerts", also just asking "Alerts" . Most of the replies are about help or questions dealing with the app Vera Alerts. If you could point me in
the right search terms you used that would be much appreciated.
Regards

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6249
  • Karma: +281/-70
  • "Less is more"
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1511
  • Karma: +78/-26
  • HA ≠ IOT as a blue sky is cloudless.
Re: Lua code to delete Alerts
« Reply #4 on: January 09, 2019, 04:20:51 am »
The alerts.json and the content of the /etc/cmh/persist folder are the two contents to delete and then run a luup reload to get rid of the alerts. The longer history might be from the server which I am not sure if you can delete.
openLuup (97 devices, 134 scenes, 20 apps) controlling HomeAss + VeraPlus (138 zwave nodes, 8 Zigbee nodes, 210 devices, 20 scenes , 2 app) Bridged to Homekit and Alexa. VeraPlus ExtRooted and network isolated.

Offline lakewoodjazz

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +1/-0
Re: Lua code to delete Alerts
« Reply #5 on: January 10, 2019, 07:44:14 am »
Thanks for the help directing me to posts that are addressing the issue of deleting the mass alerts from PIR and door/window sensors.
From reading through all the pages I found the lua code suggested below but it  is only deleting the 10 Alert Notifications on the Dashboard page.
Is there any type of code to delete the Alerts in the User
Accounts drop down location? or Code to manually run that deletes more then 50 at a time?
I contacted support to no avail.


Quote from: MLEBAUGH on February 12, 2016, 03:28:55 pm
Try this:

I have a manually-triggered scene called 'Reload Luup' which runs the following lua code:

  os.execute("rm /etc/cmh/alerts.json")
  luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "Reload", {}, 0)

A browser refresh after that should make all your alerts disappear.

http://forum.micasaverde.com/index.php?topic=34695.0

MLEBAUGH,

Thanks for answer, but thats not what i meant.
This code is for deleting the last 10 alerts which are there in the dashboard view.
But i want simply delete ALL alerts in the Tab : Users and account info, and then tab Alerts.
There i have thousents of alerts and want simply delete them all