Indirect Tiles

Are there any tiles that can be configured indirectly, being if a status of a device indicated on /off, but I want the tile or another tile to indicate Open/Close, not on/off

One simple way to do this is to use a virtual device whose state reflects the state of the device in question. And then display the virtual device in a tile.

For example, create a virtual contact sensor, and then setup a rule that sets the state of the contact sensor to be open when the desired switch is on, and closed when the switch is off.

Then use the virtual contact sensor in your dashboard with the contact sensor template.

did what you recommended, but I do not see the virtual device in my pick list for the tile

Where are you trying to find the device? In the built-in dashboard tool? Or in a rule or other app? If in the dashboard you do need to enable the device in the dashboard app settings before it will be available in the dashboard creator, just in case you forgot that step

Im not seeing the virtual in the built-in dashboard tool. Maybe Im missing a step, but a created the virtual contact sensor, I can toggle it and I do see it changing status in the device configuration, and I did save it, but it does not show up in the dashboard as a active device for me to select

I do see the virtual device when I created a rule, so I know the virtual device was created

Go to the Dashboard in your list of Apps, and enable the virtual device for the particular Dashboard you wish to use it in.

Then you’ll be able to select it in that Dashboard.

3 Likes

that was the issue. thanks for your help

4 Likes

Im new to hubistat, i need a go-by for the rule you mentioned "a rule that sets the state of the contact sensor to be open when the desired switch is on, and closed when the switch is off."

Sorry, this is my first attempt using rules, and Im confused

he rule does not work using the virtual Contact Sensor because the rule cannot use that as command because it is an input, not like a switch

Is your aim to simply have something indicate on your dashboard when a certain thing is true or open or on? If so you could use a boolean variable with a connector device that will show on your dashboard. Call it something like DoorOpen, then it would be DoorOpen true or false. Would that do?

I need it to show "Open" when the state "off", and show "Closed "when the state is "on"

This is an example of what your rule should look like (there are many other ways of doing this, but I like this somewhat mundane approach):

And, you can import the following into Rule Machine to re-create it using your switch and your virtual contact sensor.

Switch to Contact

