I have a 6-zone audio amplifier at home that accepts serial command. So, I bought a ThingShield and am struggling with reverse-engineering examples, trial-and-error, etc. to cobble together a device type I can use to turn the zones on/off, select sources, and volume up/down.
So right now, I’m trying to make a tile that turns green when a zone is on, and gray when off - just like the standard switch tile. I have the following code:
when i press the tile in the phone, it executes the z1on command as expected, but the state of the tile doesn’t change to green nor does it send the z1off command on next press. Can anyone see what I am doing incorrectly here?
Also, I am so confused about in the examples for a switch tile, the action is “switch.on” and “switch.off” which only calls an “on” method. I guess in general I’m confused about commands vs. attributes vs. capability…
The tile state is controlled by events, not actions. That tile decides which state to show by looking up the most recent event of attribute “switch”.
The SmartPower outlet sends us a state update after we change it and we turn that into a “switch on” event. The Z-Wave switches don’t, so we send a state request after the on or off command, then the response to that creates the event.
If there isn’t an on/off response from your device, it may be possible to create the event in the action. It’s not usually done – I’d have to look it up.
There is also the “nextState” option for tiles. We use this to change the dimmer tile to “turning on” immediately because it takes a while for the response to come back.
Yeah, that looks like it will work to me. I must admit, though, I’m still sometimes wrong about how SmartApps and device types work since the system still has some quirks and I mostly work on the firmware side.
PS. sorry I tried to respond last night but this stupid forum software thinks my home ip is a spambot
Yep, got this working now… is there a list of tile types? I would love to have a tile that takes input - Ideally you press it and it lets you select from some number of choices.