Serial MCU controlled relay/switch
Moderators: grovkillen, Stuntteam, TD-er
Re: Serial MCU controlled relay/switch
But you must new configure your device! The plugin get a other number...
Re: Serial MCU controlled relay/switch
No. If you didn't factory-reset your ESP before new flashing, it didn't loose the config. It starts with the last config.
Or flash a blank (with the suitable size of the ESP-flash) image before the new one, to clean it.
Or flash a blank (with the suitable size of the ESP-flash) image before the new one, to clean it.
Re: Serial MCU controlled relay/switch
Ok, I flashed it with the PUYA image that I had used before, and the module came up fine. I configured it to talk to the wifi network, and all was well. The I tried to flash the newer ESP_Easy_mega_20200029 4M1M images, but none of them would come up and work. No contact on the wifi network, and no blue blinks as is normally seen on the PUYA image.
I used the test and custom loads, (all 4M1M .bin's) and no go. So I am clearly doing something wrong, as this isn't even getting the core functionality to work. It's still in the programmer connected to USB power (but flipped back to the UART position after programming), and I can't even connect to it via WiFi.
Any ideas?
thx
mike
I used the test and custom loads, (all 4M1M .bin's) and no go. So I am clearly doing something wrong, as this isn't even getting the core functionality to work. It's still in the programmer connected to USB power (but flipped back to the UART position after programming), and I can't even connect to it via WiFi.
Any ideas?
thx
mike
Re: Serial MCU controlled relay/switch
If you had a PUYA build working, then you had 1M build?
PUYA chips only were in 1M flash sizes, as far as I know at least.
So make sure you have a build for the right flash size.
PUYA chips only were in 1M flash sizes, as far as I know at least.
So make sure you have a build for the right flash size.
Re: Serial MCU controlled relay/switch
That was the problem, I needed to use the 1M image. However, when loading that version, I don't see any option for a serial controlled switch in the device types. This is with: ESP_Easy_mega_20200829_normal_ESP8266_1M.bin
There don't appear to be any "test" builds that are 1M in size, at least for the latest pre-release version. This is why I asked the question in the first place about which load works on the LC Tech switch 8266 and has the serial port switch compiled in.
Is there another place to get downloads than the github repository that would have an updated 1M build with the serial switch support compiled in?
Re: Serial MCU controlled relay/switch
Same here with 'ESP_Easy_mega_20200829_normal_ESP8266_1M_VCC.bin'. No 'Serial MCU controled switch' available !
Re: Serial MCU controlled relay/switch
It is indeed labeled "testing" so only appears on the "test" builds.
I can make a separate build definition for this one.
If you're using it on a 1M unit, then you probably also don't have lots of other plugins needed, right?
I can make a separate build definition for this one.
If you're using it on a 1M unit, then you probably also don't have lots of other plugins needed, right?
Re: Serial MCU controlled relay/switch
I need it on my MOES WIFI Dimmer with 1MB Flash.
I use only:
- openHAB MQTT
- Serial MCU controlled switch
- Switch input
Maybe 'Generic dummy device' is a good idea... But I'm not currently using it.
I use only:
- openHAB MQTT
- Serial MCU controlled switch
- Switch input
Maybe 'Generic dummy device' is a good idea... But I'm not currently using it.
Re: Serial MCU controlled relay/switch
Can you make an issue for it, or else I may forget about it tomorrow.
Re: Serial MCU controlled relay/switch
Right, this is for the LC Tech switches in this thread, so not a lot of other stuff in terms of devices for me and I suspect people in this thread.
thx
mike
Re: Serial MCU controlled relay/switch
So somtheing like this should be OK:
Code: Select all
"CONTROLLER_SET_ALL",
"NOTIFIER_SET_NONE",
"PLUGIN_SET_ONLY_SWITCH",
"USES_P001", # Switch
"USES_P026", # Sysinfo
"USES_P029", # Domoticz MQTT Helper
"USES_P033", # Dummy
"USES_P037", # MQTT import
"USES_P081", # Cron
"USES_P091", # SerSwitch
Re: Serial MCU controlled relay/switch
TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...TD-er wrote: ↑03 Sep 2020, 09:15 Made a PR for it:
https://github.com/letscontrolit/ESPEasy/pull/3243
And a test build: https://www.dropbox.com/s/zoaeuzyy4hcp5 ... M.bin?dl=0
thx!
mike
Re: Serial MCU controlled relay/switch
Have you tested the test build I made?fresnoboy wrote: ↑03 Sep 2020, 23:15TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...TD-er wrote: ↑03 Sep 2020, 09:15 Made a PR for it:
https://github.com/letscontrolit/ESPEasy/pull/3243
And a test build: https://www.dropbox.com/s/zoaeuzyy4hcp5 ... M.bin?dl=0
thx!
mike
Re: Serial MCU controlled relay/switch
Yes indeed. I flashed it fine and it booted and ran on the esp8266, and picked up the config from the last flash I had done on it. It seems to find the hardware, though the code for the serial controlled switch seems different than what is in the PUYA version, which has a field for the # of relays in the device as opposed too assuming 4. Based on the switch used, this should work fine, though it will report more relays up to MQTT than actually exist.TD-er wrote: ↑03 Sep 2020, 23:36Have you tested the test build I made?fresnoboy wrote: ↑03 Sep 2020, 23:15TD-er, I need the openhab MQTT plugin as well. That tends to be a very popular MQTT client...TD-er wrote: ↑03 Sep 2020, 09:15 Made a PR for it:
https://github.com/letscontrolit/ESPEasy/pull/3243
And a test build: https://www.dropbox.com/s/zoaeuzyy4hcp5 ... M.bin?dl=0
thx!
mike
Re: Serial MCU controlled relay/switch
So this is a bug?
What should it do and what do you now see on MQTT?
Would be nice to see MQTT output.
And also if it really is a bug, it would be great to have it on Github (not on the forum, as it hard to find later)
What should it do and what do you now see on MQTT?
Would be nice to see MQTT output.
And also if it really is a bug, it would be great to have it on Github (not on the forum, as it hard to find later)
Re: Serial MCU controlled relay/switch
Sorry for not being clear, the build didn't have the Openhab MQTT agent in it which is what I normally use and have a working config for.
Re: Serial MCU controlled relay/switch
Not any controller?
Can you try this one? https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
It has the stable controllers included.
Can you try this one? https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
It has the stable controllers included.
Re: Serial MCU controlled relay/switch
It still doesn't have the Openhab MQTT controller in it as the original PUYA one in this thread did, but I figured out how to get the Domoticz MQTT to work with my broker so at least for me, it seems to be a good replacement.TD-er wrote: ↑05 Sep 2020, 14:27 Not any controller?
Can you try this one? https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
It has the stable controllers included.
I'll test it over the next few days and see if its more reliable.
Will this be one of the standard github builds going forward?
thx
mike
Re: Serial MCU controlled relay/switch
What controller do you need then?
It should include these:
It should include these:
Code: Select all
#ifdef CONTROLLER_SET_STABLE
#define USES_C001 // Domoticz HTTP
#define USES_C002 // Domoticz MQTT
#define USES_C003 // Nodo telnet
#define USES_C004 // ThingSpeak
#define USES_C005 // Home Assistant (openHAB) MQTT
#define USES_C006 // PiDome MQTT
#define USES_C007 // Emoncms
#define USES_C008 // Generic HTTP
#define USES_C009 // FHEM HTTP
#define USES_C010 // Generic UDP
#define USES_C013 // ESPEasy P2P network
#endif
Re: Serial MCU controlled relay/switch
USES_C005 is the one I was referring to... Would be great if that were included.
Thx
Mike
Thx
Mike
Re: Serial MCU controlled relay/switch
It should be included in the last test build I linked : https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
But since the build size hardly differs from the one I made before, I think it must also be included in the one before.
But since the build size hardly differs from the one I made before, I think it must also be included in the one before.
Re: Serial MCU controlled relay/switch
TD-er, I am very sure that build only has:TD-er wrote: ↑06 Sep 2020, 21:48 It should be included in the last test build I linked : https://www.dropbox.com/s/8xfhij4jpioq0 ... M.bin?dl=0
But since the build size hardly differs from the one I made before, I think it must also be included in the one before.
Standalone
Domoticz HTTP
Domoticz HQTT
Generic HTTP
ESPEasy P2P Networking
At least thats the only thing I see when I go to controllers and select the protocol menu option.
thx
mike
Re: Serial MCU controlled relay/switch
PS I also don't see an option in this build for a log ("Open log output") in the tools page. The realtime updating log is pretty handy for debugging things. Did it move to a different place in the newer builds?
Re: Serial MCU controlled relay/switch
No, that's probably got something to do with me selecting the "OTA" definition to make a smaller build.
That macro also disables a lot of debug logs and some more like timing stats etc.
But since it won't fit in OTA-sizes, I guess it does not make sense to keep it small.
I will enable it and make a new test build.
New test build: https://www.dropbox.com/s/8vx1cadxlz8rb ... M.bin?dl=0
That macro also disables a lot of debug logs and some more like timing stats etc.
But since it won't fit in OTA-sizes, I guess it does not make sense to keep it small.
I will enable it and make a new test build.
New test build: https://www.dropbox.com/s/8vx1cadxlz8rb ... M.bin?dl=0
Re: Serial MCU controlled relay/switch
Ah! Perfect! All the controllers from the original PUYA build and more, and the log window as well. I'll work on configuring this and see how well it works!TD-er wrote: ↑06 Sep 2020, 22:28 No, that's probably got something to do with me selecting the "OTA" definition to make a smaller build.
That macro also disables a lot of debug logs and some more like timing stats etc.
But since it won't fit in OTA-sizes, I guess it does not make sense to keep it small.
I will enable it and make a new test build.
New test build: https://www.dropbox.com/s/8vx1cadxlz8rb ... M.bin?dl=0
Thanks so much!
mike
Re: Serial MCU controlled relay/switch
Please let me know if you're still missing something.
Otherwise I will merge it and it will be part of the next nightly builds.
Otherwise I will merge it and it will be part of the next nightly builds.
Re: Serial MCU controlled relay/switch
I am upgrading the software on my LC Tech builds with this one. It converted over from the PUYA build referenced in this thread fine, with the exception of the serial controlled switch device. After thew new firmware booted, when you go to devices, it says Plugin 165 not included in the build.
I can manually update the config and seems to work fine, but it's not a seamless upgrade. Are there two serial controlled switch plugins?
thx
mike
Re: Serial MCU controlled relay/switch
No, but you read my post here ?
Re: Serial MCU controlled relay/switch
The old provided build had a plugin ID of 165, which is from the range of the playground plugins.fresnoboy wrote: ↑07 Sep 2020, 02:03I am upgrading the software on my LC Tech builds with this one. It converted over from the PUYA build referenced in this thread fine, with the exception of the serial controlled switch device. After thew new firmware booted, when you go to devices, it says Plugin 165 not included in the build.
I can manually update the config and seems to work fine, but it's not a seamless upgrade. Are there two serial controlled switch plugins?
thx
mike
The new build I made is with the code moved to the main repository, which thus have a lower plugin ID.
So your settings of P165 should be deleted and added again to make it work with this last build.
Re: Serial MCU controlled relay/switch
Looks like the plugin in the main repository has ID 91. I've built it and see that it was being compiled. But I don't see it in the list of devices.
Re: Serial MCU controlled relay/switch
Do you have "USES_P091" defined in your build?
Re: Serial MCU controlled relay/switch
Any chance that the "Output - Domoticz MQTT Helper" device can be used to control the relay?
Re: Serial MCU controlled relay/switch
Too bad, it would make the "Output - Domoticz MQTT Helper" a lot more useful if it could do that. Another usecase is behind able to take a value from MQTT and store it in a variable. I may start a different thread on this, as it's off-topic here.
Re: Serial MCU controlled relay/switch
You could use the more generic MQTT Import plugin to receive values from Domoticz, then act on the data using the Rules event that is activated when the value changes:
Code: Select all
on MQTTImport#Value1 do
// Send (serial) command to turn on/off relay
endon
/Ton
Re: Serial MCU controlled relay/switch
My understanding is that the "Generic - MQTT Import" plugin isn't suitable to get data from Domoticz. Domoticz publishes everything under one MQTT topic (domoticz/out) in json format, example:
domoticz/out {
"Battery" : 255,
"RSSI" : 12,
"description" : "",
"dtype" : "Air Quality",
"hwid" : "5",
"id" : "82228",
"idx" : 228,
"name" : "Kitchen CO2",
"nvalue" : 621,
"stype" : "Voltcraft CO-20",
"unit" : 1
}
I haven't been able to find examples of the "Generic - MQTT Import" plugin working with Domoticz.
The nice thing about the "Output - Domoticz MQTT Helper" plugin is that it takes care of parsing the json which domoticz publishes to domoticz/out.
domoticz/out {
"Battery" : 255,
"RSSI" : 12,
"description" : "",
"dtype" : "Air Quality",
"hwid" : "5",
"id" : "82228",
"idx" : 228,
"name" : "Kitchen CO2",
"nvalue" : 621,
"stype" : "Voltcraft CO-20",
"unit" : 1
}
I haven't been able to find examples of the "Generic - MQTT Import" plugin working with Domoticz.
The nice thing about the "Output - Domoticz MQTT Helper" plugin is that it takes care of parsing the json which domoticz publishes to domoticz/out.
Re: Serial MCU controlled relay/switch
So, what are you missing?
Should it -based on the IDX value- send an event with the nvalue or svalue as eventvalue?
Should it -based on the IDX value- send an event with the nvalue or svalue as eventvalue?
Re: Serial MCU controlled relay/switch
I currently have 2 usecases:
1) Sending outside temperature and humidity values from domoticz to the ESP, so it can be displayed on an oled screen. I currently have a dzvents script which is triggered by the Buienradar device:
The values are written to the 4th (dummy) device:

And displayed on the OLED screen:

I'd like the "Output - Domoticz MQTT Helper" plugin to pick up these values from MQTT itself. In this case, follow idx 549 and put the values in the dummy device.
2) Send the state of a virtual switch in domoticz to the ESP. This ESP is a lctech board with a serial controlled relay.
At the moment a http call is done from domoticz to the ESP:

