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

Good stuff..

I did select switchmode 3 for the switch input CH2. Also, I might not of been clear in my wording before. The 2nd switch is turned on by digital input from stateful sensor (1/0). There is no physical relay or switch involved, outside of the normal sonoff touch operation.

The external sensor is in fact an arduino uno running I2C sensor and it turns on its digital out which is connected to RX pin on Sonoff touch which is set in config to be 'Switch'. Every time I tried to use 'button' it would not respond and also since Sonoff does stuff on boot with RX/TX it would fail and cause the ESP to reset. So this is what I ended up with...

Also the sonoff is originally a 1CH US touch switch. I just used module config for 2CH so I would have the extra input. There is a lot to absorb about Tasmota and I have only discovered enough to get things going. I do not understand anything about the templates or the particulars even of module config. At this point, I just "fiddled" with it until I got the desired result. Not the way I like to about doing things but hopefully I be able to fill in the knowledge gaps as I go on and evolve into a cleaner implementation.

1 Like

Its always the simplest things that are overlooked. Switch_n instead of Switch is why my digital output from sensor board was sometimes flaky.

1 Like

Is it just me or are flash/colour commands with an RGB bulb somewhat limited in tasmota? I just tried to find a command for a Halloween effect (e.g. flicker green a few times and then go back to normal) and it was not easy at all...

In addition to tasmota making this difficult and needing backlog and a long command string, I'm not sure how this works at all in this app? Can I use backlog in the same way?

Nothing built into the firmware for the bulb to my knowledge. They do a nice job transitioning from one color to another but I think the maximum period is about 30 seconds.

I don't think it would be too bad, maybe 4-6 transitions of 30 seconds each. A little crude but some rules for holiday lights could be a fun little project. I'd make it a rule though that used backlog so you could just turn the whole thing off and on.

1 Like

Doing a Halloween flicker was my original objective, but that's a bit harder unless it's controlled by Tasmota itself (due to WiFi signal delays), but you're right backlog with a few stacked commands might just work

You know, if you get something going it would be a fun add to the Tasmota Broadcaster app. A few sample lights templates would be all it would take to get people started.

If you are not familiar with Tasmota Broadcaster you can find out more here.

Thank you for the tips @logan3089 . I also needed to get the Tuya fan/dimmer combo switch working, so I did mostly the same thing, starting with Gary's excellent Sonoff driver here. I may package this up at some point, but for now, if anyone needs to get this Tasmota-flashed Tuya fan working, you can find my working code here:

(https://raw.githubusercontent.com/virantha/tasmota/main/drivers/tasmota_fan_light.groovy)

Just FYI, you can still order a Tasmota-flashable switch with the ESP8266 module with the Esmlfe version (as of mid-Oct 22):

I did simplify some of the things in Gary's driver code, and it works fine with Alexa (say "turn off NAME" for light on/off, and say "set NAME to medium" for fan control, except for dimmer level. You also use the "configure" button to upload the RULE3, and also install all the Tasmota settings for the Tuya hardware. All the user needs to do is flash the tasmota.bin firmware, and then get it on the wifi network. The driver will do all the baud rate and tuya settings. You can set it up in the dashboard as two devices, no problem too.

Thank you again, @garyjmilne, for figuring this Rule callback stuff out and publishing your work!

1 Like

@garyjmilne
I get these error messages fairly regularly in the logs. The devices seem to be working fine. Any idea what is causing this?

errororg.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_garyjmilne_Tasmota_Sync___Single_Relay_Switch_Plug_with_PM_2176.checkPresence() is applicable for argument types: () values: (method checkPresence)

My driver does not have a checkPresence() function. I suspect you have something left over from the Markus era where you had some rules or something trying to do a presence check. Have a look at the bottom of the device and see what it is 'In Use By'. That is your culprit.

1 Like

@garyjmilne Thanks for the tip :+1:

Yep, these devices migrated over from the Markus era. It looks like the old Tasmota App (not driver) created a cron job to check presence. The problem is I removed the app from Hubitat but the checkPresence handler is still on the devices. Any idea how to remove this handler without deleting and re-adding every device?

No, I really don’t. Support may have some tools but I also notice a bunch of left over data from the old Markus driver so I’d probably delete and recreate if it were me.

@bravenel any ideas how to get rid of these orphaned scheduled handlers? I have a bunch of tasmota devices and I'd prefer to not have to delete and recreate them all if there is some other way to clear this out

What driver?

Put unschedule() in the updated() method, and hit Save Device.

2 Likes

Hey guys, I've just tasmotized a device for the first time and it happened to be a Sonoff 4CHPro R3. I didn't solder (although I have everything required), just put the connector cables and bent them slightly into the holes.
I was looking for a driver and decided to try this one and I can confirm it works! However, I have no idea how to enable the interlocking or inching modes. The official page says that they are app controlled and available for separate gangs, so I will try to figure out something. Do any of you guys have ideas on that?

@garyjmilne After a bit of testing on the sonoff 4chpro r3, I can clarify that custom actions, rules work fine, but the toggle option doesn't. Only turn the relay on. Also I've paired it with the original 433MHz RF Remote and I have the following rules:


image

The problem is that as far as I can see, the tasmota sync doesn't work properly (at all). If I switch the device using my aqara button, the relay switches and the color of my led strip changes. If I use the RF remote, the switch changes, but hubitat has no idea and therefore the rgb doesn't change. If I manually refresh the device, it gets the new value and it works. If I set a polling interval of 1 minute, it also works every minute, but that obviously would defeat the purpose of not having polling. Also even I wanted this to be case, the polling interval is still huge and anything longer than 5 seconds would be too much for my purposes.

Question is - can I help you somehow figure out what is going on with the sync and why isn't it syncing? I see the web portal is showing the changes from the remote, so the tasmota has the updated status as far as I can tell.

I suspect you have not performed the rasmotaInjectRule.

Absolutely correct, thank you very much. I've configured it on the first one, but the main testing was done with the second one and I've forgot to do it there.

If you install the Tasmota Sync Broadcaster there is an example in there for Interlock as I use it for my Speinklers.

1 Like

@garyjmilne How can I create a simple 5 sec auto-off on a single relay device. When I use your driver and in Tasmota console enter: PulseTime1 5 it immediately turns-off from On. Also, the device in HE does not sync to the OFF, it only does when I hit refresh button.

What am I missing?

@garyjmilne I want to make sure I'm understanding that correctly. If we want to get notified of power changes without polling, we DO need to set the TelePeriod? But we can set the TelePeriod fairly short since it will NOT send a message if the value didn't change, Is that correct? I think I was previously mistaken that it would send when the change happened, but it sounds like that's not quite the case. If i understand the statement above, short TelePeriod should be ok since it won't send if nothing changed.