Announcement

Collapse
No announcement yet.

[one-liner] Device icon/status string update

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [one-liner] Device icon/status string update

    Summary:
    This snippet of code can be used in scripts but is more likely to be of use as a one-liner (a HomeSeer command preceded by an ampersand (&) used in the "Scripts" line of an event). Used in this way in an event with an device status change, it will allow you to set a custom devices string, possibly including an icon, based on the device's status.

    Note: it's probably better, if you're doing this with a lot of devices, to make one callback function to do this. Others (notably UltraJones) have developed such scripts so I'll just refer you to theirs. This one-liner is better for doing a handful of them, since each device will need its own event.

    Installation:
    Make an event that is triggered by status changes on the device you want to give a custom string to. Copy and paste into the Scripts line of your event. Change the devicecode to that of the device -- note that it appears twice, once near the beginning and once near the end. Then change the elements in the string to whatever you want to show for on, off, and dim. The example version below shows a Christmas Tree icon in on, off, and dim states, using the text "On", "Off", and "Dim". You can leave out the icons, change the text (for instance "Open" and "Closed"), etc.

    Revision History:
    v1.0 2002-02-10: first posted to Scripts Library

    Snippet:
    &hs.SetDeviceString "L13", hs.StringItem(";<img src='icons/devices/christmaslights-on.gif' align=absmiddle> On;<img src='icons/devices/christmaslights-off.gif' align=absmiddle> Off;<img src='icons/devices/christmaslights-dim.gif' align=absmiddle>Dim;;;;;;;;;;;;;Unknown",hs.DeviceStatus( "L13"),";")

    Nucleus Home Automation
    News, support, and updates for Rover, Network Monitor, TimeIcons, and more
Working...
X