Serial MCU controlled relay/switch
Moderators: grovkillen, Stuntteam, TD-er
Re: Serial MCU controlled relay/switch
Can't get it to work. Relay still just turns on or off as if there are no rules.
Will have a play with the rules and see if I can get something working tho
Will have a play with the rules and see if I can get something working tho
Re: Serial MCU controlled relay/switch
Check v2:
Code: Select all
on lc#Relay0 do
if [lc#Relay0]>0
timerset,1,1
endif
endon
on Rules#Timer=1 do
relay,0,0
endon
Code: Select all
on lc#Relay0 do
timerset,1,1
endon
on Rules#Timer=1 do
if [lc#Relay0]>0
relay,0,0
endif
endon
Re: Serial MCU controlled relay/switch
Will give V2 and v3 a try and watch the logs.
I assume the rules don't need to be enabled anywhere else in the settings to enable them? Just enable rules in advance settings then create the rule for them to work.
Thanks for for assistance and patience so far.
I assume the rules don't need to be enabled anywhere else in the settings to enable them? Just enable rules in advance settings then create the rule for them to work.
Thanks for for assistance and patience so far.
Re: Serial MCU controlled relay/switch
Update.
Managed to get it working with your first code. Appears sleep and reading instructions correctly kinda help.
I had my device named Relay and say you had it name lc. A simple change in name fixed it.
Sorry for the stuff up my end.
Thanks heap in helping me out here.
Is it possible to reduce the time to less than 1 second? I will have a read and see if I can find the answer myself but just in case I fail again.
fyi all 3 rules work and give the desired result
Managed to get it working with your first code. Appears sleep and reading instructions correctly kinda help.
I had my device named Relay and say you had it name lc. A simple change in name fixed it.
Sorry for the stuff up my end.
Thanks heap in helping me out here.
Is it possible to reduce the time to less than 1 second? I will have a read and see if I can find the answer myself but just in case I fail again.
fyi all 3 rules work and give the desired result
Re: Serial MCU controlled relay/switch
Great news, you are welcome.
In rules one second is the smallest interval as i know.
I think i can implement a new command in the plugin for example "relaypulse" for smaller intervals, but due to the characteristics and speed of the serial connection the results will not be as you expect. I have an LCTech relay somewhere hidden in my shelf, will try it and publish the plugin if it can handle it.
Re: Serial MCU controlled relay/switch
Thanks for the offer but no need to worry if it isn't currently supported. This is just a test device I had laying around while I learnt the ropes. Have ordered some sonoff low voltage boards to use as the garage control runs off 24V DC and this test board is a 12v board so I will be using a power pack while I test.
Thanks again for your help. It was very much appreciated.
Re: Serial MCU controlled relay/switch
Hi.
Anyone sucessfully used this on the "ESP8266 4CH 12V WiFi" found on aliexpress ?
https://www.aliexpress.com/wholesale?ca ... H+12V+WiFi+
Anyone sucessfully used this on the "ESP8266 4CH 12V WiFi" found on aliexpress ?
https://www.aliexpress.com/wholesale?ca ... H+12V+WiFi+
Re: Serial MCU controlled relay/switch
I do not own this model, but according to this description:oleost wrote: ↑22 Aug 2018, 21:12 Anyone sucessfully used this on the "ESP8266 4CH 12V WiFi" found on aliexpress ?
https://www.aliexpress.com/wholesale?ca ... H+12V+WiFi+
https://www.aliexpress.com/item/4CH-ESP ... 90810.html
it is controlled by the standard LCTech serial commands (A0 01 01 A2...) which is supported by this P165 plugin. Also the onboard ESP-01 may require the 1MB Puya safe binary.
Re: Serial MCU controlled relay/switch
Looking for the tuya dimmer in EU format but can't find a place to buy. Any tips?
Re: Serial MCU controlled relay/switch
Hi
having this modul attached to fhem via espbridge
How can I switch the relay?
do int it at the moment via wget
but isn't there a option via esp module fhem?
Thanks
having this modul attached to fhem via espbridge
How can I switch the relay?
do int it at the moment via wget
but isn't there a option via esp module fhem?
Thanks
Re: Serial MCU controlled relay/switch
How can you execute any ESPEasy command via fhem? You can use exactly the same way the relay command, mentioned at the first post of this thread. I am using relay command via HTTP and within RULES.
I am not familiar with FHEM, but with MQTT there are a third way:
Code: Select all
<MQTT subscribe template>/cmd with payload: <command>
Re: Serial MCU controlled relay/switch
thanks
good idea via mqtt
good idea via mqtt
Re: Serial MCU controlled relay/switch
Hello. I was looking for firmware to control LCTech 4ch board and I've found this forum. Unfortunetly above link is not working anymore . Could you attach file once again.enesbcs wrote: ↑18 Jun 2018, 19:05You're right... i left out one index, and ESP did not honor buffer overflow.
Try the updated binary.
Re: Serial MCU controlled relay/switch
As always, you can find the compiled binaries attached to the first post in this thread. Try the PUYA safe binary if you are not sure which one is for your ESP-01.
Re: Serial MCU controlled relay/switch
Re: Serial MCU controlled relay/switch
Sorry, i left out the Puya binary, i forgot that previous version is not capable to handle 4ch.fahrt wrote: ↑14 Nov 2018, 21:08I've flashed with "ESPEasy_Mega_P165_1M_128kS_lwip20_PUYA.bin" but This one works only with 2 relays
Try this:
- Attachments
-
- ESPEasy_Mega_P165_1M_128kS_lwip20_PUYA.zip
- ESPEasy dev with P165
- (388.99 KiB) Downloaded 3950 times
Re: Serial MCU controlled relay/switch
Thank You for the file I'll test it on weekend
Re: Serial MCU controlled relay/switch
Re: Serial MCU controlled relay/switch
You are welcome. Maybe you can try faster serial speed, some device can be used at 115200 baud. Some can not.
Also disable command doubling if device works without it. Anyway, Wifi devices have some delays basically.
Re: Serial MCU controlled relay/switch
Hi
using latest firmware,
but FHEM is not available as controller?
Could you make a version with Fhem enabled in controller list?
OpenHAB MQTT and FHEM would be perfect
Thanks T
using latest firmware,
but FHEM is not available as controller?
Could you make a version with Fhem enabled in controller list?
OpenHAB MQTT and FHEM would be perfect
Thanks T
Re: Serial MCU controlled relay/switch
Yes i can. 4MB version will be OK?
Re: Serial MCU controlled relay/switch
Hi
thanks
perfect,
No i would need a small version for esp01S
LC TEch with 2 relays
Thanks a lot T
thanks
perfect,
No i would need a small version for esp01S
LC TEch with 2 relays
Thanks a lot T
Re: Serial MCU controlled relay/switch
OpenHab+FHEM included
Re: Serial MCU controlled relay/switch
Thanksgiving perfekt
Re: Serial MCU controlled relay/switch
Hi
could you please double check.
Do not see FHEM as Controller?
Thanks Thomas
Firmware
Build 20102 - Mega
Libraries ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3
GIT version (custom)
Plugins 11 [Normal]
Build Md5 4d44355f4d44355f4d44355f4d44355f
Build time Dec 5 2018 18:55:03
Binary filename ThisIsTheDummyPlaceHolderForTheBinaryFilename64ByteLongFilenames
could you please double check.
Do not see FHEM as Controller?
Thanks Thomas
Firmware
Build 20102 - Mega
Libraries ESP82xx Core 2_4_0, NONOS SDK 2.1.0(deb1901), LWIP: 2.0.3
GIT version (custom)
Plugins 11 [Normal]
Build Md5 4d44355f4d44355f4d44355f4d44355f
Build time Dec 5 2018 18:55:03
Binary filename ThisIsTheDummyPlaceHolderForTheBinaryFilename64ByteLongFilenames
Re: Serial MCU controlled relay/switch
Yep, sorry i forgot, that i not just deleted the file, but removed my pluginset completely before.
Recompiled.
- Attachments
-
- ESPEasy_P165.zip
- ESPEasy P165 1MB
- (781.87 KiB) Downloaded 964 times
Re: Serial MCU controlled relay/switch
thanks, perfect, working now!!
Re: Serial MCU controlled relay/switch
Hello, I have LC Tech relay x2 12v, I followed post #138 on installing ESP Easy (ESPEasy_1M_128kSPIFFS_PUYA.zip)
Everything works, MQTT, HTTP, and I can hear the switch clicking when turning it on or off, but I am not getting any output voltage from both relays, what could be the cause? This is the second board I have bought already, the first one burned(https://www.aliexpress.com/item/12V-WIF ... 34092.html) and I dont want to order another one, any ideas? Thanks
Everything works, MQTT, HTTP, and I can hear the switch clicking when turning it on or off, but I am not getting any output voltage from both relays, what could be the cause? This is the second board I have bought already, the first one burned(https://www.aliexpress.com/item/12V-WIF ... 34092.html) and I dont want to order another one, any ideas? Thanks
Re: Serial MCU controlled relay/switch
If the relay clicks the works.. my first idea is: the 12V power supply is weak to power the relays, try with larger, 1A,2A...xonecell wrote: ↑06 Jan 2019, 17:24 Hello, I have LC Tech relay x2 12v, I followed post #138 on installing ESP Easy (ESPEasy_1M_128kSPIFFS_PUYA.zip)
Everything works, MQTT, HTTP, and I can hear the switch clicking when turning it on or off, but I am not getting any output voltage from both relays, what could be the cause? This is the second board I have bought already, the first one burned(https://www.aliexpress.com/item/12V-WIF ... 34092.html) and I dont want to order another one, any ideas? Thanks
Second thought: Check soldering points of the relays at the back side, resolder them if necessary - of course check NO/NC with a multimeter previously.
Re: Serial MCU controlled relay/switch
Is there a way to use this with the 4x channel LC Tech relay? Works on my 2ch version, but the only option in 'number of relays' is 1 or 2.
Re: Serial MCU controlled relay/switch
Then you are using an old version. Latest plugin supports 4channel. Binaries attached in the first post if this thread, i guess you need the last Puya version...
download/file.php?id=3336&sid=622fad533 ... 869d1d3f58
Re: Serial MCU controlled relay/switch
You're absolutely right! thanks! Working great now.enesbcs wrote: ↑24 Feb 2019, 00:08Then you are using an old version. Latest plugin supports 4channel. Binaries attached in the first post if this thread, i guess you need the last Puya version...
download/file.php?id=3336&sid=622fad533 ... 869d1d3f58
I'm using it to simulate remote control presses on a velux blind remote - soldered wires from the output of the first three relays to up, down and stop. Using MQTT commands from homeassistant to simulate the button presses on and off. Only problem I'm having is that sometimes the delay between MQTT commands is a bit long and it thinks the button has been held (on button hold, the blinds will move until the remote button is released), meaning the blind only moves minimally before stopping. Is there a way open the relay only briefly and close it automatically after a short time (100-500ms) - like a pulse on option - so I can just send one MQTT command for the relay to turn on then immediately off again?
Re: Serial MCU controlled relay/switch
Yes. If you read the header of the plugin, you will see that "relaypulse" command is already supported:
https://github.com/letscontrolit/ESPEas ... Switch.ino
Re: Serial MCU controlled relay/switch
Yes!! I knew I'd read this somewhere but then couldn't find it again when I needed it. Thanks so much, works like a dream now!enesbcs wrote: ↑24 Feb 2019, 15:35Yes. If you read the header of the plugin, you will see that "relaypulse" command is already supported:
https://github.com/letscontrolit/ESPEas ... Switch.ino
Re: Serial MCU controlled relay/switch
Hi
is it possible to have an updated firmware?
- required:
controller:
FHEM, MQTT,
device: of courcse MCU relais
- is it possible to add generic MQTT import?
- generic system info with 4 variables?
Thanks a lot
T
Re: Serial MCU controlled relay/switch
Sorry, the latest ESPEasy version i tested with this plugin is dated 2018.08.17 with core 2.4.0 and currently i have no time for testing.
Core 2.4.1 and 2.4.2 is not working well with serial 2 way communication, and with 2.5.0 i have absolutely zero experiences. New ESPEasy versions tends to change a lot in it's core code (which requires more attention from the plugin creators), and be more complexer, even bigger than i ever needed for switching a lamp to ON. However I can compile some testing binaries to you which may work or will make your device to stop responding...
Re: Serial MCU controlled relay/switch
ok, thanks understood.enesbcs wrote: ↑07 Mar 2019, 19:44Sorry, the latest ESPEasy version i tested with this plugin is dated 2018.08.17 with core 2.4.0 and currently i have no time for testing.
Core 2.4.1 and 2.4.2 is not working well with serial 2 way communication, and with 2.5.0 i have absolutely zero experiences. New ESPEasy versions tends to change a lot in it's core code (which requires more attention from the plugin creators), and be more complexer, even bigger than i ever needed for switching a lamp to ON. However I can compile some testing binaries to you which may work or will make your device to stop responding...
Is there a plan to integrate this 165 plugin into the mega firmware?
Re: Serial MCU controlled relay/switch
New binary attached with 20190311 sources compiled against Arduino ESP core 2.5.0.
UNTESTED and totally UNSUPPORTED! Use and test only your own risk. I warned you.
Serial comm may or may not work. Puya version not mentioned so i skipped it.
(Prepare with some screwdrivers and soldering iron and serial-USB programmer, before using these binaries.)
- Attachments
-
- ESPEasy_P165_unstable.zip
- ESPEasy_P165 unstable
- (896.84 KiB) Downloaded 943 times
Re: Serial MCU controlled relay/switch
ok perfect thanks will test it
Re: Serial MCU controlled relay/switch
Hi
I checked with ESP01 and had a problem writing config data.
so setting a device destroyed the config.
Looks like it is not working.
Any idea?
thanks T
I checked with ESP01 and had a problem writing config data.
so setting a device destroyed the config.
Looks like it is not working.
Any idea?
thanks T
Re: Serial MCU controlled relay/switch
Did you use PUYA-safe builds from the previous stable release on that chip?
Re: Serial MCU controlled relay/switch
Re: Serial MCU controlled relay/switch
ok. I have a few of these relays and esp8266 laying around. After following the instructions here : viewtopic.php?f=6&t=3245&start=100#p28044 i was able to get them working by using the bin file here: viewtopic.php?f=6&t=3245&start=100#p27863 .
What i wold like to have is the source code for Arduino so i can modify the HTML used so that I can use it to unlock, lock, and or start my vehicle. I need these relays to activate systems already installed in the Jeep. Anyway thats another long story..
what am i looking for? the source code for ESPEasy_1M_128kSPIFFS_PUYA, not the BIN file becasue i want to modify the HTML that it uses. To do that, I have to load ESPEasy_1M_128kSPIFFS_PUYA into Arduino.
Thanks in advance!
-Neo
What i wold like to have is the source code for Arduino so i can modify the HTML used so that I can use it to unlock, lock, and or start my vehicle. I need these relays to activate systems already installed in the Jeep. Anyway thats another long story..
what am i looking for? the source code for ESPEasy_1M_128kSPIFFS_PUYA, not the BIN file becasue i want to modify the HTML that it uses. To do that, I have to load ESPEasy_1M_128kSPIFFS_PUYA into Arduino.
Thanks in advance!
-Neo
Re: Serial MCU controlled relay/switch
Here you can find the used ESPEasy source where you can modify HTML:neo1975 wrote: ↑01 Apr 2019, 19:58 ok. I have a few of these relays and esp8266 laying around. After following the instructions here : viewtopic.php?f=6&t=3245&start=100#p28044 i was able to get them working by using the bin file here: viewtopic.php?f=6&t=3245&start=100#p27863 .
What i wold like to have is the source code for Arduino so i can modify the HTML used so that I can use it to unlock, lock, and or start my vehicle. I need these relays to activate systems already installed in the Jeep. Anyway thats another long story..
what am i looking for? the source code for ESPEasy_1M_128kSPIFFS_PUYA, not the BIN file becasue i want to modify the HTML that it uses. To do that, I have to load ESPEasy_1M_128kSPIFFS_PUYA into Arduino.
Thanks in advance!
-Neo
https://github.com/letscontrolit/ESPEas ... a-20180818
And here is the plugin that you has to copy into ESPEasy sources:
https://github.com/enesbcs/ESPEasyPlugi ... Switch.ino
Re: Serial MCU controlled relay/switch
So finally! After days of working with this I finally got Arduino IDE 1.8.9 to compile the sketch without errors. As I patiently wait while the board flashes.. lights are blinking.. then Arduino says done! Low and behold, the board does not boot up. When i reflash using the ESPEasy_1M_128kSPIFFS_PUYA.zip and the flash tool, it works just fine. So, reflash with Arduino and nothing. I did remove some plugins but i cant see that being my issue. Any ideas what is getting me here?
Re: Serial MCU controlled relay/switch
Hi there,
I have yet another Tuya-based family of Wi-Fi switches and power outlet devices that are also controlled by the MCU and serail comms to the TYWE3S Wi-Fi module.
I'm guessing this plug-in will work fine.
I have noticed, however, that both the switches (1, 2, 3 and 4 Gang) as well as the Power outlets have current sensors. With the "Smart Life"/"TuyaSmart" app I can read the current utilization (in Watts), which I assume is being read by the MCU and the data goes, via comm, through the TYWE3S to the cloud. I assume that because there is no other GPIO connection except TX/RX on the TYWE3S.
I have briefly read the tuya serial communication protocol and have noticed that they have mentionned some other comms relating to reporting of sorts (e.g. temperature).
I'm wondering how we could add these readings to the plug-in and take full advantage of the protocol rather than just switch on, off and dim?
Thoughts?
I have yet another Tuya-based family of Wi-Fi switches and power outlet devices that are also controlled by the MCU and serail comms to the TYWE3S Wi-Fi module.
I'm guessing this plug-in will work fine.
I have noticed, however, that both the switches (1, 2, 3 and 4 Gang) as well as the Power outlets have current sensors. With the "Smart Life"/"TuyaSmart" app I can read the current utilization (in Watts), which I assume is being read by the MCU and the data goes, via comm, through the TYWE3S to the cloud. I assume that because there is no other GPIO connection except TX/RX on the TYWE3S.
I have briefly read the tuya serial communication protocol and have noticed that they have mentionned some other comms relating to reporting of sorts (e.g. temperature).
I'm wondering how we could add these readings to the plug-in and take full advantage of the protocol rather than just switch on, off and dim?
Thoughts?
Re: Serial MCU controlled relay/switch
Oh and one more thing...
The Tuya only has 1 relay and 3 (or 1 + 2 dimmer)
My tuya switches hav 1, 2, 3 and 4 relays.
I am unable to select 4 relays in the Yewelink/TUYA type
How hard is it to add the 4 relays to the TUYA switch type drop-down?
The Tuya only has 1 relay and 3 (or 1 + 2 dimmer)
My tuya switches hav 1, 2, 3 and 4 relays.
I am unable to select 4 relays in the Yewelink/TUYA type
How hard is it to add the 4 relays to the TUYA switch type drop-down?
Re: Serial MCU controlled relay/switch
I guess you did not applied the PUYA patch to the ESP core before compiling:
https://github.com/letscontrolit/ESPEas ... 3.patch#L8
Use platformio if you do not want to do that manually:
https://github.com/letscontrolit/ESPEasy/issues/2233
Re: Serial MCU controlled relay/switch
I only have a 1 gang simple Tuya based wall switch without power metering function.
So this task is free to anybody who has such a device...
Two years ago, when i ordered it, i didnt want to believe that there are no open source firmware for it, so i wrote this plugin to use it. I've decoded the protocol with Wireshark and the ESPEasy serial server plugin, also using the original Chinese Tuya API documentation with Google translate.
Re: Serial MCU controlled relay/switch
I've never seen a Tuya device with more than 3 buttons. But adding a new entry to the drop-down is really not hard.
Who is online
Users browsing this forum: No registered users and 141 guests