How to get Lux value using bash curl command Topic is solved

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
vidin
Posts: 2
Joined: Tuesday 16 April 2019 18:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to get Lux value using bash curl command

Post by vidin »

hello I have problem with get Lux value
for example for voltage I use

Code: Select all

curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=11' | jq .result[0].Voltage | sed 's/\"//g' | awk '{ print $1 }'
for Lux I try

Code: Select all

curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=17' | jq .result[0].Lux | sed 's/\"//g' | awk '{ print $1 }'
curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=17' | jq .result[0].Value | sed 's/\"//g' | awk '{ print $1 }'
curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=17' | jq .result[0].VALUE | sed 's/\"//g' | awk '{ print $1 }'
curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=17' | jq .result[0].LightLevel | sed 's/\"//g' | awk '{ print $1 }'
and command always return "null"
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to get Lux value using bash curl command

Post by waaren »

vidin wrote: Tuesday 16 April 2019 18:21 hello I have problem with get Lux value
....
and command always return "null"
Try

Code: Select all

curl -s 'http://192.168.9.4:8080/json.htm?type=devices&rid=17' | grep Data | awk '{ print $3 }' | cut -b2-
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
vidin
Posts: 2
Joined: Tuesday 16 April 2019 18:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get Lux value using bash curl command

Post by vidin »

It works fine, thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest