sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
228 stars 121 forks source link

know the status of my requests #285

Closed helmeplis closed 1 year ago

helmeplis commented 1 year ago

hello, I'm new to this, I'm making an assembly with the code of the switch send a signal from google assistant, but it hasn't worked out quite right, so I would like to know if there is any function of the sinric.pro library to see the requests I send. I would appreciate the help

kakopappa commented 1 year ago

Server side requests are logged in the Activity Log tab in the Portal.

To see messages coming into SDK and going out, you have to enable debug logs. Uncomment this line

https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Switch/Switch/Switch.ino#L18

On Sun, 28 Aug 2022 at 5:22 AM helmeplis @.***> wrote:

hello, I'm new to this, I'm making an assembly with the code of the switch send a signal from google assistant, but it hasn't worked out quite right, so I would like to know if there is any function of the sinric.pro library to see the requests I send. I would appreciate the help

— Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/285, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZXRY4BAAND7QQTR7P3V3KIJHANCNFSM57Z762VA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

helmeplis commented 1 year ago

hello, is there any way to capture the state and assign it to a variable?, for example

status = function fetch(){ return "lock", "unlock" }

kakopappa commented 1 year ago
bool myPowerState = false;

bool onPowerState(const String &deviceId, bool &state) {
   myPowerState = state;
}
helmeplis commented 1 year ago

The variable &state is global?, or can it be called from anywhere in the code?

kakopappa commented 1 year ago

myPowerState is global. state is local

helmeplis commented 1 year ago

but my myPowerState is false for the rest of the code, is it possible to capture the state and modify it in execution?

kakopappa commented 1 year ago

You can't change the state, it's only available with in the function scope.

If your intention is to update the state in the server, you have to send an event like below to the server once when the state change.

mySwitch.sendPowerStateEvent(newRelayState);

stale[bot] commented 1 year ago

This issue has gone quiet. Spooky quiet. We currently close issues after 14 days of inactivity. It’s been at least 7 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder, the best way to fix this or any other problem is to provide a detailed error description including a serial log. Thanks for being a part of the SinricPro community!

stale[bot] commented 1 year ago

Hey again! It’s been 14 days since anything happened on this issue, so our friendly robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder, the best way to fix this or any other problem is to provide a detailed error description including a serial log. Thanks again for being a part of the SinricPro community!