{"deviceReplacements":{"4198":{"deviceName":"Zooz Central Scene Switch","deviceLabel":"Attic Light","deviceTypeName":"Zooz Central Scene Switch","deviceTypeNamespace":"hubitat"},"5447":{"deviceName":"Virtual Contact Sensor","deviceLabel":"","deviceTypeName":"Virtual Contact Sensor","deviceTypeNamespace":"hubitat"}},"appReplacements":{"5619":{"appTypeName":"Rule-5.1","appTypeNamespace":"hubitat","appType":"sys","appName":"Rule-5.1","appLabel":"Switch to Contact","parentAppInstalledAppId":"5523","parentAppTypeName":"Rule Machine","parentAppTypeNamespace":"hubitat","parentAppName":"Rule Machine","parentAppLabel":"Rule Machine","childApps":{},"singleInstance":false}},"appData":{"5619":{"state":{"parens":{"1":0},"actionDone":true,"ndx":5,"dateFormat":"yyyy-MM-dd","installedRules":[],"clonedName":"Switch to Contact","selectActionsParams":{"label":"Switch to Contact"},"editCondIf":null,"stopOnST":false,"usesTime":false,"inIf":null,"trigCustoms":["switch"],"repeating":null,"capabDone":true,"locationBlocked":[],"pbFixed":true,"inRepIf":null,"ruleNdx":2,"actionList":["1","2","3","4","5"],"firstR":{"1":false},"timeTriggers":[],"locVars":{},"allVarsO":[],"actLabelIndent":"","varSettingsUpdated":true,"certainTimes":[],"allVarsS":[],"allVarsT":[],"prevState":{"PB":"true","4198":"off"},"eval":{"1":[2]},"capabstrue":{"1":"Attic Light(<span style='color:black'>off</span>) turns *changed*"},"installedCapabs":["Configuration","RelativeHumidityMeasurement","ColorMode","HealthCheck","Initialize","PowerSource","SpeechSynthesis","Momentary","DoubleTapableButton","Light","TamperAlert","Battery","Valve","CarbonMonoxideDetector","ZwMultichannel","PresenceSensor","ColorControl","SignalStrength","Polling","ChangeLevel","PowerMeter","Switch","IlluminanceMeasurement","Tone","Bulb","Sensor","WaterSensor","EnergyMeter","ThreeAxis","VoltageMeasurement","ContactSensor","Notification","Refresh","ReleasableButton","ColorTemperature","SwitchLevel","HoldableButton","MotionSensor","DoorControl","Outlet","Telnet","Actuator","Thermostat","AudioVolume","LockCodes","PushableButton","GarageDoorControl","Lock","TemperatureMeasurement","AccelerationSensor","Alarm","SmokeDetector","Chime"],"paramNdx.2":1,"paramNdx.4":1,"lastEvtDate":"2022-06-23","nestedInIf":[],"actions":{"1":{"wait":null,"delay":"","modes":{},"method":"getIfThen","indent":"","rule":1,"label":"IF (Attic Light(<span style='color:black'>off</span>) is on<span style='color:orange'>(F)</span><span style='color:orange'> [FALSE]</span>) THEN\\n","cond":0},"2":{"wait":null,"delay":"","modes":{},"method":"getDefinedAction","indent":"\\t","rule":null,"label":"\\tclose() on Virtual Contact Sensor\\n","cond":0},"3":{"wait":null,"delay":"","modes":{},"method":"getElse","indent":"\\t","rule":null,"label":"ELSE\\n","cond":0},"4":{"wait":null,"delay":"","modes":{},"method":"getDefinedAction","indent":"\\t","rule":null,"label":"\\topen() on Virtual Contact Sensor\\n","cond":0},"5":{"wait":null,"delay":"","modes":{},"method":"getEndIf","indent":"","rule":null,"label":"END-IF\\n","cond":0}},"usesDate":false,"actNdx":6,"lastEvtValue":0,"allVarsGT":[],"installed":true,"waitEvents":[],"private":"true","allVars":{},"simpleCond":false,"changedValues":true,"nestedRepIf":[],"lastEvtTime":"17:17","condOper":"cond","nestedElse":[],"allVarsI":[],"varTriggersFixed":true,"needWaitCancel":false,"cutAction":[],"allVarsD":[],"broken":false,"stopped":false,"rulesList":[],"nestedLabel":[],"oldInputAct":true,"inputAct":true,"waitCondNdx":1,"token":1,"hasElse":null,"capabsfalse":{"2":"Attic Light(<span style='color:black'>off</span>) is on"},"stPrimed":true,"timeTriggersW":{},"allLocalVars":{},"varSettingsOld":{},"timeFormat":"HH:mm","olddValues":true,"needWaitDone":false},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Switch"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"copyAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"useLastDev.4","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"butEndIf","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cCmd.2","type":"enum","value":"close"},{"deviceList":null,"multiple":false,"name":"useLastDev.2","type":"bool","value":""},{"deviceList":null,"multiple":true,"name":"disableAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"cond","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"not2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"useST","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cCmd.4","type":"enum","value":"open"},{"deviceList":null,"multiple":false,"name":"actSubType.1","type":"enum","value":"getIfThen"},{"deviceList":null,"multiple":false,"name":"tstate1","type":"enum","value":"*changed*"},{"deviceList":null,"multiple":false,"name":"actSubType.2","type":"enum","value":"getDefinedAction"},{"deviceList":null,"multiple":false,"name":"actSubType.3","type":"enum","value":"getElse"},{"deviceList":null,"multiple":false,"name":"actSubType.4","type":"enum","value":"getDefinedAction"},{"deviceList":null,"multiple":false,"name":"butElse","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"myCapab.2","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"myCapab.4","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"dValues","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actType.1","type":"enum","value":"condActs"},{"deviceList":null,"multiple":false,"name":"editToken","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Switch to Contact"},{"deviceList":null,"multiple":false,"name":"eraseRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actType.3","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actType.2","type":"enum","value":"modeActs"},{"deviceList":null,"multiple":false,"name":"delayAct.2","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"actType.4","type":"enum","value":"modeActs"},{"deviceList":null,"multiple":false,"name":"delayAct.4","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"hasRule","type":"button","value":""},{"deviceList":{"4198":"Attic Light"},"multiple":true,"name":"rDev_2","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"cpType1.4","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":{"4198":"Attic Light"},"multiple":true,"name":"tDev1","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"cpType1.2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":{"5447":"Virtual Contact Sensor"},"multiple":true,"name":"devices.2","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":false,"name":"pointless","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":{"5447":"Virtual Contact Sensor"},"multiple":true,"name":"devices.4","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":true,"name":"cutAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"state_2","type":"enum","value":"on"},{"deviceList":null,"multiple":false,"name":"rCapab_2","type":"enum","value":"Switch"},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"oper","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actSubType.5","type":"enum","value":"getEndIf"},{"deviceList":null,"multiple":false,"name":"actType.5","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actType.6","type":"enum","value":""}],"subscriptions":[{"handler":"allHandler","name":"switch","type":"DEVICE","typeId":4198,"typeName":"Attic Light","filter":"true"}]}}}

1 Like

I see what you are doing in the rule, the issue is my Virtual Sensor "CONTACT" is not an option for the action, I only can select a "switch" type

i'm trying to learn how you have the option to allow the "contact" type in this action, but I do not have the option? Are you running a newer version? Im running 2.3.2.130

I guarantee you that you do. You need to use "Custom Action" in Rule Machine. It has been there forever (at least 3.5 years). I'm running the same platform version as you.

I would also encourage you to consider importing the JSON that I posted along with the screen cap of my rule. It will make it easy for you to recreate the rule.

I didn't learn the import function yet, I just started with hubitat yesterday. I'm 20 plus PLC programmer, Im just learning, sorry for all the questions

1 Like

No worries, it is pretty simple:

  1. Save the JSON I posted as a text file with the extension .json
  2. Open Rule Machine
  3. Click on the Gear (or Cog)
  4. Click on Export/Import/Clone
  5. Click on Choose File and then select the file that you saved in Step 1.
1 Like

with you giving me a crash course on how to import, that worked. This group has awesome support. Again, sorry for all the questions. But now I have it working thanks to you

2 Likes

:+1:

The import/export feature of Rule Machine is very useful. I'm glad @bravenel added that many releases ago.

2 Likes