I’m looking to make a handful of devices mimic one another. I just integrated Smartthings but am using nothing but simulated devices on that platform so my family can use that app as their front end. I didn’t want to force them to install anything new and they are stuck in their ways.
I have different types of simulated devices from switches to colored bulbs and simulated garage doors to simulated locks. I want to be sure if any attribute of a specific device is changed on one platform, its mirrored on the other platform. I can mirror the on/off state with Node-Red ezpz but mirroring things like brightness and color temperature seems to be more difficult. I guess it can be done with A LOT of templating but I’m still not entirely sure accomplish it. In Smartthings you can make the trigger be “on device changes” and make the action be “set device B brightness to device A brightness”. Hopefully, there could be something that easy in Hass too!
@tom_l that’s great news that not specifying a state will trigger on all changes, exactly what I was looking for! But, making templates is always a challenge for me and it takes a lot of trial and error. This is what I’ve got…
I feel like this should be correct, but I get nothing. I’m sure I’m missing a comma or something somewhere. Also, is this the correct path for matching the on/off states? Thanks again!
You’re right. Easy stuff like that I miss. Still not working, though. And I fixed the hs_color template, I had color_temp in there again. I even took out the state template just in case that was causing errors.
Again, I think thats right. Probably missing something easy. But I’m not getting anything. Either way, practicing templates is good for me and hopefully one day I’ll be able to create one without having to copy-paste from this forum.
Mutt, I tested both mine and your service templates and they work when I removed all the data templates. So, I guess the problem is in the data template somewhere and it makes the whole automation hang.
I can now mirror brightness but not on/off state. If I remove the brightness data template altogether I can mirror state changes. I used @Mutt’s trigger.to_state.state as well as the service template and got the same result. So something somewhere is causing the automation to hang when there is data. Or maybe it just doesn’t like having data on a turn_off service. Thank you guys for your help! If you see anything that I may be doing wrong I would greatly appreciate it. As for now though, I think I’l just make a separate automation for on and off.
I think you could also do this in one automation with a light.turn_on service for all outcomes and a templated brightness of zero for the outcome where you want it to turn off, and the appropriate brightness when you want to turn it on.
i switched == on to != off because it was turning the light off on any brightness change so at least we know the brightness of 0 acts as an “off” command.