I just couldn't get into ESPHome. It seems like a good idea. IMHO, though, MySensors and/or Tasmota pretty much covers everything I do.
OldSurferDude
Posts
-
Time to move to ESPHome? -
Time to move to ESPHome?I have a solution for you. I call it the Wireless Serial Cable
It is a ESP device (eg. ESP-12F) flashed with the SBBridge version of Tasmota. Connected to it serially is an Arduino nano that is programmed as a serial bridge. The MySensors Home Assistant integration handles the other end.
All for about US$10.
Let me know if this works for you. I hope it does.
-
Keeping MySensors relavantHi there.
I've been using MySensors for many years now. Before I discovered MySensors I was using Arduinos and the nNF24 radio using TMRh20's library.
I think MySensors is still relevant. It serves as a simple gateway for very low level sensors and actuators. For example, I have a water lift system that takes water from a seep and pumps it up 9 meters to blue barrels. The logic to do it is simple, but communication between the various levels makes running wire not practical nor reliable in an active garden, particularly one on a hillside. Yes, power is needed, but only in a few places.
So a few relays to turn on pumps and twice as many float sensors to know when the barrels are full and empty. "Start the pump when it is full and the next level is not full. Stop the pump when empty or the next level is full" The MySensors environment is ideal for this.
ESP devices have the WiFi radio. Two downsides, the ESP devices are not as robust as Arduinos (I have a lot of dead ESP devices and very few Arduinos) and too many overwhelm the WiFi network.
Zigbee, I can't make it work reliably and like Z-Wave, it doesn't have the flexibility. Insteon falls in this category, too.
And the radio range is about the same for all systems.
Cost for Arduino or ESP is negligible compared to others.
But, again, figure out how to get the sensor data and drop into MySensors.
So help me out here, be a MySensors advocate. When appropriate, I link to MySensors in the Home Assistant forum.
-OSD
-
MySensors Serial Gateway over a wireless serial cableThe Serial Gateway on an Arduino is probably the easiest gateway to employ. The problem is that it has to be connected to the computer that is hosting the controller. In my case, the host computer is in a place that blocks radio signals. The communication will be degraded with a long cable.
Using an ESP8266 gateway is an obvious choice when the radio (eg nRF24) needs to be in a different location. Wire the radio to the ESP board. If your using and ESP-12(E/F) you'll have some more wiring as described the the document Installing Gateway Software
I find that using C++ programs for the ESP devices can get pretty convoluted. I prefer to use Tasmota for ESP devices. The Tasmota firmware can be updated Over the Air (OtA). Yes, you can add OTA to C++ programs, but my experience is that the mDNS is finicky. With Tasmota, configuration is done through the device's web page. And coding is much more simple; for this example, the configuration takes two lines.
The downside of the ESP-12F is that 5V always causes magic smoke to escape. Arduinos are much more tolerant and have more ADC ports.
Thus I ventured into creating a Wireless Serial Cable. I use Home Assistant to which I will be referring as HA. This will probably work with other controllers. I had a lot of help from the HA forum and detail the how to create the Wireless Serial Cable there.
Here I would like to share the Wireless Serial Gateway.
If you're using an ESP-12F, you'll need 3.3V power supply. The Arduino Nano needs a 5V supply, not the USB connector because the USB serial will conflict with the serial going to the ESP device
The ESP device has Tasmota ZBBridge installed (ZBBridge32 for ESP32)
configuration is:
Set module to Generic
Set GPIO15 to TCP TX and GPIO 13 to TCP RX (17 and16 for ESP32
From the ESP device command lineRule1 on system#boot do tcpstart 8888 end on rule1 onthen restart with
restart1 1On the HA side install the TCP gateway (not the serial gateway)
using the IP address of the ESP device and the port as 8888The Arduino may need to be reset to send over the initial gateway information.
-
Imitating a LoRaWAN(R) with ESP8266/ESP32 and MySensors@Eliza-Collins Thank you for a more knowledgeable explanation! When I wrote:
said in Imitating a LoRaWAN(R) with ESP8266/ESP32 and MySensors:
with a number of compromises
You filled in some of my nebulus's with:
@Eliza-Collins said in Imitating a LoRaWAN(R) with ESP8266/ESP32 and MySensors:
ADR, security, scalability, and multi-gateway roaming are among the issues that LoRaWAN resolves.
Thanks for pointing these out
-
Home Assistant Serial Gateway with Supply rail monitoringGood project. Let us know how this works out for you!
-
A year has passed...I tend to agree with @sindrome73 in that MySensors is pretty awesome as it is. Recently in the Home Assistant forum there was a discussion on adding an Arduino to an ESP device to get more I/O. Convoluted, arcane scripts were presented for various classes of sensors. I noted that once the MySensors environment is set up, adding a new sensor is very simple:
read sensor,send dataBut there are new and more capable devices than the Arduino and nRF24 radio. Development should be seriously considered into incorporating more of these devices.
Also, I see a trend that people new to DiY/IoT expect everything to work out-of-the-box. The corporate interests have seized upon this trend, offering devices that are easy to connect but have the ulterior motive of collecting data on the consumer, which is way more profitable than just selling the product.
It really comes down to us, the grass roots people, to support any and all comers to MySensors. Personally, I am not an expert, and not being one, I try to research challenges and present possible solutions from that research. I learn a lot doing thins. The more people we have coming here, the better it will be. Maybe we can pique the interest of some very clever, inspired innovator to join us.
Like Kennedy said, "Ask not what your country can do for you, but what you can do for your country."
-OSD
-
Drive household SSR with SSR and ArduinoGreat! You got it to work! And it looks professional, too! Good job!
-
Drive household SSR with SSR and ArduinoI just did a google search and found that the Legrand 4124 00 is a (noiseless) latching relay and the input is referred to as a "coil". This means to me that it is a mechanical relay, not an SSR. You should be able to drive it with an SSR.
Now the latching part. The Legrand 4124 00 needs a "pulse". It appears that the switch you are replacing is a push button, (closed only while holding the switch). This means that your Arduino must
pulse the SSR, turn it on and then, a second or two later, turn it off.Is that what you are doing?
Unfortunately, your Arduino won't know if the light is on or off.
--------- other thoughts but not very good ones
According to this article, SSR's inputs are opto-isolators. If I read the specifications correctly, the input voltage is less than 0.1V (<100m) and the short circuit current is 50mA.This means that you may be able to drive your Télérupteur Legrand with another optoisolator (for example PC817) which is driven by your Arduino. (The specs say that the input to the optoisolator needs 50mA, the Arduino specs state that it can only supply 40mA, but I have had success with doing it)
BUT You have measured Retour BP to L at 150V. The optoisolator I note cannot handle 80V Collector to emitter but only 6V emitter to collector.
Which led me to what I wrote above.
-
Drive household SSR with SSR and ArduinoIt seems you should be able to do that. I found this, "Voltage/Current Matching: The control output of the first SSR must match the required input voltage (and current) of the second SSR's control side." Most likely there is insufficient load on the output of the Arduino driven SSR to have it function.
Why not use a mechanical relay? The current you would be switching would be very, very small which means the relay would last a very long time.
-
Merry Christmas and Happy New Year.And a Scintillating Solstice :)
-
Setting parameters before system loadsure:
#define Ver 2.0 #include <EEPROM.h> // ver 2.0 range 0 through 255 // ------------------------------------------------------------------------------------clearSerialBuffer void clearSerialBuffer(){ while(Serial.available()){ Serial.read(); delay(50); } } // ------------------------------------------------------------------------------------header void header(){ uint8_t EEpromInt = EEPROM.read(0); Serial.print(F("Current value at address (0) is ")); Serial.println(EEpromInt); clearSerialBuffer(); Serial.print(F("Enter a an unsigned integer >=0 and <=255: ")); } // ------------------------------------------------------------------------------------setup void setup() { Serial.begin(115200); Serial.print(F("\n\rAddress As uint8_t ver ")); Serial.println(Ver); clearSerialBuffer(); header(); } // ------------------------------------------------------------------------------------loop void loop() { if (Serial.available()){ long inInt = Serial.parseInt(); if (inInt <0 || inInt >255){ Serial.print(F(" I don't like '")); Serial.print(inInt); Serial.println(F("'")); } else { EEPROM.write(0,uint8_t(inInt)); } header(); } } -
Setting parameters before system loadThis is very cool. In order to provision my devices, I had two programs. I loaded the first that was used to set MY_NODE_ID in location 0 of the MyEEPROM (this is where MySensors puts it). Then I would load the MySensors program.
The sCmd library is much better, though it would take up program space.
-
Integrating MySensors Data with a Custom Website DashboardI concur with @TheoL, though I understand the desire to have better control over your interface. The MySensors serial interface is well documented. You might consider MQTT as a transport mechanism. MQTT Explorer allows you to view the data which makes debugging easier.
Good luck with your project.
-
Gateway restarts a midnightI discovered the source!
When I execute
crontab -eI am editing the user cron table.
sudo crontab -eedits the root cron table. That was where the restart at midnight was.
When I was accessing the gateway (via ssh) I was user. I am running headless, which is running as root and a user instance only runs when I ssh into it, which means that editing the user cron table does not do anything (unless a user instance is running).
-
💬 No neutral power supply/relay board for in wall switchMy guess is that the the leakage power captured can only supply that amount of current (at the specified voltage)
-
💬 No neutral power supply/relay board for in wall switchI would say the 2W should be used. I say this because it would be exceptional to spec 2W and there is probably good reason to do so, though I do not know that reason.
Often times people with experience with the design reason that a different value will work. Or they find that the component doesn't mechanically fit into the modified design. (I will admit to doing this myself) I suspect that the resistor periodically is dissipating 1W (1W of tolerance). If this is the case, after many cycles, even years, the 1/2W will fail.
I will share some experience. I put 2W (12V/0.15A) into a 2W resistor. I went to pick up the board and grabbed it by the resistor and burnt the crap out of my fingers.
Overdesigning is good. Cautionary tale: Mrs. Fiorina told the printer mech designers that they make the printers too good and that they should make them cheaper. The company of which she was CEO is not doing so good today.
-
Gateway restarts a midnightThe distance to my sensors would be 20-30M through a fire separation wall, four interior walls, a ceiling and an external wall.
I, too, have done some experiments with the RFM69 and had the same experience. But they are about 10x the price of an nRF24. ($6.80 vs $0.68) The cost of the RPi zero 2W is $15 (though I've had two where the WiFi chip failed).
-
💬 No neutral power supply/relay board for in wall switchThe LNK364 has an internal 6.3V zener diode across BP and S so the 10V is OK, though the 50V is probably a better idea. The data sheet indicates the capacitance should be 0.1 μF (100nF). I'd recommend the latter. (It could be a typo in the EasyEDA)
-
Flame Sensor Not Triggering Setup@skywatch @sindrome73 This is what I do, too.
Note that it is wait(), which is a MySensors function and not delay(), an Arduino function. wait() checks for MySensors messages, delay() halts all process, thus a message might be missed.