robertklep / name.klep.sonoff

Homey driver for Sonoff devices
7 stars 7 forks source link

Sonoff T3 support? #31

Open ashleywolf87 opened 4 years ago

ashleywolf87 commented 4 years ago

Good day! I noticed the T1 is supported by Homey however, may I confirm if the T3 would work with Homey as well? Both T1 and T3 are from the same TX series.

Thanks for your time. cap

robertklep commented 4 years ago

I can't say for sure, but they might work if you configure them as T1 devices in the Sonoff-Tasmota configuration.

ashleywolf87 commented 4 years ago

Thank you for the prompt reply.

Is it possible to configure the T3s as T1s though? I havent bought the switches yet but the black switches just looks too beautiful hahah

robertklep commented 4 years ago

With Sonoff-Tasmota, you can configure a device any way you like. It will present itself as a T1 device to the Homey driver, which would make it supportable as if it were a T1 device.

However, I cannot say with 100% certainty that it will work because I don't have any T3 (or T1, for that matter) devices myself :(

robertklep commented 4 years ago

Here's a bit more info: https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-TX-Series

It looks like the devices (apart from the T0) all use the same board, so configuring a T3 as a T1 should work.

ashleywolf87 commented 4 years ago

Holy cow is there a guide which would guide me to set it up as a T1 device? I'm sorry but I'm new to this. @_@

robertklep commented 4 years ago

In that case, I have to warn you: you cannot use Sonoff devices with Homey out of the box. You need to install ("flash") an alternative firmware on them (called Sonoff-Tasmota) before they will work with Homey.

The flashing process isn't trivial (you need to open up the device, potentially solder some wires to the circuit board, and use an USB-to-serial dongle to "talk" to the device).

ashleywolf87 commented 4 years ago

Oh my goodness. Well that has caught me off guard and boy am I glad I found out about this before jumping into the water.

Is there a video guide/tutorial which would guide me step by step on how to do the things you've mentioned? This is new to me but my background is in EEE Engineering so I'm hoping it still falls within my capabilities Hahaha

robertklep commented 4 years ago

The Sonoff-Tasmota wiki is probably the best place to start :)

ashleywolf87 commented 4 years ago

Thanks Robert!

Ewelink was made to control the sonoff switches in its default state. Once I have flashed these switches and done as you mentioned, would I be controlling the Sonoff switches with Homey via the Sonoff/Ewelink app or...?

robertklep commented 4 years ago

No, only from Homey. The alternative firmware doesn't work with the eWeLink software at all.

ashleywolf87 commented 4 years ago

Ah meaning to say each Sonoff switches would show up as Cards in the create flow editor for me to link up with other Sonoff switches or devices connected with Homey?

robertklep commented 4 years ago

Correct. For the T1, you'll get the following flow cards:

Triggers:

Actions:

ashleywolf87 commented 4 years ago

understood. Thanks! I went through the steps required to flash the switches, doesnt seem as daunting as I imagined it as LOL.

https://www.youtube.com/watch?v=t3Cqm6RbIPk&t=1s

That video is a great guide for anybody who intends to do this as well in the future.

Robert, is there a specific version of Tasmota I have to flash the Sonoff T3 switch into for it to work with Homey or does flashing it to Tasmota is basically like jail breaking the Sonoff and it makes it compatible with many 3rd party devices one of which is the Homey?

robertklep commented 4 years ago

I assume that the latest version of Tasmota will work (if not, it will be easy to flash to an older version).

And it's not so much jailbreaking (which patches the underlying firmware), but installing a completely new operating system to "open up" the device so you can use it without the need for an external cloud service, using open protocols like MQTT.

ashleywolf87 commented 4 years ago

Good day again Robert! Soon I'll start flashing the Sonoff TX Series, T3 switches but something came to mind with how it works with Homey.

Is it possible to control a smart light in a 2-way swithcing without any physical connections to both T3 switches?

Something as shown in this video at timestamp "2:00" https://www.youtube.com/watch?v=iyZwcZS7Qu4&feature=youtu.be

robertklep commented 4 years ago

