Closed vergoossen closed 4 years ago
As the module 'clicks' onto the standard available GPIO pins of the Shelly 1, I would assume the module communicates with serial communication over the RX/TX pins. As no useful other GPIO pin is available for the click on module. Which sadly makes it a bit more work to implement I guess. But would be really nice if it can get support in Tasmota.
+1 however I would like to connect a Si7021 or AM2301 humidity sensor instead as requested in #7530
What I would like is for Tosmota to support Si7021 and AM2301 humidity sensors via the GPIO-adapter that comes with the Temperature Sensor Addon for Shelly 1 and Shelly 1PM. I assume that others might like to use the same GPIO-adapter with DHT11, DHT21, or DHT22 humidity sensors for the Shelly 1 and Shelly 1PM as less expensive alternatives.
Does anyone know if there is a wired Humidity sensor like example Si7021 or AM2301 that is compatible that comes with the GPIO-adapter comes with the new Temperature Sensor Addon for Shelly 1/1PM?
https://shop.shelly.cloud/temperature-sensor-addon-for-shelly-1-1pm-wifi-smart-home-automation#312
Can I flash the Shelly 1/1PM with the latest Tosmota and then just connect a Si7021 or AM2301 sensor to a Shelly 1/1PM using their GPIO-adapter from that new Temperature Sensor Addon instead of a DS18B20 based temperature only sensor that Shelly sells for their addon?
I was hoping that Shelly themselves had plans to sell a nicely packaged Si7021 or AM2301-based wired humidity sensor would be compatible with their new GPIO-adapter for Shelly 1/1PM that comes in that Temperature Sensor Addon.
The reason that I ask is that I have a (dumb) dehumidifier and been wanting to make smart and was wondering if could manage to do so with only a single all-in-one Shelly product that would support both electricity consumption measurement like the Shelly 1PM as well as be able to via its GPIO-ports to directly connect a wired humidity sensor like the Si7021 or AM2301 sensors similar to the ones that are sold by Itead for their Sonoff TH series. For my purpose of making a smart dehumidifier, even a DHT11 or DHT22 sensor with humidity support would be better than with a sensor that only supports reading temperature.
https://www.itead.cc/wiki/Sonoff_Sensor_Si7021
Sonoff Pow or Sonoff Pow R2 with a wired Si7021 or AM2301 sensors would also work be a solution my purpose of making a smart dehumidifier but I did find any information about connecting a wired sensor to Sonoff Pow or Sonoff Pow R2 either.
Sure I could use a Shelly 1PM and a separate wireless Humidity sensor and automate it that as a solution, but I think that having wired humidity sensor like Si7021 or AM2301 directly wired to Shelly 1PM and Shelly 1 would make for nicer integrated products.
Note that this is a feature request related #7469 and pre-sale question since I have not yet bought one.
@ascillato2 as I understand it that while the GPIO ports on the Shelly 1PM is connected to mains AC power, that new GPIO-adapter that Shelly sells as part of its Temperature Sensor Addon is isolated so any sensors connected via that GPIO-adapter on the Shelly 1PM would not be directly connected to mains AC power even though the Shelly 1PM has an integrated power measurement device. See:
https://shop.shelly.cloud/temperature-sensor-addon-for-shelly-1-1pm-wifi-smart-home-automation#312
If that was not the case then it would not be legal for Shelly to sell that addon for the Shelly 1PM.
@Gamester17 The Shelly ADD-ON is isolating the sensor from mains. That is why you can connect shelly supported sensors to a shelly device through this ADD-ON. But only through this ADD-ON. And so far, only using stock firmware due this ADD-ON is not supported by Tasmota so far.
You are saying:
Sonoff Pow or Sonoff Pow R2 with a wired Si7021 or AM2301 sensors would also work be a solution my purpose of....
An that is very dangerous. You must read the docs. NEVER CONNECT SENSORS TO ANY POWER MEASURING DEVICE like a SONOFF POW or like a SHELLY without sensors ADD-ON. You can electrocute yourself. Those devices are NOT ISOLATED and your sensor will have MAINS AC. DO NOT PUT YOURSELF, YOUR FAMILY AND HOME AT RISK.
Let someone buy it, crack it open and report pin lay-out.
I have some at home. Can crack it tonight if it helps :)
There you go :)
Texts are very hard to read... Let me know if you need to know more / if I can test something.
@vergoossen Nice, thanks, is it however possible for you to get some better/sharper pictures?
What kind of pictures do you want, what do you want to see?
Guess that I just mean sharper close-ups so that you can clearly see all paths & chip text + orientations?
Are these pictures better?
Way better. No we know the 8-pin chip is a TexasInstruments ISO7221 Dual channel Digital Isolator.
GPIO03 is connected to pin 2 and would become an input. GPIO00 is connected to pin 3 and would become an output.
Both pins 6 and 7 are connected together and fed through to the second pin on the connector where the DS18B20 is connected.
So it seems in order to talk to the DS18B20 we will need a driver sending data to the DS18B20 via GPIO00 and receiving data from the DS18B20 via GPIO03.
Hmm, that sounds like a lot of work? And do you need to write a seperate driver for each sensor? For example a DHT22 needs another new driver? Or can it be a "universal" driver which can handle all already supported sensors?
At first it would be a separate driver for any sensor where it is even questionable if it would work for other sensors considering the two pin to one wire construction.
Looks to me like a nice hobby project for someone who loves Shelly and sensors ;-)
Haha yes, unfortunately I can't write C, only "web languages". Otherwise I would love to help :).
Maybe it's not that simple, but: When you configure template gpio3 to ds18x20, that should be step 1? And then tasmota should send data to gpio0? Can I test that with a serialsend in console? Or is it not that simple?
No it's not that simple. The single wire protocol used by DS18B20 is timing dependant.
What you could try is
Seeing what I wrote there is much more to it.
I think I make a basic writeup for this sensor for Shelly and let you test.
Hold on.
Ok, first post was wrong. The TI is mono directional. So theo is right. We need two different GPIOs to to transmit and receive. I'm still not sure where VCC and GND are located on the external connector. 1,2 are the GPIOs, 3 should be VCC and the rest GND. The Suotek is a transformer but I can't find a datasheet to the exact type but this looks really close http://www.suotek.com/en/products_view.asp?id=102. http://www.ti.com/lit/ds/sllsea0h/sllsea0h.pdf is the 6501 close to the suotek transformer.
Give the latest commit a try. You will have to compile yourself and make the changes I mentionend above in either my_user_config.h
or user_config_override.h
Do I still need to configure something in web interface? I selected shely1 in modules and in console i get a lot of this messages: 18:04:48 CMD: nknown"} 18:04:48 RSL: stat/tasmota/RESULT = {"Command":"Unknown"} 18:04:48 CMD: D: a/RESULT = {"Command":"Unknown"} 18:04:48 RSL: stat/tasmota/RESULT = {"Command":"Unknown"} 18:04:48 CMD: :04:47 CMD: } 18:04:48 CMD: t/tasmota/RESULT = {"Command":"Unknown"} 18:04:48 RSL: stat/tasmota/RESULT = {"Command":"Unknown"}
Turn seriallog off
Okay sorry its gone now. But, i selected shelly1 as module, but nothing comes in the webinterface/console. I also tried to configure template gpio3 to ds18x20 but nothing happens..
Other than Shelly1 or Shelly1PM there is nothing to configure. The GPIOs 00 and 03 are hardcoded.
If you see the option for DS18x20 in your gui than you did not disable the old driver (and possibly activate the new driver). The option should not be there.
Okay then I did something wrong. Ill check tonight.
Now there's no more option DS18x20 in the gui, but i still dont see anything in gui/console about the sensor.
I ordered one. Once arrived I will dive into.
Nice! I could also send one to you.
In somewhat relevant news I read on Shelly German support-forum that Dimitar Dimitrov (CEO of Allterco Robotics which makes Shelly) recently posted on Shelly's Facebook page with a statement that their next official firmware for Shelly 1 and Shelly 1PM will add support DHT22 Temperature and Humidity Sensor
https://www.shelly-support.eu/forum/index.php?thread/1547-temperatur-luftfeuchtigkeitsensor-dht22/
So my follow-up question to this is if the official Shelly firmware code is really open source not?
Shelly firmware is not open source.
@Gamester17 Shelly is not open source, what they said is that their API to control shelly devices in a local network is open and fully explained in their documentation. So, there is most people's confusion. Their firmware is closed source but how to control it externally is open and documented. So, because of that open API it is available now some third party softwares like shellyforhass plug in for home assistant.
@ascillato honest mistake given that they title it as "open source" and not "open API" on this page:
https://shelly.cloud/shelly1-open-source/
All resellers of Shelly that I can find also re-hash that "open source" title when selling the Shelly 1.
So a just a case false advertisement from Allterco Robotics when marketing their Shelly products?
So a just a case false advertisement from Allterco Robotics when marketing their Shelly products?
I don't think so. May be just a bad translation to english or bad choice of words. As soon as you enter in their site, it is explained as my previous comment.
Don't know if it makes sense. But i thought the addon has an internal pullup resistor.
@arendst did you already receive the addon? :)
Got it. Need time to dive
To start you'll need to undefine GPIO00 as LedI in the standard template as it is now being used as an input for the sensor.
So use this template when the Add-On is connected.
{"NAME":"Shelly 1PM U2","GPIO":[0,0,0,0,82,134,0,0,0,0,0,21,0],"FLAG":2,"BASE":18}
It doesn't show (additional) temperatures as the protocol still needs to be worked out...
This is what we're looking for:
15:20:10 MQT: tele/shelly1pm/SENSOR = {"Time":"2020-02-05T15:20:10","Switch1":"OFF","ANALOG":{"Temperature":34.2},"ENERGY":{"TotalStartTime":"2019-05-18T13:49:50","Total":0.068,"Yesterday":0.000,"Today":0.000,"Period":0.00,"Power":0.00},"DS18B20":{"Id":"01144A0CB2AA","Temperature":21.4},"TempUnit":"C"}
Now finding a way to integrate...
Latest dev commit (https://github.com/arendst/Tasmota/commit/186d3fcb4de1a84e9cc15860c2fb10ad74dc6624) and version 8.1.0.6 supports the shelly add-on for DS18x20.
To use it you'll need an updated Shelly 1PM template. This is the correct one:
{"NAME":"Shelly 1PM U2","GPIO":[255,255,0,255,82,134,0,0,0,0,0,21,0],"FLAG":2,"BASE":18}
Once activated go to the Module Configuration screen and enter the DS18x20 parameters like
With the latest version 8.1.0.6 now Shelly 1 also allows the above configuration.
After the restart the additional sensor(s) should be displayed like
Is the template the same for shelly1?
Is the template the same for shelly1?
No, they are different devices with different capabilities and different connections.
@vergoossen
TEMPLATES for Tasmota 8.1.0.6+ :
AFAIK they are:
OLD:
{"NAME":"Shelly 1PM","GPIO":[56,0,0,0,82,134,0,0,0,0,0,21,0],"FLAG":2,"BASE":18}
NEW with ADDON SUPPORT: {"NAME":"Shelly 1PM U2","GPIO":[255,255,0,255,82,134,0,0,0,0,0,21,0],"FLAG":2,"BASE":18}
* SHELLY 1
```yaml
OLD:
{"NAME":"Shelly 1","GPIO":[0,0,0,0,21,82,0,0,0,0,0,0,0],"FLAG":0,"BASE":46}
NEW with ADDON SUPPORT:
{"NAME":"Shelly 1 U2","GPIO":[255,255,0,255,21,82,0,0,0,0,0,0,0],"FLAG":0,"BASE":46}
And configure the sensor as in https://github.com/arendst/Tasmota/issues/7469#issuecomment-582466448
@vergoossen
Please, tell us if this template works for your SHELLY 1 with SENSOR ADDON with the DS18X20 Temp sensor under latest Tasmota (8.1.0.6). Thanks.
The updated Shelly 1 template is also embedded in the firmware so an external template is not really needed. The ds18x20 gpio module config is still needed.
And another teaser, connecting an AM2301 to the Shelly Add-On:
Working on integration...
To use a DHT family sensor use the latest commit and the following module config:
Note: for any of the three available DHT family options you always select DHT11o
for GPIO00.
@arendst Very cool! Do you also happen to own a Si7021 humidity and temperature sensor?
Si7021 sensors are latest sold by Itead for their Sonoff TH series so can be bought nicely packaged
https://www.itead.cc/wiki/Sonoff_Sensor_Si7021
https://sonoff.tech/product/accessories/si7021
Sonoff page incorrectly says it only supports -10 Celcius but it does support -40 same as AM2301
I don't but as the current driver always supported the SI7021 chances are they will also work on the Shelly Add-On
Addon is not working on 8.1.0.6 on shelly1. Template was also not in, i added myself and configured gpios, restarted device but no ds18x20 temperature shown.
Have you looked for this feature in other issues and in the docs?
Yes, couldn't find anything.
Is your feature request related to a problem? Please describe.
https://shop.shelly.cloud/temperature-sensor-addon-for-shelly-1-1pm-wifi-smart-home-automation#312 Tried to assign al gpio's to ds18b20 sensor, but it doesn't work. I think this module needs an additonal driver.
Describe the solution you'd like
Should be nice if Tasmota can support this module, it's great to attach inwall / in switchbox sensors.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
(Please, remember to close the issue when the problem has been addressed)