Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make relay ON with power cycle #14

Closed
adamja opened this issue Feb 1, 2017 · 1 comment
Closed

How to make relay ON with power cycle #14

adamja opened this issue Feb 1, 2017 · 1 comment

Comments

@adamja
Copy link

adamja commented Feb 1, 2017

Sorry if this is the wrong place, I don't know where to post questions...

How can I make the sonoff relay start ‘on’ when power is connected (normal state is off when power is connected). I’m trying to send mqtt commands and nothing seems to save once power cycled?

I've tried everything I can see in the command lists but it always starts with relay off:

-t cmnd/sonoff_02/status -m 0

{"Status":{"Module":1, "FriendlyName":"Sonoff_02", "Topic":"sonoff_02", "ButtonTopic":"sonoff_02", "Subtopic":"POWER", "Power":0, "PowerOnState":1, "LedState":1, "SaveData":1, "SaveState":1, "ButtonRetain":1, "PowerRetain":1}}
{"StatusPRM":{"Baudrate":115200, "GroupTopic":"sonoffs", "OtaUrl":"http://domus1:80/api/arduino/sonoff.ino.bin", "Uptime":0, "Sleep":0, "BootCount":35, "SaveCount":189}}
{"StatusFWR":{"Program":"3.9.10", "Boot":4, "SDK":"1.5.3(aec24ac9)"}}
{"StatusLOG":{"Seriallog":2, "Weblog":2, "Syslog":0, "LogHost":"domus1", "SSId1":"nootnoot_optout_nomap", "SSId2":"indebuurt2", "TelePeriod":300}}
{"StatusMEM":{"ProgramSize":449, "Free":488, "Heap":20, "SpiffsStart":940, "SpiffsSize":64, "FlashSize":1024, "ProgramFlashSize":1024}}
{"StatusNET":{"Host":"Sonoff-02", "IP":"10.1.1.10", "Gateway":"10.1.1.1", "Subnetmask":"255.255.255.0", "Mac":"60:01:94:07:E2:6F", "Webserver":2, "WifiConfig":2}}
{"StatusMQT":{"Host":"10.1.1.58", "Port":1883, "ClientMask":"Sonoff_02", "Client":"Sonoff_02", "User":"adam", "MAX_PACKET_SIZE":400, "KEEPALIVE":15}}
{"StatusTIM":{"UTC":"Wed Feb 01 14:38:14 2017", "Local":"Wed Feb 01 15:38:14 2017", "StartDST":"Sun Mar 26 02:00:00 2017", "EndDST":"Sun Oct 29 03:00:00 2017", "Timezone":1}}
{"StatusSNS":{"Time":"2017-02-01T15:38:14"}}
@adamja adamja closed this as completed Feb 1, 2017
@adamja
Copy link
Author

adamja commented Feb 1, 2017

I swear it wasn't working, but it's come good now and I've just tried it on a new unit and it's worked right away. Was the "-t cmnd/sonoff_03/poweronstate -m 1" command...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant