[RELEASE] Tasmota Sync - Native and Real-time Synchronization between Hubitat and Tasmota 11 or later

Absolutely no problem at all! No rush as I'm using it myself already, just wanted to get it off my own to do list! :rofl:

Happy new year! :tada:

1 Like

Gary,

I just proposed two small PRs to the outlet plugs to replicate the energyToday value over to the standardized "energy" attribute. The change will allow the plugs to be used with my app:

2 Likes

Hi, I’m away from home until the end of February but I’ll take a look at it when I get back.

2 Likes

@garyjmilne , just wanted to drop in and say thanks. I flashed two Sonoff S31s with Tasmota yesterday, and used your drivers to integrate into Hubitat. Worked fantastic!

2 Likes

Next challenge: I have a SonOff iFan04 on the way. Hoping that flashing it will finally give me the solution for my fans I've been wanting.

I have about 6 fans w/ lights. They are the style that only has a single set of wires going to them, and the fan and light are controlled by an old-style RF remote. Not any of the new fancy computerized DC motors and smart remotes or anything.

I've made the fan on one of them work with Hubitat using an RF repeater, but it's no good for the light, since it doesn't provide feedback. And it didn't work well enough for me to roll out an RF repeater in every room.

Fingers crossed for the Tasmota solution!

Edit: I've seen that in the 4 years since I installed all those fans, various fan makers have cycled through different "smart" solutions. I saw there was a KoF zigbee solution for a bit, though people said it had a poor radio. Lately it seems like they're all either packaging a Bond hub with their fan, or forcing you to use some crappy proprietary internet-required app without an open api. Forget that. Not in my home! We go local or nothing.

I use one at home and it works well. Before you put it up in the housing there is a little LED you might want to cover up or disable as it’s quite noticeable at night.

I use one of these as my remote to cycle through the fan speeds or turn the light on or off. In fact we have two so we each have a convenient control.

I also use 3 zigbee bulbs in the fan and use the above mentioned remote to go through some preset brightness levels for daytime or nighttime use. The Advanced Button Controller software is what enables this.

2 Likes

:+1:

@garyjmilne , what would you say are your favorite Tasmota-capable devices? Up until now I've stuck to z-wave and zigbee, but now that I've tried one Tasmota, I want to try more!

The Sonoff S31 WiFi. They are about $10 each on Amazon, easy to flash and they let you access all kinds of power data which gives you options.
I use them on my washer dryer and get announcements when they stop.
I use them on my cameras so I can power cycle them.
I also have them on my gutter heaters (to melt snow and ice) and I can verify they are working based on the power stats.
I’d have one on my dishwasher but I can’t get back there.
Even if you don’t need the power data they are still a good plug.

There are a few vendors that sell pre flashed devices. It used to be possible to flash Tuya devices without opening them but that door is closed so for devices like bulbs pre flashed is the way to go.

I also like the Sonoff TH10\TH16 which is a power switch with built in temp and humidity controls. Temp and humidity and never needs batteries changed.

There are a bunch of them but all depends on your household situation.

1 Like

@garyjmilne Thanks again for an awesome group of drivers. My Sonoff iFan04 arrived and I flashed it and connected it up to Hubitat.

I just sent you a tiny pull request: Improved syncing from device back to fan driver by joelwetzel · Pull Request #7 · GaryMilne/Hubitat-Tasmota · GitHub

I found that if a fan change happened on the device (such as from the Sonoff remote), it would sync back an updated fanSpeed attribute, but not the speed attribute. This caused problems with how the fan showed in HomeKit.

1 Like

@garyjmilne One other edit I made. (But I have not sent a PR, since I don't know that it's the best solution.)

I have my Hubitat hooked up to HomeKit via HomeBridge. I'm using the Hubitat MakerAPI plugin for HomeBridge. What I found from testing was that, if I adjusted the fan speed on my phone, it was sending two commands to your driver: Yes, it would send the new speed command. But first it would send a cycleSpeed command. This caused all sorts of problems, and there were timeout errors in the logs, and nothing updated correctly.

Now, I don't think this is a bug in your driver. I think it's more likely to be a bug in the Hubitat MakerAPI plugin. But I worked around it in your driver by putting a return statement at the top of the cycleSpeed method. I don't need that method anyway. Once I did that, the integration with HomeKit worked wonderfully.

1 Like

I’m traveling for another month but I’ll take a look at it when I get home. Would be an easy fix.

1 Like

One other thing I noticed: I saw in your first post that you decided against using parent-child devices, for some good reasons. The iFan04 is a weird case because it really is 2 separate devices. A lightswitch and a fan controller, that operate pretty independently. HomeKit isn't seeing it as 2 devices, so HomeKit just focuses in on the fan part. I think my solution will be to add a virtual switch that gets bound to the state of the light in the iFan04. Then expose the virtual switch to HomeKit. That should solve it.

FYI @cjcharles submitted an update to GitHub that allows for the creation of child devices but effectively using my driver. Don’t know if it would work in this case but I plan to take a look at when I get home in March. Perhaps @cjcharles could comment on this?

FYI that the speed command\attribute in Tasmota refers to the fade speed of a bulb and has nothing to do with fan. So it seems there is something else going on here.

Could easily be modified to create child devices with the ifan but probably not super simple given the multi-switch setup works because if the sequential numbering of each switch and command.

Also perhaps the fan attribute into homekit needs a review anyway, if speed isn't working (also there are only 3 speed settings, so most variable speed/dimmer controls may get confused). I don't have any apple stuff to test with but I do have an ifan so can see how it works with the default config in android hubitat...

1 Like

I should have been more clear. In both cases, your driver was sending the FANSPEED command to Tasmota. However, when I adjusted the fan speed in HomeKit, here's what I believe was happening:

  • Homekit sends a new fan speed command to HomeBridge
  • HomeBridge then sent two commands to MakerAPI:
    • The first command caused a call to the cycleSpeed() function in your driver
    • The second command caused a call to the setSpeed() function in your driver

I believe it is an error in the HomeBridge plugin. It should only have sent the second command. To make things work well, I added a return at the start of your cycleSpeed() function, since I don't use that functionality. (And because it's much easier to fix in your driver, than trying to alter the HomeBridge plugin.)

@garyjmilne BTW, I installed the iFan04 up in the fan canopy yesterday. I really love how it works. So responsive.

1 Like

@garyjmilne, I’m noticing a lot of info logging - is there a way this could be disabled from the device driver?

This is happening with this driver: Single Relay\Switch\Plug with optional power monitoring, version 1.2.4:

https://raw.githubusercontent.com/GaryMilne/Hubitat-Tasmota/main/Single_Relay_Switch_Plug.groovy

I have to say, it’s quite impressive how well the driver works! Thanks!

Im away and don’t have access at the moment but if I recall you can set the log level to -1 to disable all logs.
FYI this log must be from a hub link device as it does not translate the HTML tags. You can turn off the HTML log enhancements in the settings.

1 Like