Closed apsathyan closed 4 years ago
Hi @apsathyan !
This depends on your code and / or on your electronic device / wiring.
The meaning of the state
parameter in the onPowerState
callback is true
= on, false
= off
state
variable: digitalWrite(PIN, !state)
;NO
/ C
: change your wiring to NC
/ C
or invert the state
variable as mentioned above.By using one of our switch examples you can check the output on the serial monitor.
Thanks for your Swift reply. I will change. Thanks for the information and help. Sathya
On Tue, 14 Jul, 2020, 9:42 am Boris Jäger, notifications@github.com wrote:
Hi @apsathyan https://github.com/apsathyan ! This depends on your code and / or on your electronic device / wiring. The meaning of the state parameter in the onPowerState callback is true = on, false = off
- If you use an electronics device which needs an inverted signal (LOW = ON / HIGH = OFF) you need to invert the state variable: digitalWrite(PIN, !state);
- If you use a relay and your wiring is NO / C: change your wiring to NC / C or invert the state variable as mentioned above.
By using one of our switch examples https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/Switch you can check the output on the serial monitor.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/77#issuecomment-657955288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHN3V3P6AB5BMEEG2IFS4TTR3PLJRANCNFSM4OZCHYGA .
Thanks a lot. As you have said, i have inverted the state and Now it is OK. Thanks and Regards Sathya
On Tue, Jul 14, 2020 at 11:19 AM Sathyanarayanan A.P apsathyan@gmail.com wrote:
Thanks for your Swift reply. I will change. Thanks for the information and help. Sathya
On Tue, 14 Jul, 2020, 9:42 am Boris Jäger, notifications@github.com wrote:
Hi @apsathyan https://github.com/apsathyan ! This depends on your code and / or on your electronic device / wiring. The meaning of the state parameter in the onPowerState callback is true = on, false = off
- If you use an electronics device which needs an inverted signal (LOW = ON / HIGH = OFF) you need to invert the state variable: digitalWrite(PIN, !state);
- If you use a relay and your wiring is NO / C: change your wiring to NC / C or invert the state variable as mentioned above.
By using one of our switch examples https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/Switch you can check the output on the serial monitor.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/77#issuecomment-657955288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHN3V3P6AB5BMEEG2IFS4TTR3PLJRANCNFSM4OZCHYGA .
-- Regards,
Sathya.
Om Sakthi Electricals Mobile: 9841172837.
The device turns on for off command and device turns off for on command in sinric pro. Where i am going wrong