Hi,
Is it possible to invert a signal?
I have a switch that turns my device on, when the switch is off.
Would be nice to say that if this switch is on, it equals off. And when that signal is off, my device is also off.
I think that can be done with a virtual switch.
I made an example virtual device and flow, you can import and use it right away (Device Capabilities app needed):
Reversed Switch
When you want a switch to be reversed, so On becomes Off and Off becomes On
Here an advanced virtual device is used to be the opposite of some switch_A, and becomes virtual switch_A;
Then move that switch_A in a zone name starting with z
or 99
to ‘hide’ it.
TEF:
[TEF:AVD,FLOWS:H4sIAAAAAAACA91X2bKbypL9FYdeZYJ58hsgIQYBQrPUccNRFMUgECBGoRP+9y5pb9vX57hv7+hzo6Oj9bDZFJVZmStXJos/JiHqU4hMWBaTLxODa0zl7acpPH04HqTt+r6Wa3lLNi5TmB3bPCq2T89mfFqrmp1Sm9y+rc5XS0sWrtFmWdmLYsEa+9KfDXTWrfheJYvC6I2Kk8ijMBUZed9F4jEsVruRqfkgCGuGu1YPFJ5Jrx7Y6ihLZO+uKlE6USIz7dED1W2VdNMWtR59ZXmaMgbBuPJu1dWduBBRIIf7axiEgswKooceRlszqC60m0MF/YqkLxIK+r00FVanUZr2KysYJZzb9CpspuTVBkXA80wtSzi4zQ4csbFM0rPpA02PC7HjRyTyJ9YQRBA1SzX1wzs4mfcsMlLoGluVosjN/CjMmryVr5BsPNC0wV1eGctxEegk6erqLdh7Xdldzjj7aXhnyftIBoJ8CKkpc/ToxhK1khwusdTSwjnkWkaKlmwUbPnObtTHLAyFKJ4u1mTDjHVD8tdWvvVhDesHsoRwn6ClQi4lcmrJ04Kifbs5noXoWACDPdqPSCTD45mkvXzoZ0IbiYcLHXCpAlVuKvTntkPg8ND7a9RvytVjKh/W3DR0Lnl1XJ1njS4Ey5OkJ97MiFbx+bhelIV7WdyWelOt0nUrQ6OmqmVvm/x9fuSSeHE7OBSXOQA8HAx8kWXNuTkl+2aY7+76AWzg5pgA0zmK1snG1Qa7ZKgvV3W9K09rdl0sd6ruuiczdKm0O67A/XLj9fSUzvMBra/uYclvfG62dI16YV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QiBe4fi75KiT+u2A/mb4deuCvEA+Qq/i47xa/FUAL/r6PfpEz3l1vOf9Kke3+XE8/X3qxQKUQPrtHo5+DJ5k3Cf6GcffN9YvEbWh7j1KwSC8P8FAjwlXhh8hC+/YsD9ezHA6v7rm9T9Wr4CBvmbyP5XMLRY4T+zcCffJflLndcoqlGTXEuMJgq6H5L5WobPpNEdwa5FQ4IK+FLHTwQ+NDp+RUDk/u8goOv/BAH1P4QAAY7GzUBEEGII+EgkZJ6HBAshK0UiG4lv4uT11YWdRPjz4sun/1ZwwjIvcVCTEeXYAC/8GKr475CGbfL9wy1BL+37fvfMqyixtvj27ds/vv0n+jbIFoMYAAA=]
How to import:
Example on how to use an AVD Template with Flows.
I have created a Advanced Virtual Device (AVD) called Light Switch, containing three lights: Living room, kitchen and Game Room.
[image]
I also created a flow which controls the status of the buttons and the reactions to the pushing of the buttons:
[image]
And
[image]
You can copy this Device and its Flows with the The Exchanger File.
TEF:
[tef:AVD,FLOWS:"H4sIAAAAAAACA9V5aa/bWJLlX0kY/Y2l4b4ZmA+kxE0iKXETRTYKCe77Iop7df33ue/ZmVl2urPedNb0…
3 Likes
Tirrazo
October 21, 2022, 12:25pm
3
Thank you very much, Peter!
Will try it out!
1 Like
Hi,
I imported the TEF, must mostly the cards are not available.
Is there any other app that I need to start?
Sorry, the green ones (switch) are KaKu, and the black ones (light) are from group app, the yellow ones are from a AVD device → which gets created if you start with adding a new AVD , and then paste the TEF at the top text field
It, (the Reversed Switch), gets created in the background, after you pressed “Read Device”:
Then you can replace devices with your own devices during import.
If you don’t have a switch device, or if it is not listed, use “Don’t change”. That means, replace the flowcards yourself after import.
During import, did you ‘replace’ the AVD with your own? You should keep “Reversed Switch” as in the screenshot.
And did you replace the light with one of your preferred devices as well?
Hope this gets you going,
Peter
Tirrazo
November 11, 2022, 1:58pm
6
Do you know if it’s possible to do the same with logic as you did with the reversed switch?
I saw this one, which says you can revert a variable. I am not sure how to use it though
Yes, you can do it like this:
When the ‘source’ variable changes, set the ‘inverted’ variable to the opposite value. Then, you can use the inverted variable in your flows
But you don’t need it really, when you ‘reverse’ the flow action cards you’ll have the same result (but it might be confusing when reading your flows after a while):