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
227 stars 121 forks source link

Sinric pro blinds #354

Closed Totocsy closed 6 months ago

Totocsy commented 7 months ago

Hi i cant find any examples for sinric pro blinds I tried to get it to work but it didn't work

sivar2311 commented 7 months ago

The example of the blinds can be seen here.

You must implement an onRangeValue callback which receives values between 0 (close) and 100 (open).

Totocsy commented 7 months ago

Can you pls write me an example code ?

sivar2311 @.***> ezt írta (időpont: 2023. nov. 26., Vas 21:18):

The example of the blinds can be seen here https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Blinds/Blinds.ino .

You must implement an onRangeValue callback which receives values between 0 (close) and 100 (open).

— Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/354#issuecomment-1826873481, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JZGRSP6WJCLOGI4KWTZ2DYGOIZZAVCNFSM6AAAAAA73BL4XWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWHA3TGNBYGE . You are receiving this because you authored the thread.Message ID: @.***>

Totocsy commented 7 months ago

Im using a stepper motor but it doesn't work the implementacion

sivar2311 commented 7 months ago

I don't have stepper motors and I can't do the work for you.

If you can provide a working non-SinricPro code to control your blinds with a stepper motor, I may be able to help you implement this in a SinricProBlinds sketch.

kakopappa commented 7 months ago

There’s a GitHub repo created by one of our users here

https://github.com/sensboston/SmartBlind/blob/master/SmartBlind.ino

On Mon, 27 Nov 2023 at 2:27 AM sivar2311 @.***> wrote:

I don't have stepper motors and I can't do the work for you.

If you can provide a working non-SinricPro code to control your blinds with a stepper motor, I may be able to help you implement this in a SinricProBlinds sketch.

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

Totocsy commented 7 months ago

https://github.com/nidayand/motor-on-roller-blind-ws/blob/master/motor_on_a_roller_blind-ws.ino This code works super fine but only with web socket can someone modify to sinric pro version ?

sivar2311 commented 7 months ago

Please provide a simple sketch that can open and close your blinds. Also describe the used components and provide a wiring diagram. I will be happy to help you with the implementation of SinricPro.

sivar2311 commented 7 months ago

I have created a working example for you.

https://github.com/sinricpro/esp8266-esp32-sdk/assets/2558564/31b20f53-a323-42d1-9cd1-601772b85cc0

You can find it here: https://wokwi.com/projects/382646742688733185 The example uses an A4899 stepper driver and a stepper motor.

I hope this helps you.

Totocsy commented 7 months ago

Hmmm thats fine but i have uln2003 stepper driver

sivar2311 commented 7 months ago

You should now be able to adapt the code to your stepper driver. You can also use the stepper library for this. Only ever execute a single step in the handleStepper() so that the sketch is not blocked for too long.

Unfortunately, I cannot give you any further help with this stepper driver. If you have any questions about SinricPro, please feel free to ask.

Totocsy commented 7 months ago

I have created a working example for you.

BlindsStepperSimulation.mp4 You can find it here: https://wokwi.com/projects/382646742688733185 The example uses an A4899 stepper driver and a stepper motor.

I hope this helps you.

the code was writen in sinric pro 3.0.1 version becouse when i want to compile i get error

sivar2311 commented 7 months ago

The changes made in version 3.x do not affect this example.

Please show the error message you get.

Totocsy commented 6 months ago

The changes made in version 3.x do not affect this example.

Please show the error message you get.

In file included from c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:17, from C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino:4: c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProUDP.h: In member function 'void SINRICPRO_3_0_1::UdpListener::begin(SINRICPRO_3_0_1::SinricProQueue_t)': c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProUDP.h:40:10: error: 'class WiFiUDP' has no member named 'beginMulticast' 40 | _udp.beginMulticast(WiFi.localIP(), UDP_MULTICAST_IP, UDP_MULTICAST_PORT); | ^~~~~~ c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProUDP.h: In member function 'void SINRICPRO_3_0_1::UdpListener::sendMessage(String&)': c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProUDP.h:68:10: error: 'class WiFiUDP' has no member named 'beginMulticast' 68 | _udp.beginMulticast(WiFi.localIP(), UDP_MULTICAST_IP, UDP_MULTICAST_PORT); | ^~~~~~ In file included from c:\Users\tszil\Documents\Arduino\libraries\WebSockets\src/WebSocketsClient.h:28, from c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProWebsocket.h:17, from c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:18, from C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino:4: c:\Users\tszil\Documents\Arduino\libraries\WebSockets\src/WebSockets.h: At global scope: c:\Users\tszil\Documents\Arduino\libraries\WebSockets\src/WebSockets.h:182:38: error: 'WiFiClientSecure' does not name a type; did you mean 'WiFiClient'? 182 | #define WEBSOCKETS_NETWORK_SSL_CLASS WiFiClientSecure | ^~~~ c:\Users\tszil\Documents\Arduino\libraries\WebSockets\src/WebSockets.h:309:5: note: in expansion of macro 'WEBSOCKETS_NETWORK_SSL_CLASS' 309 | WEBSOCKETS_NETWORK_SSL_CLASS ssl; | ^~~~~~~~ In file included from c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricPro.h:18, from C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino:4: c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProWebsocket.h: In member function 'void SINRICPRO_3_0_1::WebsocketListener::setExtraHeaders()': c:\Users\tszil\Documents\Arduino\libraries\SinricPro\src/SinricProWebsocket.h:101:45: error: no matching function for call to 'WiFiClass::macAddress()' 101 | headers += "\r\nmac:" + WiFi.macAddress(); | ^ In file included from C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino:2: c:\Users\tszil\Documents\Arduino\libraries\WiFi\src/WiFi.h:137:14: note: candidate: 'uint8_t WiFiClass::macAddress(uint8_t)' 137 | uint8_t macAddress(uint8_t mac); | ^~~~~~ c:\Users\tszil\Documents\Arduino\libraries\WiFi\src/WiFi.h:137:14: note: candidate expects 1 argument, 0 provided C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino: In function 'void setupWiFi()': C:\Users\tszil\Desktop\BlindsStepper\BlindsStepper.ino:111:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 111 | WiFi.begin("Wokwi-GUEST", ""); | ^~~~~

exit status 1

Compilation error: exit status 1

sivar2311 commented 6 months ago

Errors are reported for WiFiUDP and WiFiSClientSecure which are parts of the standard libraries!

Have you forgotten to include the correct WiFi library? ESP8266: #include <ESP8266WiFi.h> ESP32: #include <WiFi.h>

github-actions[bot] commented 6 months 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!

github-actions[bot] commented 6 months 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!