just chage YOURWIFINAMEl YOURPASSWORD YOUHASSIOIP
leave the ap ip as is
i was working in android app but i donāt have android phone for now
you need to download this file
here
/custom_components/light
then
in your config file put this
light:
This worked, although I did have the correct IP in my later test, I wonder if itās more to do with keeping the formatting as raw and no spaces.
Any way this worked perfectly:
{"version":4,"ssid":"MYWIFI","password":"PASSWORD","serverName":"192.168.1.51","port":1081}
I donāt see custom_components in configurator, any ideas? Do I create this folder in the config folder or does it exist somewhere else?
if folder not exist create a new one
Does this need to be inside the config folder?
Got it, it needs creating in the config folder:
config/custom_components/sonoff.py
On a side note your vue admin page is great, just wondered is it possible to run this under https?
Iām also getting platform āsonoffā not found
Hi,
First, thank you for this post and what you created, itās very useful even if itās been quite a challenge for me.
So, I followed the instructions on the GitHub page, and I successfully installed Node Red, and the node-red-contrib-sonoff-server. So far so good, even if I struggled quite a bit.
One thing I canāt figure out though: How to access the sonoff server on :1080. Iāve configured it in node red and it seems to be working since I have:
Aug 22:41:29 - [info] [sonoff-server:xxxxxxxx.xxxxxx] SONOFF Server Started On Port 1080
However, when I try to access the server using my duckdns url (https://myserver.duckdns.org:1080), i get an empty response. On 1081, I get access refused.
Both port are forwarded to my piās address using TCP (not sure of the terminology here, Iām just a simple hobbyist).
Questions:
you donāt need node-red
/custom_components/light/sonoff.py
Iād just use the hassio sonoff server referred to in this thread. It works really well and there is a nice little UI to setup your devices.
You do need to be able to post the commands to your sonoff though. If you use the exact details with postman, as mentioned above you should be golden. Ensure you have your sonoff device in paring mode and you have connected to it as wifi access point, and the ip is 10.10.7.1 as mentioned above.
Iām getting the following error now, I can confirm I have a sonoff.devices.json and a sonoff.config.json.
Error while setting up platform sonoff
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/light/sonoff.py", line 43, in setup_platform
with open('/config/sonoff.ha.json') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/config/sonoff.ha.json'
Should I assume this is meant to be ā/config/sonoff.devices.jsonā in sonoff.py?
create a sonoff.ha.json in your config directory with the content of http://hassio.local:1080/hadevices
i will fix many issues soon
great thanks will give it a try
Error while setting up platform sonoff
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/light/sonoff.py", line 44, in setup_platform
for device in json.loads(f.read()):
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3 column 9 (char 16)
I guess Iāll need to tweak the json from that endpoint a littleā¦
tomorrow i will publish a new update.
Thanks for your feedback !
Iām at the exact same point as you appear to be.
However, I still canāt see the sonoff on the :1080 interface. iām using duckdns, so I guess I should put the address, without the port, under serverName in the post request, right ?
edit: After extensive research, i found this:
- The LED indicator quickly blinks twice and repeats, which means the device has connected to the router but fail to connect to the server.
Which is exactly what I have. So I guess it must be due to the fact that Iām using duckdns or something like that, my request must be messed up. Hereās what Iāve tried so far, maybe one of you guys will spot something obvious:
{āversionā:4,āssidā:āMySSIDā,āpasswordā:āMyPasswordā,āserverNameā:āhttps://REDACTED.duckdns.orgā,āportā:1081}