Say you are using the Read JSON card with 3 arguments.
Can you use only 2 of the arguments?
Can you use both argument-text1 and argument-number1, or only one of them?
Any way you wanna go.
Almost all arguments are optional, so you could, if you wish, always use the 3x10 argument card, also if you just start with one text.
The json is also optional: if non is supplied, a json object is created.
Also, properties that are non existing on existing Json’s, are created when filled. So, no need to pre-define the Json structure.
Hi,
I hoping this app are what I need but I don’t know if it’s possible and I have a hard time to get started.
I’m using the Asus WRT app connected to my router and from that I get a trigger when some device connects to the router. From the trigger card there are four tags, name, nickname, IP and MAC.
What I like to do is to have a database that updates dynamic with connected devices. Is it possible with this app? Any tip to get me started?
Thanks
Would it be possible to have the tag names set dynamically?
When using the tags in a flow the name “Text1” is better than “result” but still making it cumbersum to remember which tag holds what value.
Hey,
Well i see two possible options:
- Create Global Tags on the fly.
A flowcard would not have Set Text1 = [input], but more something like Set [name]=[input], where you could fill in the name and a Global Tag would be created. - A Virtual/Fake Device with customisable property names ( like AVD), which you could set through flowcards like the current JSON cards.
But both solutions have one very big weakness: Using the same tag at the same time is gonna create issues, because the scope of the Results are outside of the Flow.
This can/will cause “random” feeling errors.
This makes any solutions that i currently can see, not very usefull.
Ok, that doesn’t sound as any good solutions.
When i am done with AVD and The Flow Exchange(r) - Exchange Your Flows with Others! - Apps - Homey Community Forum i might take another look at the possibilities. But thats all i can promise.
So the Homey code requires the tags from an action card must have static result tag(s)?!
This is why you have different sizes of JSON handler cards.
I hope this will be changed in upcomming Homey releases.
Indeed, and also the arguments are not dynamic, but fortunately, they can be optional nowadays.
Maybe you could explain this a bit more?
Yeah, but i find it a bit hard to explain in a non-developer way.
I just updated a few flowcard-descriptions which are in test right now.
Essentially, i created a loop
card, or for each
for (var (item,key,index) in Collection) {
}
It works pretty easy, you need two cards:
- A When/Trigger Card, which will be triggered for each item in the collection, with these tokens:
- Item as Text
- Item as Number
- Item as Yes/No
- Key
- Index
- Text 1 (argument)
- And a Then/Action Card, which you supply with an (json) collection (array or obj) and an optional argument.
The When card will be execute for each item in the collection, with the supplied tokens.
Example
The bottom card will execute the above (Trigger/When) card three times.
Result:
Here is another example:
Developer-way works fine for me at least. Am a SW developer myself, but only C, C++, Python and just starting with Java.
I think I understand it, will do a test flow and try it out.
Hi Arie!
In the Read-JSON card, isn’t all path’s optional?
In my flow I only check the path “Yes/No 1” but get an error for “Text 1” path.
In the first Read-card I get error “Invalid type for token ‘text1’ expected ‘string’ but got ‘undefined’”.
[tef:FLOWS:"H4sIAAAAAAACA7VWbW/bNhD+KwE/mwEpvojUtwJdtxZrMyAb+sEJDL6cbC2y5Mly0yzNf9/RshYHcQptaOAPFskj77l7nuPxnnwhxT3JJBeQG0dB54xKFgz1nGU0ZyrzkUfFrE52DSnImy7uqqZ9W203tbu77F0PWzIjPS5t+65qluThYT9E8/r8r3q37aGjVX/+Yds2v7gm1tCNZ324vPh0Ns7hLtzQVFBvI9zgzM153S5H08tqvanh7NeLn/fnO1LM70mFCzyKXAWpKYuaU8ljTj3IkmpTcpb7UnrOEd/ojiLcHsdAir7bwYyE5MFELTlngjplI5VZVNQrbSlI8DIzSjNvkt1XUrAZuSOF0GyM2XXpvC0CIhn3OopSUZUFRaWUObVKlPgVwFmdWSEi2ubCc+XKQCNnDiGLSI0vI9XaqhANB50xcp2iVCpH/IIqzhGW5IGaqAyNpdMh48x65w+wVHYAlv7bXb/Z9T91XdslWELZXGr0Z0phqcxDRFjIMbeBW+DKO0zRNW7DeFbtGu4Kt9kUL7M32yfehb5qm8ViC/1i0cPXni+a3dpDxxe+bWtwDT/oYrAck2SEcYHnnkaTBSqdL6nJGdDMZsBNkNxahrau5LkO2lAXQwIdHbU8ahQmRg6i1KqUCbRLCfgT0aGj+XyAv3aNW0JXoH6q8G2Kuq+v0eWmazfQ9XeP+Avy+yCXo5n5fIinKKbQXRTjVnSRlDtJIwOnnL3MaVkyFQAyaoPIqIyMJ04d1TbHYJlXXLL/z+nyP3I6SagzgpRZ7iWj1igE7Synjkug2gvnMHCTg38tTvfR4Hnf4znxM0meB35GgrITBHld+lxw3AiZxCLXqF/vPQ2Cc2ucVxZ+CEFsZIj9Gw47yZEu81Ip0JSXyiMgh4ACqi8XJlobSoG/58kftT6F4aJI214spTfdGtvD56pfvW3b7nPVxPb2YgPNCfMMzT+6ZNF2fzR1G24gnjATaPauA/gbunddFZeQDn7hSIm2v7VdWH3HRqHN+/Wm7XrX9B+3yxMm2AfJJ7hFcPWJ1fxYSZOu+UFJZtBRnvT0TBDPWuIghfcNym0xjJ+wvSdw3zofO97Z0KcSrElF+LSpvCIuV6LWz8qqw+8OXBy6+5S7f4Bo9QDRyFeG6HdVPaCbVEiHGyI/3BDSvDK8LYS2iY8p1BIsYH+n0YmcovvUKaygPvholJWBs/2T7ourd/gWIvdXL9bnFSlKV29hdvWsJo+WTtbh0fqT2juaP663o+lDjR3NpLoahw+YjNDW6aYld1DX7S1OHHVMntRwW8V+RYpmV9czsoJquerHUcpq0/aQHp2TOumBzkM9qB9dD/N5cF2c+qKA1GMOz4lJb7tDNZtX0uKIflqPOEY/qUkeci/GSzJ7JfhTOv8x/IeH64d/AAUx6yFBDQAA":/tef]
Yes, that should be yeah.
Okay, something is seriously wrong with one of the latest updates from Homey or the Web App.
Non-enterered arguments do not get cleared anymore, just become an empty string.
I have been getting errors because if this in multiple apps without updating any of them.
Awell, i did solve it on my end in the JSON Handler. Update to 1.2.4 (Test) and it should work.
It is in the comment card: {“ArmingWithDoorWindowOpen”:false,“MaindoorUnlocked”:false,“FreezerFridgeDoorOpen”:false,“PorchDoorOpen”:false,“ImportantMsg”:false,“NewMail”:false,“Test”:false}
Nice!
Did you do a workaround for a Homey bug or has Athom changed some API?