A fast MQTT dashboard application and rule engine framework written in C for Linux, Raspberry Pi and WINDOWS.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

137 lines
5.3 KiB

#
# Button Test Dashboard -- for MQTT-Hyperdash
# this is an example how to create buttons and potentiometers to
# manipulate MQTT topics with the mouse
#
# Global settings and default values
#
BROKER: URL="tcp://localhost:1883"
PANEL: TITLE="Button Test Dashboard" W=512 H=400 FGC=$ffffffff BGC=$40FF
#
# Static drawing, headline etc...
#
TEXT: X=20 Y=10 H=60 FGC=$FFFFFFFF TEXT="Test Dashboard" FONT="Arial" FONTSIZE=36
##########################################################################
# Demonstration of a Radio-Button Group consisting of three buttons which
# can be clicked to apply a specific value to the topic and which reflect
# the current state of the value. Note that all state changes appear on
# every panel opened simultnously, even on different computers, as long as
# they use the same broker.
#
BOX: x=20 y=80 w=200 h=120 FGC=$FF00FFFF
TEXT: x=30 y=80 H=20 TEXT="Radio Button Group" FGC=$FFFF00FF
# This is a simple button allowing to input the value of a topic
# Note that when you enter ON or OFF also the states f the buttons change...
TOPICINSTRING: TOPIC="TEST" x=110 y=152 w=100 h=30
TOPICSTRING: X=110 Y=152 W=100 H=30 TOPIC=TEST FGC=$FFFFFFFF BGC=$00FF
FRAMETOGGLE: X=108 Y=150 W=104 H=34
# this is how one ca realize a Radiobutton pair or group
# e.g. for ON/OFF Switches The Buttons also show the actual state.
#
PBOX: x=40 y=100 w=50 h=30 bgc=$444444ff
PBOX: x=100 y=100 w=50 h=30 bgc=$444444ff
PBOX: x=160 y=100 w=50 h=30 bgc=$444444ff
TEXT: x=45 y=100 w=30 h=30 TEXT="AUTO" fgc=$0078ffff FONT="Arial"
TEXT: x=110 y=100 w=30 h=30 TEXT="OFF" fgc=$ff0000ff FONT="Arial"
TEXT: x=170 y=100 w=30 h=30 TEXT="ON" fgc=$00ff00ff FONT="Arial"
TOPICINAREA: x=40 y=100 w=50 h=30 TOPIC=TEST VALUE="AUTO"
TOPICINAREA: x=100 y=100 w=50 h=30 TOPIC=TEST VALUE="OFF"
TOPICINAREA: x=160 y=100 w=50 h=30 TOPIC=TEST VALUE="ON"
FRAMELABEL: TOPIC=TEST x=40 y=100 w=50 h=30 MATCH="AUTO"
FRAMELABEL: TOPIC=TEST x=100 y=100 w=50 h=30 MATCH="OFF"
FRAMELABEL: TOPIC=TEST x=160 y=100 w=50 h=30 MATCH="ON"
##########################################################################
# Demonstration of a Ticker-Button Group which can be clicked to increment
# or decrement a value (number) of a specific topic.
#
PBOX: x=50 y=210 w=30 h=30 bgc=$444444ff
BITMAP: x=59 y=218 BITMAP="SmallTriagUp" FGC=$ffffffff
TICKER: X=48 Y=208 W=34 H=34 TOPIC=TESTT TIC=0.2 MIN=0 MAX=4
FRAMETOGGLE: X=48 Y=208 W=34 H=34
PBOX: x=50 y=290 w=30 h=30 bgc=$444444ff
BITMAP: x=59 y=298 BITMAP="SmallTriagDwn" FGC=$ffffffff
TICKER: X=48 Y=288 W=34 H=34 TOPIC=TESTT TIC=-0.2 MIN=0 MAX=4
FRAMETOGGLE: X=48 Y=288 W=34 H=34
TOPICSTRING: X=10 Y=252 W=100 H=30 TOPIC=TESTT FGC=$00ffffff BGC=$00ff
TOPICINNUMBER: X=10 Y=252 W=100 H=30 TOPIC=TESTT FORMAT="%g" MIN=0 MAX=4
FRAMETOGGLE: X=8 Y=250 W=104 H=34
#
# These Meters shall demonstrate that the values changed with the tickers
# immediately also change the meters.
#
#
VMETER: X=250 Y=100 W=25 H=140 MIN=0 MAX=4 \
AGC=$444444FF BGC=$00FF FGC=$FFFFFFFF TOPIC=TESTT
METER: X=350 Y=100 W=100 H=100 MIN=0 MAX=4 \
AGC=$444444FF BGC=$40FF FGC=$FFFFFFFF TOPIC=TESTT
##########################################################################
# Demonstration of a Scaler (potentiometer) which
# can be clicked and draged to change a specific value (number) of the topic
# and which reflect the current state of the value. Note that all changes
# appear on every panel opened simultnously, even on different computers,
# as long as they use the same broker.
#
PBOX: X=90 Y=290 W=220 H=36 BGC=$808080FF FGC=$0
FRAME: X=90 Y=290 W=220 H=36
HSCALER: X=100 Y=300 W=200 H=16 TOPIC=TESTT MIN=0 MAX=4 TIC=0.05 AGC=$0
FRAME: X=98 Y=298 W=204 H=20 REVERT=1
# This is a raw scaler wthout "decoration"
VSCALER: X=300 Y=30 W=20 H=200 TOPIC=TESTT MIN=0 MAX=4 TIC=0.05
##########################################################################
# Demonstration of a Button which excecutes a shell command on the local
# machine.
#
SHELLCMD: x=10 y=360 w=80 h=25 CMD="xload &"
PBOX: x=10 y=360 w=80 h=25 BGC=$444444FF
TEXT: x=20 y=360 w=80 h=25 TEXT="xload" FGC=$FFFFFFFF FONT="Arial"
FRAMETOGGLE: x=10 y=360 w=80 h=25
##########################################################################
# Demonstration of a Button which opens another dashboard when clicked.
#
DASH: x=110 y=360 w=100 h=25 DASH="main"
PBOX: x=110 y=360 w=100 h=25 BGC=$444444FF
TEXT: x=120 y=360 w=100 h=25 TEXT="main.dash" FGC=$FFFFFFFF FONT="Arial"
FRAMETOGGLE: x=110 y=360 w=100 h=25
##########################################################################
# Demonstration how to add sound to the change of a topic.
# This is realized via the omnipurpose SHELLCMDLABEL
# However this might work only on a linux system. Also the soundplayer
# (mplayer) needs to be installed, and it is not very quick.
# Also the command should only be excecuted on "1", so that the
# topic could change to 0 quietly. If the SOUND topic would stay at "1"
# the sould would be played already when the dashboard opens, because
# there is (probably) a retained state on publication, which is not under
# control of MQTT-Hyperdash.
#
SCMDLABEL: TOPIC="SOUND_DC" \
CMD[0]="1|mplayer /usr/share/sounds/ubuntu/stereo/window-slide.ogg"