-
Hi guys. I need a bit of help and first of all, i'm not skilled in scripting and stuff, so keep that in mind and answer like you would to someone who doesn't know this stuff. All i did was by trying and reading online how to do each thing. So long story short i went into flashing several devices with tasmota and made some automations and controllers with temp/hum sensors. I'm using I2c bus for temp/hum sensor on flashed sonoff basics, since all non i2c sensors i tried were not suitable for high humidity or they were really slow. This one is extremely fast and responsive. On the other hand these sensors are around 3usd on aliexpress, come in ptfe housing to use in high humidity. Its for mushroom tent, other sensors failed and got flooded then reading stayed at 100%, this one will drop as soon as humidity drops. So. Everything is fine, but due to long line every few days/weeks usually, at least one device looses data, no addresses on i2c found then, need to restart tasmota/esp to get it back up. I did buy some i2c bus repeaters on ali to try PCA9515A, which helped a lot, before that i also tryed with pull ups, which also helped, maybe not as much as repeaters. Still one device looses data now, as i said usually every few weeks. I also have oled displays on 2 of them in parallel. And when sensor reading goes flat(in HA) also display freezes and stays ON - I have automation to turn off at 21:00. Esp is still accessable via IP. So i would not like to short the cable which is over 2 meters, since i need it for tent, but would like to know if there is a way or command that restarts i2c bus, or tasmota, when data is lost? I love this setup and this is the only issue. Been looking for solution, googling for long time, then i had other stuff and kinda left that issue. Now i got annoyed again, i don't have tent setup right now, so they are just staying here to see temperature and humidity on controller in my home. Once i will have tent setup, this will be a problem, if i will automate based on humidty to turn on/off the humidifer. Hope someone can help with this :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Basically, 2 meter of cable is way too long for I2C, which is designed as a bus for communication within a device. Outside of that, it is quite susceptible to attenuation, capacitance issues, electrical noise and signals getting "muddy" instead of looking anything like digital. That long wires also means that you have a risk of not supplying the sensors the voltage needed. I'd recommend checking such details, to see how bad life is for the sensors..... Sure, trying to improve the signals with repeaters, pull ups and so on, may help in borderline unusable cases, but it still is outside of how the I2C bus is meant to be used. When it comes to restart, if you want to try bad workarounds, the command is |
Beta Was this translation helpful? Give feedback.
-
Thanks for quick answer. I'm aware of the fact cable is too long but hey, its best setup i got up. This runs for a year or two constantly, no other issues, besides loosing data. Even if something dies its cheap. Also have a lot of sonoffs basics i was buying for 5usd, so i just replace if something happens. I had an INKBIRD humidity controller and it was very bad compared to this setup. I made a whole controller with 2 sockets for fan and humidifier and other things i needed on it. Bought few spare sensors too if they die, but so far none of them did. Just wanna get around this.. Readings are perfectly fine when its on, everything else is without issues.. Could you tell me how i do that bad get around? As i said i'm not skilled in scripting and writing commands. How do i write a rule to detect when i2c sensor looses data and get it to restart? Please? Its a SHT3x sensor. Teleperiod 10 to get constant data and graph data in HA, if that info is needed in any way... Heres my rule also: |
Beta Was this translation helpful? Give feedback.
-
Well all this makes sense. Now as you wrote it of course. Connecting the dots :) The reason behind SBasic is because it is powered directly by AC on input, and you get AC on output, which is usable in this case where i need to power 230V devices. I will keep in mind your opinion for other work/project if i get into it. I also have some ESP32 boards, WemosD1, but this all need extra power supply, wheres with basic i just need a cable with plug and plug it into socket and its up. It has internal 3.3V for powering this sensor too and such. On output i can directly connect devices via built in relay. And i would also need a relay boards then if i would use esp boards. Well thank you very much. I appreciate it. I will play around this. Wish you all the best. |
Beta Was this translation helpful? Give feedback.
Something like adding the command
RuleTimer 600
(10 minutes or whatever you think works for you) to the existing rule to displaySHT3X#Temperature
. And an additional ruleon Rules#Timer==1 do Restart 1 endon
. (For context, rules is a very different thing than the optional scripting feature of Tasmota).The key here is to not even try to detect when it loses data, but to detect when it provides data. Something is rotten if it fails to come up with values for 10 minutes (or whatever). One reason to pick a relatively long interval is to cut down on incessant restarts if it did not help. If you want to have fun learning rules, you could do something to manage that, if you think that it would …