Thanks for the reply, but I actually figured it out using rules a completely new item:
If anyone was wondering, this is how I did it… Sorry if it is bad explination…
I created a new item that will be associated with a number, that number in turn will change the icon depending on which state it was selected/in.
active.map
0=Off
1=On
2=Turning Off
3=Turning On
system.items
Number TurnOnOffPC "My PC" <computer> (gComputers, gMasterBedroom)
Switch mpcon "MyPC On" <computer> { wol="192.168.1.255#D8:CB:8A:C5:13:93" }
Switch mpcoff "My PC Off" <computer> { channel="exec:command:micropcofft:run" }
Number TurnOnOffPC "My PC" <computer> (gComputers, gMasterBedroom)
wol.rules
rule "MyPC New onoff"
when Item TurnOnOffPC received command
then switch (receivedCommand)
{
case 3: { mpcon.sendCommand(ON)
}
case 2: { mpcoff.sendCommand(ON) }
}
end
rule "TurnOnOffPC ON"
when
Item Presence_Justin_Computer changed from OFF to ON
then TurnOnOffPC.postUpdate("1")
end
rule "TurnOnOffPC OFF"
when
Item Presence_Justin_Computer changed from ON to OFF
then TurnOnOffPC.postUpdate("0")
end
home.sitemap
Switch item=TurnOnOffPC label="My PC[]" mappings=[3="Wake Up", 2="Shutdown"]
Then I have four icons.
computer-0.png
computer-1.png
computer-2.png
computer-3.png
When I change click “Wake up” on the sitemap it changes the Number and icon to “computer-3” then calls my WOL rule/code.
Once my PC is on and is detected by my network the item Presence_Justin_Computer is updated and the rule automatically changes that number to “1” which in turn changes the icon to “computer-1”
Once I click Shut Down it changes the icon to “computer-2” and calls the Shutdown command
Finally when the network cannot ping my pc after my set time it changes the Switch Presence_Justin_Computer to off which changes the icon to “computer-0”
Hope this helps someone one day, took me some brainstorming and a little logic
!