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
Other
230 stars 124 forks source link

Help adding devices #56

Closed buddasticks closed 4 years ago

buddasticks commented 4 years ago

Need some guidance in adding devices and pin definitions to the script please

sivar2311 commented 4 years ago

Hi buddasticks! To help you, i need more information about where you got stuck.

Usually adding a device syntax is: SinricProDeviceType &variableReference = SinricPro[_DEVICEID]; like:

#define SWITCH_ID "5e76dd20cd53f1712481d85d"

SinricProSwitch &mySwitch = SinricPro[SWITCH_ID];
buddasticks commented 4 years ago

i am using the advanced switch example because i need the alexa function and the manual switch also

i have a total of 8 relays i am trying to control so i under stand i will have to purchase some more on sinric pro

On Thu, Apr 9, 2020 at 6:34 PM Boris Jäger notifications@github.com wrote:

Hi buddasticks! To help you, i need more information about where you got stuck.

Usually adding a device syntax is: SinricProDeviceType &variableReference = SinricPro[DEVICE_ID]; like:

define SWITCH_ID "5e76dd20cd53f1712481d85d"

SinricProSwitch &mySwitch = SinricPro[SWITCH_ID];

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/56#issuecomment-611355840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOISYU43EXTCVA3FZR4OBRTRLVT7PANCNFSM4MEOWEWQ .

sivar2311 commented 4 years ago

If you're new to arduino, i highly recommend: First start without sinricPro. Learn the basics about how arduino works, and how you can control a relay. Later (if you have more expirience) learn how to control 8 relays and add SinricPro to your project.

If you're beginner, start with a simple example like Switch.ino.

If you need help, please ask a detailed question (related to SinricPro).

buddasticks commented 4 years ago

I have the switch.ino working easy as ...

But algoods thank you for your fast reply any way cheers have a good one

On Thu, 9 Apr 2020, 7:42 pm Boris Jäger, notifications@github.com wrote:

If you're new to arduino, i highly recommend: First start without sinricPro. Learn the basics about how arduino works, and how you can control a relay. Later (if you have more expirience) learn how to control 8 relays and add SinricPro to your project.

If you're beginner, start with a simple example like Switch.ino https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Switch/Switch.ino .

If you need help, please ask a detailed question (related to SinricPro).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/56#issuecomment-611381795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOISYU3M5UCN73CCMBOCH7DRLV35DANCNFSM4MEOWEWQ .

sivar2311 commented 4 years ago

Please feel free to open a new issue if you have any specific questions / issues about SinricPro

buddasticks commented 4 years ago

Added 8 devices payed for 3 no problem Using a 8channel relay .and it's switching at low .. where in the script can I changed it to high

sivar2311 commented 4 years ago

It's the digitalWrite inside the onPowerState function.

Usually it is digitalWrite(relayPIN, state); To invert this you can write digitalWrite(relayPIN, state?LOW:HIGH);

On the other hand you can change your relay wiring (NO / NC). If you using a LOW level trigger relay you have to think about what happens if the ESP have a power failure (all pins will go to LOW level and all relays will be switched ON).

buddasticks commented 4 years ago

Cheers for the quick reply .... The relay was coming on with the low I needed it to come on with the high .. but now you have shown me where to change I'll correct it thank you

By the way sinric pro.is amazing keep.it up

On Sat, 11 Apr 2020, 6:31 pm Boris Jäger, notifications@github.com wrote:

It's the digitalWrite inside the onPowerState function.

Usually it is digitalWrite(relayPIN, state); To invert this you can write digitalWrite(relayPIN, state?LOW:HIGH);

On the other hand you can change your relay wiring (NO / NC). If you using a LOW level trigger relay you have to think about what happens if the ESP have a power failure (all pins will go to LOW level and all relays will be switched ON).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/56#issuecomment-612344651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOISYUY7XXM4XTNQ263HMOTRMAFDJANCNFSM4MEOWEWQ .