So I got a few Zigbee contact sensors now, my idea was to have a more sure way to know what position my garage doors are in.
But now I’m missing a way to have a good way to show what their status is.
I’d need a tile that can trigger a device (the door) and set the colour/icon to another device. That way I can open and close the door with a tile that can show the door is closed, open or somewhere in between.
How would I go around achieving that? When setting variables to the different states, I can’t create a variable tile to hold other variables as well.
@Sgt.Flippy_PJ if I understand your need correctly, you can do so by adding the contact sensor to the dashboard, change it to Hero Attribute layout, and configure its tap action to Open Hyperlink and use the $.runRule() syntax to trigger the execution. (You can get the rule id from the last section of the URL when editing the rule.)
Then in the rule, you can use an IF condition to check the contact sensor’s current state to determine if it should open or close the garage door.
The thing is that I want the tile to reflect the state. But there is a sensor closed when the gate is open and another sensor is closed when it is open.
So what I would want to do, is to add the tile for my garage opener, but have that tile reflect the status of both sensors. When the closed sensor is closed and not open, the tile can turn green, when the open sensor is closed, it can turn red. When both sensors are open, show yellow for the time it should take the door to open/close and start flashing with a warning label or something when it stays in that state for too long.
In other words, a rule based system for a tile’s appearance. Maybe it’s something that can be used for lots of people. A tile on which you can set a tap action to activate any “thing”, but the appearance can be rule based. Would be very interesting for people with alarm/security systems as well.
I believe you are correct. I know you can set multiple color states using the hero attribute for the title. However I am uncertain if a second Thing can influence a tile. @josh or @James are the one that will be able to better answer this question. If it’s not possible I would suggest adding it to the feature request.
You can use a rule to aggregate the status of multiple Things into a variable (or virtual thing).
Using that concept, the rule might be something like:
Contact1 changes to "open"
Contact1 changes to "closed"
Contact2 changes to "open"
Contact2 changes to "closed"
IF (contact1 == "closed" AND contact2 is "open")
Set $doorState = "closed"
IF (contact1 == "open" AND contact2 is "closed")
Set $doorState = "open"
IF (contact1 == "open" AND contact2 is "open")
Set $doorState = "partially open"
IF (contact1 == "closed" AND contact2 is "closed")
Set $doorState = "sensor error"
(Just an example without knowing the intricacies of your setup, but you could adapt as needed)
Then you would add the variable to your dashboard and you could style it based on your known combined states. You could set the tile’s action to Hyperlink and use the $.runRule() syntax to trigger whatever actions you wanted (in a separate rule).
We have a feature in Beta called Super Tiles which enables you to build your own custom tile layouts. So you could add just the variable icon and not show the variable value at all if you’d like. I’d be happy to get you added to the beta if you’re interested?