SamuKata
João Dias
João Dias

patreon


Sneak Peek - Tasker Native Easy JSON Reading

The other day I had this idea that it could be fairly (if not totally) compatible to add easy JSON reading to Tasker and today I tried it out! :)

In this version of Tasker, if you have a local variable with some JSON data in it you can easily read it with the dot notation!

For example:

It even works for multiple values (arrays)! Let's say you have

You can use all the normal array operations like %data.name(#) to count the number of names, %data.name(<) to get the last name, etc.

Check out this example Task that will give you the current temperature. Super easy to do now! 😁


I'm aware that this has some limitations right now like for example, what if a JSON field has a Tasker incompatible name? I'll try and see what I can do about it :) Maybe have a separate JSON Read action for those special cases?

In any case, you can try out this new feature with the version below. Enjoy and let me know what you think! 😊

https://drive.google.com/file/d/1SvQFvAxFwCk-hArfO_6wOH0UlvvMGi0z/view?usp=sharing

Sneak Peek - Tasker Native Easy JSON Reading

Comments

In the JSON there's a "connected" variable that'll tell if you the network is the one that's connected :)

João Dias

Unfortunately, I don't think that will work, because AutoTools gives all nearby networks, but doesn't provide specifically the details of the connected network. Unless I'm missing something...

Matt DeKok

I can't change existing variables because it would break existing setups but you can use the AutoTools Connectivity action to get wifi info in json actually :) I can add something similar to Tasker in the future though!

João Dias

Can existing native variables like %WIFII be converted to JSON? Currently %WIFII looks like: >>> STATE <<< "network name" mac: ip: etc It would be nice to be able to use %WIFII.status or %WIFII.networkName

Matt DeKok

You read my mind 😁 Over the weekend I thought that would be a good solution for more complex cases as well!

João Dias

Yeah. It's a very common use case specially for Web APIs so I think it's an important feature to have 😊

João Dias

Holy shit this is awesome!! Will this eventually support bracket notation as well?

Bernard Tan

Intriguing...

Jay

This would be a very welcome feature for me! Anything that simplifies the Json process is a good thing 😄

Gavin Johnston

Thanks! 😁

João Dias

Badass!

Zachary H Denny


More Creators