It would be nice if the "Output - Domoticz MQTT Helper" plugin could also select the relay device next to the gpio.
1) Sending outside temperature and humidity values from domoticz to the ESP, so it can be displayed on an oled screen. I currently have a dzvents script which is triggered by the Buienradar device:
Code: Select all
local FQDN0 = 'esp-easy-0.XXXX.XX'
return {
active = true,
on = {
devices = { 'BR THB' }
},
execute = function(domoticz, device)
br_thb = domoticz.devices('BR THB')
domoticz.openURL({
url = 'http://' .. FQDN0 .. '/control?cmd=TaskValueSet,4,1,' .. br_thb.rawData[1] .. ''
})
domoticz.openURL({
url = 'http://' .. FQDN0 .. '/control?cmd=TaskValueSet,4,2,' .. br_thb.rawData[2] .. ''
})
end
}

And displayed on the OLED screen:

I'd like the "Output - Domoticz MQTT Helper" plugin to pick up these values from MQTT itself. In this case, follow idx 549 and put the values in the dummy device.
2) Send the state of a virtual switch in domoticz to the ESP. This ESP is a lctech board with a serial controlled relay.
At the moment a http call is done from domoticz to the ESP:

It would be nice if the "Output - Domoticz MQTT Helper" plugin could also select the relay device next to the gpio.
Who is online
Users browsing this forum: No registered users and 37 guests