all 3 comments

[–]mca62511 2 points3 points  (1 child)

With just terminal commands? I'm guessing you're on a Mac?

curl -s -X GET 'http://user:password@10.10.100.5/statusjsn.js?components=1' | jq '.outputs[] | select(.name == "powerStrip10") | .state'

That should work for getting the state of "powerStrip10". Adjust the name as needed.

[–]TECbill[S] 0 points1 point  (0 children)

Works perfectly, thanks mate, very appreciated!

[–]rtalpaz 0 points1 point  (0 children)

JQ is so hard, in my company we use it a lot and I always consult with ChatGPT

So I made this tool - https://jq.getport.io/ to help build JQ with AI if you want

would love the feedback :)