Intégration AlexxIT/Sonoff Lan - 404 error

Hello everyone,

I added the @AlexxIT/Sonoff Lan integration to be able to control the Sonoff DIYs.

My Sonoffs are in DIY format and activated locally on the lan (no cloud).

I already do this with the Sonoff DIY plugin on Jeedom, coming to HA, I would like to do the same thing.

I test with Sonoff’s DIY mode tool and it works fine.

On HA, I installed the integration and the equipment does not work, here is what I have:

I tried several versions of the integration, it does not change anything
Do you have an idea ?
what can I do ?
THANKS

What is the Sonoff list on devices you are running? Did you read the docs to find out what is currently supported by AlexxIT/Sonoff under the HACS itegration?

Yes Yes of course.
The Sonoff DIY Lan integration works well with these equipments, they work with Jeedom and with Sonoff’s “DIY mode tool”.
I have some :
Sonoff DIY Basic R3
Sonoff DIY Mini R3

if I turn on then I turn off with the Sonoff DIY Mode tool, here is the log:

2023-05-02 20:06:54.545 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000f9eaad <= Local3 | 192.168.1.214:8081 | {'switch': 'on', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -52} | 168
2023-05-02 20:06:56.794 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000f9eaad <= Local3 | 192.168.1.214:8081 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -52} | 169

if I turn on then I turn off with the Jeedom Plugin, here is the log:

2023-05-02 20:09:58.719 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000f9eaad <= Local3 | 192.168.1.214:8081 | {'switch': 'on', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -52} | 170
2023-05-02 20:10:04.515 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000f9eaad <= Local3 | 192.168.1.214:8081 | {'switch': 'off', 'startup': 'off', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -52} | 171

if I turn on then I turn off with the Integration HA / Donoff Lan, here is the log:

2023-05-02 20:11:27.773 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.local] 1000f9eaad => Local4 | 192.168.1.214:8081 | {'switches': [{'outlet': 0, 'switch': 'on'}]} <= {'seq': 172, 'error': 404}
2023-05-02 20:11:27.811 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.local] 1000f9eaad => Local4 | 192.168.1.214:8081 | None <= {'seq': 172, 'error': 404}
2023-05-02 20:11:28.918 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.local] 1000f9eaad => Local4 | 192.168.1.214:8081 | {'switches': [{'outlet': 0, 'switch': 'off'}]} <= {'seq': 172, 'error': 404}
2023-05-02 20:11:28.950 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.local] 1000f9eaad => Local4 | 192.168.1.214:8081 | None <= {'seq': 172, 'error': 404}

That erors points to the UserID/PW needed to login. Did you added that to your YAML config in order to run the AlexxIT/Sonoff HACs and send and receive data to devices?

You then can use the key string to talk to devices

In LAN (local) mode, it is not necessary to have a username and password. This is only necessary if using the cloud (which is not my case)

image

See: GitHub - AlexxIT/SonoffLAN: Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant

Do you have it in auto mode?

From docs:

auto mode and local mode can work without Internet connection. If the integration fails to connect to the cloud - the component will use the previously saved list of devices and continue to work only in local mode. auto mode will continue trying to connect to the cloud.

local mode can’t work without ewelink credentials because it needs devices encryption keys.

Devices in DIY mode can be used without ewelink credentials because their protocol unencrypted.

It is highly recommended that you use mode: auto and do not use mode: local or DIY mode. Because the local protocol is not always stable and you will get a bad experience. Devices may sometimes disappear from the network or fail to respond to local requests. Also some POW and TH devices cannot update their sensors without a cloud connection.

I tried in Auto mode or in local mode, the result is the same, same error.
I tried to connect with my ewelink access (knowing that the equipment which is in DIY/LAN is not visible in ewelink), that does not change anything.

I would open a issue: Issues · AlexxIT/SonoffLAN · GitHub

Post log message and debug data as it will be needed to troubleshoot issue.

thank thank
:kissing_heart:
:innocent:

Just checked open issues. AlexxIT asked this to be done: Reboot (power off): Sonoff device, Hass server, WiFi router. And check again

From: Sonoff mini R2 error · Issue #1174 · AlexxIT/SonoffLAN · GitHub

Yes I did too, I had read this message.
I also restarted everything.
But with other tools, the sonoffs communicate well.

Also you may need to roll back from v3.5.1 to 3.3.0

yes I also tested

error 404 on locally (no cloud) · Issue #1177 · AlexxIT/SonoffLAN · GitHub :+1:

Have you tried latest master version?
I have fixed something similar

Yes, well done, it works fine for state (on/off) or state change.

2023-05-03 13:25:56.338 DEBUG (MainThread) [custom_components.sonoff.core.ewelink.local] 1000fa5f53 => Local4 | 192.168.1.215:8081 | {'switch': 'on'} <= {'seq': 176, 'error': 0}
2023-05-03 13:25:56.344 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000fa5f53 <= Local3 | 192.168.1.215:8081 | {'switch': 'on', 'startup': 'on', 'pulse': 'off', 'sledOnline': 'on', 'fwVersion': '3.6.0', 'pulseWidth': 500, 'rssi': -71} | 176

‘switch’: ‘on’ ==> switch.sonoff_1000ab1e93 :slightly_smiling_face: :+1:

thank