{{#Name=History}} {{#Description=Graph or changes table for recorded device history}} {{#Version=1.0}} {{#Author=HomeSeer}} {{#CanBeDeleted=False}} {{#SaveList=save_show_title,save_title_size,save_title_color,save_title_bold}} {{# Only the cosmetic keys are in SaveList above. "Save display settings to all cards" copies }} {{# every listed key to every other History card, so the devices, the range and the content mode }} {{# must NOT appear there - one card's device list would be stamped onto all of them. }} {{default_height=280}} {{includefileraw Dashboards/Cards/Custom/Common/CommonHeader.html}} {{# ---- title, through the auto-generated settings dialog ---- }} {{sections[index]="Title"}} {{card_title= get_value 'save_title' 'History' 'Text' 'text'}} {{show_title= get_value 'save_show_title' 'on' 'Show' 'toggle'}} {{title_size= get_value 'save_title_size' '16' 'Size' 'text'}} {{title_color= get_value 'save_title_color' '#000000' 'Color' 'color'}} {{title_bold= get_value 'save_title_bold' 'on' 'Bold' 'toggle'}} {{# ---- everything else is hand-written markup further down, so it is read directly rather }} {{# than through get_value, which would also queue it into the auto-generated section. }} {{# Every default is applied with an "is it empty" test rather than relying on first_run: }} {{# first_run is only true while the widget has NO saved values at all, so a setting added }} {{# to this card in a later version reads back as "" for every card already on a dashboard. }} {{hdevices=get_saved_value 'save_hdevices' widget_id}} {{content=get_saved_value 'save_content' widget_id}} {{if content==''}}{{content='graph'}}{{end}} {{chrome=get_saved_value 'save_chrome' widget_id}} {{# Minimal by default: a card is usually a tile, and full chrome cannot fit its legend and }} {{# zoom bar into one without squeezing the plot to nothing. }} {{if chrome==''}}{{chrome='minimal'}}{{end}} {{# Grid lines behind the graph: shown unless turned off, as on the History pages. }} {{gridlines=get_saved_value 'save_gridlines' widget_id}} {{if gridlines==''}}{{gridlines='on'}}{{end}} {{range_mode=get_saved_value 'save_range_mode' widget_id}} {{if range_mode==''}}{{range_mode='rel'}}{{end}} {{rel_n=get_saved_value 'save_rel_n' widget_id}} {{if rel_n==''}}{{rel_n='24'}}{{end}} {{rel_unit=get_saved_value 'save_rel_unit' widget_id}} {{if rel_unit==''}}{{rel_unit='hours'}}{{end}} {{abs_start=get_saved_value 'save_start' widget_id}} {{if abs_start==''}}{{abs_start='0'}}{{end}} {{abs_end=get_saved_value 'save_end' widget_id}} {{if abs_end==''}}{{abs_end='0'}}{{end}} {{pagesize=get_saved_value 'save_pagesize' widget_id}} {{if pagesize==''}}{{pagesize='25'}}{{end}} {{# Seconds between auto refreshes, 0 = off. Off by default: a dashboard may hold several of }} {{# these, and a chart nobody asked to be live should not be re-fetching a month of history. }} {{refresh_secs=get_saved_value 'save_refresh_secs' widget_id}} {{if refresh_secs==''}}{{refresh_secs='0'}}{{end}} {{# The refs, in the order they are stored - that order drives colour and tab order, which is }} {{# exactly why they live in one ordered string rather than one saved key per device. }} {{hrefs=[]}} {{hcount=0}} {{if hdevices != ''}} {{for hchunk in (hdevices | string.split ';')}} {{if hchunk != ''}} {{hfields = hchunk | string.split ':'}} {{hrefs[hcount] = hfields[0]}} {{hcount = hcount + 1}} {{end}} {{end}} {{end}} {{# The tile's own height, which the card must apply itself - the grid only sets it on the }} {{# outer .grid-item. }} {{card_h=280}} {{if w.height > 0}}{{card_h=w.height}}{{end}} {{# The chart needs its height in PIXELS, not 100%: it reads the style back to decide how much }} {{# room it has, and parseInt('100%') is 100 - it would size itself for a 100px box and then }} {{# overflow the tile. Whatever the title takes is subtracted here instead. }} {{chart_h=card_h - 4}} {{if show_title=='on'}}{{chart_h=card_h - 28}}{{end}} {{if chart_h < 60}}{{chart_h=60}}{{end}}
| Time | Status | Value | Status String |
|---|---|---|---|
| Loading… | |||