Skip to content

Instantly share code, notes, and snippets.

@7wells
Last active October 24, 2023 17:05
Show Gist options
  • Save 7wells/06aa69f98d8dad2c864ca4a3798dab5f to your computer and use it in GitHub Desktop.
Save 7wells/06aa69f98d8dad2c864ca4a3798dab5f to your computer and use it in GitHub Desktop.
FHEM - How to add menu entries to FHEM's WebGUI
# How to add menu entries to FHEM's WebGUI:
#
# Click "Edit files" in navigation bar, then click on fhem.cfg
# In the new window, add following line to fhem.cfg (consider making a backup of fhem.cfg first):
attr WEB menuEntries Update,cmd=update,UpdateCheck,cmd=update+check,Restart,cmd=shutdown+restart
# To also add a menu entry for log file deletion, define an alias for the deletion command and add the menu entry, e.g.:
#
define c_dellog cmdalias dellog AS {qx(truncate $currlogfile --size 0);;Log 1, "logfile deleted";;}
attr WEB menuEntries Update,cmd=update,UpdateCheck,cmd=update+check,Restart,cmd=shutdown+restart,DeleteLog,cmd=dellog
# To add to the menu a link that opens in a new tab, use this (it is "hacky" but seems to work), e.g. two links:
#
attr WEB menuEntries Link1,http://name.domain.com:1234' target='_blank,Link2,http://name.domain.com:5678' target='_blank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment