elradix

Easyplus Reset log

Jun 4th, 2019
163
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #### Easyplus Reset Log config ##
  2.  
  3. ### start file /opt/scripts/easyclean.sh  ###
  4. #!/bin/bash
  5.  
  6. # remove old log
  7. rm /opt/scripts/status/data.log
  8.  
  9. # copy clean log to new  log  (just do renew or getdata via telnet and copy data to clean log "data.logs")
  10. cp /opt/scripts/status/data.logs /opt/scripts/status/data.log
  11.  
  12. ## NEW TELEGRAM NOTIFICATION - you can also use your old one :))
  13. #
  14. # http://www.bernaerts-nicolas.fr/linux/75-debian/351-debian-send-telegram-notification
  15. # https://github.com/NicolasBernaerts/debian-scripts/blob/master/telegram/telegram-notify-install.sh
  16.  
  17.  
  18. telegram-notify --success --text "Easyplus *log* cleared "
  19.  
  20. ### end file /opt/scripts/easyclean.sh  ####
  21.  
  22. chmod u+x  /opt/scripts/easyclean.sh
  23.  
  24. #### START HASS CONFIG ###
  25.  
  26. ### sensor ###
  27.   - platform: filesize
  28.     file_paths:
  29.       - /opt/scripts/status/data.log
  30.  
  31. ### shell_command ###
  32.   easyclean:          !secret shell_command_easyclean
  33.  
  34. ### secret
  35.   easyclean:          !secret shell_command_easyclean
  36.  
  37. ### script
  38. easyclean:
  39.   alias: Easyclean Log
  40.   sequence:
  41.     - service: shell_command.easyclean
  42.  
  43. #### END HASS CONFIG ###
  44.  
  45.  
  46. ### START LOVELACE ###
  47.  
  48.   - entity: sensor.data_log
  49.     icon: 'mdi:file'
  50.     name: Easyplus Log
  51.   - entity: script.easyclean
  52.     icon: 'mdi:tumblr-reblog'
  53.     name: Log Reset
  54.     tap_action:
  55.       action: toggle
  56.  
  57. ### END LOVELACE ###
RAW Paste Data