BrettSheleski / SmartThingsPublic

36 stars 23 forks source link

Add Tasmota Version Detection to Device Handler #19

Closed BrettSheleski closed 5 years ago

BrettSheleski commented 5 years ago

Things such as the supported modules and GPIO device seem to change ID numbers between versions of the Sonoff-Tasmota version installed on the device.

Add version detection to do version-specific detection for 4.x, 5.x, and 6.x.

Hint: User command Status 2 to retrieve the Sonoff-Tasmota version number

frogale commented 5 years ago

Hi to all. Thanks for handler! Any news about automatic status updating when button is manually pressed? Erocm123's firmwares and device handlers have this feature but his firmwares are very unstable (stucks, resets to default settings, problems when password is used etc). Tasmota looks better and more sturdy. But status updates are crucial for my home (I am using Sonoffs connected with regular dumb switches and I need to know when someone press them).

BrettSheleski commented 5 years ago

There is a way of getting it working using my Tasmota SmartApp and something like Node-Red to forward certain MQTT messages to the SmartApp. See here for more info.

I know needing to have a separate service running to proxy the MQTT messages to the SmartApp isn't ideal, but it does work.

I also forked the Sonoff-Tasmota project itself to add SmartThings integration directly into the Sonoff-Tasmota firmware. However that is slow moving as I just don't have the time to do much with it. Feel free to take a look and contribute. Currently, I only have the web interface setup to input the necessary info SmartThings requires, but other than that there's nothing. Here's my fork/branch: https://github.com/BrettSheleski/Sonoff-Tasmota/tree/smartthings. Once I get it working I plan on submitting a pull request to get it into the main Sonoff-Tasmota firmware.

I also have a SmartThings SmartApp OAuth helper NodeJS project that helps getting the required OAuth token in order to help do integrations with SmartThings. See https://github.com/BrettSheleski/SmartThings-SmartApp-OAuth-Helper. I made this so I can implement something similar within my Sonoff-Tasmota fork/branch.

For the short term I may just have fields setup in the Sonoff-Tasmota web interface to enter the necessary info which may be gotten using the SmartThings OAuth Helper. Then implement the OAuth handshake in the Sonoff-Tasmota firmware itself later.

Having said all this, getting this working in the Sonoff-Tasmota firmware aint gonna be any time soon. You'll just have to use the SmartApp and some way to proxy communication from your Sonoff device(s) to the SmartApp (my Node-Red example flow is one possible solution).

alexjcgdf commented 5 years ago

Hello Brett;

I am following up the handler for the Sonoff Tasmota for a long time but now that I finally got the Tasmota firmware to run I am not being able to find the handler anymore :) . it says the page doesn't exists anymore.

BrettSheleski commented 5 years ago

See here: https://github.com/BrettSheleski/SmartThingsPublic/tree/master/devicetypes/brettsheleski/tasmota.src

alexjcgdf commented 5 years ago

Before everything: THANKS A LOT for the reply. On that device handlers the one that is missing: https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/brettsheleski/tasmota.src/tasmota-power.groovy is there a place where I can find it?

Once more thanks!!!!

BrettSheleski commented 5 years ago

I'll have to fix the link. The correct link should be https://github.com/BrettSheleski/SmartThingsPublic/blob/master/devicetypes/brettsheleski/tasmota-power.src/tasmota-power.groovy

BrettSheleski commented 5 years ago

Link updated.

alexjcgdf commented 5 years ago

Awesome. Works like a charm. I was looking at the source code for the smartapp - regarding the refresh rate that goes for every 1 minute. Where do we change the time? Is it possible? Does that increase network load? Thanks!

BrettSheleski commented 5 years ago

The auto-refresh should probably be removed that as I dont think it actually works.

The SmartApp is intended to be called from something on your local network via HTTP and include the updated state of the device. I have a Node-Red flow that works, but is not exactly straight forward. I want to simplify it, but that would require modifying the Sonoff-Tasmota firmware itself (which I have a fork of and intend on adding this functionality myself, time permitting, which is very infrequent).

alexjcgdf commented 5 years ago

Gotcha. So the Smartapp itself doesn't work? It looks for me that works, sometimes less but every 1 minute it refresh the state and show the actual one. :)

"(which I have a fork of and intend on adding this functionality myself, time permitting, which is very infrequent)."

I saw that and hope you got the time and I feel you when you talk about time.... Have the same issue here, wife kids, work...

Anyways, thanks a lot! Already using here.

Em ter, 28 de ago de 2018 19:20, Brett Sheleski notifications@github.com escreveu:

The auto-refresh should probably be removed that as I dont think it actually works.

The SmartApp is intended to be called from something on your local network via HTTP and include the updated state of the device. I have a Node-Red flow that works, but is not exactly straight forward. I want to simplify it, but that would require modifying the Sonoff-Tasmota firmware itself (which I have a fork of and intend on adding this functionality myself, time permitting, which is very infrequent).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BrettSheleski/SmartThingsPublic/issues/19#issuecomment-416759761, or mute the thread https://github.com/notifications/unsubscribe-auth/AcmjzDp1LSzM1Y-Ate39NMPn9QuXrzbsks5uVcJCgaJpZM4VfWV5 .