38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#/data/data/com.termux/files/usr/bin/bash
|
|
|
|
data=`/data/data/com.termux/files/usr/bin/curl -s -H "Content-Type: application/json;charset=utf-8" -H "Accept: application/json" -H "Authorization: Bearer a3761a4f-3d53-4206-a09a-54e73b157462" https://api.smartthings.com/devices/C097276A-4909-0000-0000-000000000000/status`
|
|
|
|
|
|
echo
|
|
echo
|
|
echo
|
|
|
|
air_conditioner_mode=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.airConditionerMode.airConditionerMode.value`
|
|
echo "Air conditioner mode: ${air_conditioner_mode}"
|
|
echo
|
|
|
|
|
|
cooling_setpoint=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.thermostatCoolingSetpoint.coolingSetpoint.value`
|
|
echo "Cooling setpoint: ${cooling_setpoint}"
|
|
echo
|
|
|
|
|
|
switch=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.switch.switch.value`
|
|
echo "Switch (power): ${switch}"
|
|
echo
|
|
|
|
|
|
current_temperature=`echo ${data} | /data/data/com.termux/files/usr/bin/jq .components.main.temperatureMeasurement.temperature.value`
|
|
echo "Current temperature: ${current_temperature}"
|
|
echo
|
|
|
|
|
|
|
|
|
|
echo
|
|
echo
|
|
echo
|
|
|
|
read -p "Press enter to continue" throwaway
|
|
|