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

Offline lakewoodjazz

  • Jr. Member
  • **
  • Posts: 53
  • 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: 1572
  • Karma: +110/-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

  • Jr. Member
  • **
  • Posts: 53
  • 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: 6384
  • Karma: +290/-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

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1741
  • Karma: +101/-27
  • 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 (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline lakewoodjazz

  • Jr. Member
  • **
  • Posts: 53
  • 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

Offline lakewoodjazz

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +1/-0
Re: Lua code to delete Alerts
« Reply #6 on: January 21, 2019, 11:46:33 pm »
So...... No lua code can be written to delete 100 or even 200 alerts?
We have the option to delete 10, 25 or 50 but sadly Customer support was of no help.....