mihai-dinculescu / tapo

Unofficial Tapo API Client. Works with TP-Link Tapo smart devices. Tested with light bulbs (L510, L520, L530, L610, L630), light strips (L900, L920, L930), plugs (P100, P105, P110, P115, P300), hubs (H100), switches (S200B) and sensors (KE100, T100, T110, T300, T310, T315).
MIT License
339 stars 35 forks source link

HELP request on code, not execution issue. #99

Closed DaveGut closed 1 year ago

DaveGut commented 1 year ago

First, I do not use Rust (and do not plan on this). Therefore this question on my issues getting the CHILD DEVICES up and running using groovy on the Hubitat platform. I can control normal devices and get data (device info, child device list, child device components) successfully. Making the final step is not working.

Simple request: debug log data for when a child get_device_info and get_trigger_logs are implemented. This data should solve my format issues.

From a very old man, thanks in advance. Deve

mihai-dinculescu commented 1 year ago

I'm sorry, I'm unfamiliar with groovy and Hubitat, and I struggle to understand your request. Can you please rephrase with more information?

BTW, I've just started to work on a Python wrapper. I think it will prove helpful to non-rust developers and for the plethora of home automation tools written in Python.

DaveGut commented 1 year ago

Thanks for your response. My issue is getting the right data and data format for the JSON file. Easiest was is to get a copy of the string just prior to encryption

In YOUR code,request string prior to encrytion. I need that string for the Sensor (any sensor) get_device_info and get_trigger_logs.

The debug is lines 667 of api_client.rs let request_string = serde_json::to_string(&request)?; debug!("Request to passthrough: {request_string}");

mihai-dinculescu commented 1 year ago

In order to see the debug information you have to run the example with RUST_LOG=debug in front, like so:

RUST_LOG=debug cargo run --example tapo_l530
DaveGut commented 1 year ago

Understand. However, I was hoping to avoid the multiple installs onto my PC in order to spend 5 minutes to gather two pieces of data. Sorry you can not help.

As a side, I have exercised and verified the commands to play and stop the hub and I am in the process of being able to configure the alarm sound (having some issues here).

DaveGut commented 1 year ago

Plua, it turns out I do not have a clue on how to install rust, a rust application, or any of the other tools you mention in your read-me.

mihai-dinculescu commented 1 year ago

These are the two requests you've asked for.

Child get trigger logs

{"method":"control_child","params":{"device_id":"XXX","requestData":{"method":"multipleRequest","params":{"requests":[{"method":"get_trigger_logs","params":{"page_size":5,"start_id":0}}]}}}}

Child get device info

{"method":"control_child","params":{"device_id":"XXX","requestData":{"method":"multipleRequest","params":{"requests":[{"method":"get_device_info","params":null}]}}}}
DaveGut commented 1 year ago

Thank you. I will close this for now. If you are interested, I will provide any additional methods / commands I find during my search.