I don't see a reason why that wouldn't work, although with Homey it mostly comes down to creating a few flows to recreate this. Something like this:

Of course, you can also toggle the status of the smart light from each "switch" flow directly, but I like decoupling "trigger" flows from "action" flows. If you want to take the third flow out of the equation, it becomes this:

ashleywolf87 commented 4 years ago

I like the method with 3 flows better. It seems neater especially once you have flows like this throughout the home.

The sonoff TX switches has a backlight which brightens the switch button when turned on and dims when turned off.

Say I used the first method... 1) Switch A is pressed 2) Switch A's backlight brightens to indicate the switch is on 3) The smart light turns on 4) Would Switch B's backlight turn on as well?

I think there has to be a 2nd layer of flows added to the "Toggle Smart Light flow" such as.. -When Switch A is turned on -Then Toggle Switch B -When Switch B is turn on -Then Toggle Switch B -When Switch A is turned off -Then Toggle Switch B -When Switch B is turned off -Then Toggle Switch A

This is basically to keep the "on" and "off" status on both switches in sync. Am I correct?

ashleywolf87 commented 4 years ago

Hi robert! So I've started trying to flash sonoff switch with the tasmota.bin.

I've successfully flashed the Sonoff TX T3 with tasmota.bin I've assigned the ssid and password to the device

I'm stuck at the part where I need to configure the MQTT Host ( ). How do I get that IP address from homey? Do I even obtain it from Homey's MQTT app?

I tried another method to register a static IP address via Thermite "ipaddress1 192.168.1.130" "ipaddress2 192.168.1.1" "ipaddress3 255.255.255.0"

Then I configure the module to the TX T1 3-gang.

After all that, I noticed my switches goes on and off on its own. Is this a particular symptom of a mistake I did somewhere?

I've attached a screenshot of thermite's log.

Thanks for taking the time to read this Robert! :)

capcap1

robertklep commented 4 years ago

First of all: the IP-address of the MQTT host is the IP-address of your Homey, provided that you're running the MQTT Broker app on Homey. For that to keep working properly, Homey needs to be given a fixed IP-address in your network router.

As for your lights going on and off automatically, I have no idea how that would happen apart, perhaps, because of some setting in your Tasmota configuration (perhaps a timer?).

ashleywolf87 commented 4 years ago

Oh heck, thanks for that. Still so new to the whole Homey/MQTT/tasmota flashing thing...

I've managed to set homey with a static IP address and I've realized something about the switch gangs going on and off. It only happens when it's plugged into the serial-to-USB. When I put the switch back together and hook it up to a power supply, it doesn't ghost switch. (NO, timer isnt configured).

I know this might seem silly but how do I soft reset the sonoff switch to add it as a device onto Homey?

image

robertklep commented 4 years ago

I know this might seem silly but how do I soft reset the sonoff switch to add it as a device onto Homey?

Easiest way is to restart it from the Tasmota web page.

ashleywolf87 commented 4 years ago

That image above is a screenshot when I tried to add a Sonoff switch via the Sonoff app on the Homey App. After typing in the IP address, port, mqtt username and password, it would just search and wait for a soft reset and timeout.

Is there a special procedure to add Tasmotized Sonoff switches as Homey’s devices?

robertklep commented 4 years ago

If the Homey app is looking for the device during pairing, and it doesn't find it after you restarted the device, the issue might be with the Tasmota version that you're running (v7). I haven't tested the Homey app with that firmware.

ashleywolf87 commented 4 years ago

I see. Is there a way I can download an older firmware version which is known to work?

robertklep commented 4 years ago

The last v6 release is v6.7.1, you can upload a firmware through the Tasmota web server.

ashleywolf87 commented 4 years ago

No chance for a ".bin" file?😎

Guess I'll have to learn something new again if there isn't a bin file 🤪

robertklep commented 4 years ago

.bin files are at the bottom of the page I linked to.

ashleywolf87 commented 4 years ago

Oh lord, sorry sorry! Alright I'll try this older tasmota version first. Finger crossed! Thanks for all the advice and help Robert :)