Skip to content

how do you parse whether "relay_state" is ON or OFF? #1

Description

@Piotr-23

I have a bash script that should run your script (thanks for it, BTW! :) and return whether the "relay_state" is ON or OFF

#!/bin/bash

STATUS_103=$(source "/home/piotr/_kasa_hs100/hs100-nealefelaen.py 192.168.0.103 9999 status")
echo "STATUS OF 103: ..." $STATUS_103
printf "\n"

but this gives me just

./mainscript.sh: line 36: {"system":{"get_sysinfo":{"sw_ver":"1.1.5 Build 200828 Rel.081157","hw_ver":"4.0","model":"HS100(EU)","","oemId":"","hwId":"","rssi":-54,"longitude_i":,"latitude_i":_,"alias":"Extra","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM","mac":"1C:3B:F3:DE:7D:AF","updating":0,"led_off":0,"relay_state":0,"on_time":0,"active_mode":"schedule","icon_hash":"","dev_name":"Smart Wi-Fi Plug","next_action":{"type":-1},"err_code":0}}}: File name too long
STATUS OF 103: ...

File name to long?
How to extract 0
? Thanks and best | P

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions