diff --git a/plugins/power/tasmota_ b/plugins/power/tasmota_ index 53a367fd..1e6a7dca 100755 --- a/plugins/power/tasmota_ +++ b/plugins/power/tasmota_ @@ -109,7 +109,7 @@ powerfactor() { exit 0 else res=$( curl -fsS --data-urlencode "cmnd=Status 8" http://$SWITCH/cm ) - powerfactor=$( echo "$res" | sed 's/.*"Factor":\([0-9.]*\)[^0-9.]*.*/\1/' ) + powerfactor=$( echo "$res" | jq -c '.StatusSNS.ENERGY.Factor' ) echo PowerFactor.value $powerfactor fi } @@ -128,7 +128,7 @@ energy() { exit 0 else res=$( curl -fsS --data-urlencode "cmnd=Status 8" http://$SWITCH/cm ) - energy=$( echo "$res" | sed 's/.*"Total":\([0-9.]*\)[^0-9.]*.*/\1/' ) + energy=$( echo "$res" | jq -c '.StatusSNS.ENERGY.Total' ) echo Energy.value $energy fi }