Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Shelly addon / sensor module #7469

Closed
vergoossen opened this issue Jan 9, 2020 · 96 comments
Closed

Support Shelly addon / sensor module #7469

vergoossen opened this issue Jan 9, 2020 · 96 comments
Assignees
Labels
Add to Docs Add info to Docs enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended

Comments

@vergoossen
Copy link

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)

@ascillato2 ascillato2 added feature request (devs?) Action - awaiting response from developers help needed Action - Asking for help from the community Requires more research (devs) Action - Issue requires more research labels Jan 10, 2020
@llevering
Copy link

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.

@Gamester17

This comment has been minimized.

@Gamester17

This comment has been minimized.

@ascillato2

This comment has been minimized.

@arendst
Copy link
Owner

arendst commented Jan 16, 2020

Let someone buy it, crack it open and report pin lay-out.

@vergoossen
Copy link
Author

I have some at home.
Can crack it tonight if it helps :)

@vergoossen
Copy link
Author

578E5B7E-E3B7-4DF7-B824-7DF3FA42D16A
5631CA83-9399-478B-83CE-0CCEB2034252
050D115D-511D-40BC-B3B5-D87EC900EEB3

There you go :)

@vergoossen
Copy link
Author

vergoossen commented Jan 16, 2020

shelly addon

Texts are very hard to read... Let me know if you need to know more / if I can test something.

@Gamester17
Copy link

Gamester17 commented Jan 17, 2020

@vergoossen Nice, thanks, is it however possible for you to get some better/sharper pictures?

@vergoossen
Copy link
Author

What kind of pictures do you want, what do you want to see?

@Gamester17
Copy link

Gamester17 commented Jan 17, 2020

Guess that I just mean sharper close-ups so that you can clearly see all paths & chip text + orientations?

@vergoossen
Copy link
Author

DSC_0036
DSC_0037
DSC_0039
DSC_0040

Are these pictures better?

@arendst
Copy link
Owner

arendst commented Jan 17, 2020

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.

@vergoossen
Copy link
Author

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?

@arendst
Copy link
Owner

arendst commented Jan 17, 2020

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.

@arendst
Copy link
Owner

arendst commented Jan 17, 2020

Looks to me like a nice hobby project for someone who loves Shelly and sensors ;-)

@vergoossen
Copy link
Author

Haha yes, unfortunately I can't write C, only "web languages".
Otherwise I would love to help :).

@vergoossen
Copy link
Author

vergoossen commented Jan 17, 2020

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?

@arendst
Copy link
Owner

arendst commented Jan 17, 2020

No it's not that simple. The single wire protocol used by DS18B20 is timing dependant.

What you could try is

  • make a copy of file xsns_05_ds18x20.ino and rename it as xsns_05_ds18x20_shelly.ino
  • change the top define #ifdef USE_DS18x20 into USE_DS18x20SHELLY
  • disable define USE_DS18x20 in user_config.h (or user_config_override.h)
  • add define USE_DS18x20SHELLY in above file and recompile to check your copy is OK
  • then change reads from input port to GPIO03 and writes to output port GPIO00 (that's tricky if you don't know how to address a port/GPIO)

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.

@altelch
Copy link
Contributor

altelch commented Jan 17, 2020

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.

arendst added a commit that referenced this issue Jan 17, 2020
Experimental DS18x20 for Shelly (#7469)
@arendst
Copy link
Owner

arendst commented Jan 17, 2020

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

@vergoossen
Copy link
Author

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"}

@arendst
Copy link
Owner

arendst commented Jan 17, 2020

Turn seriallog off

@arendst
Copy link
Owner

arendst commented Apr 30, 2020

I suggest you start reading this issue from the top down and proceed to the one you just entered.

@SmartNightly
Copy link

Hi there, great work thx!

I've got connected 4 sensors to my shelly 1. But i get only 3 values. Is this hardware-limitation of the shelly addon? Or did i miss something in template config?

Bildschirmfoto 2020-06-24 um 22 53 56

@arendst
Copy link
Owner

arendst commented Jun 25, 2020

I guess more should work up to 8 but it all depends on how you connected them and if the shelly can power them.

To rule out the fourth being broken did you already swap it with the third?

@sirLeone
Copy link

sirLeone commented Sep 10, 2020

Is it possible to connect jsn-sr04t to shelly 1PM using shelly addon and above tasmota extension ?

@arendst
Copy link
Owner

arendst commented Sep 10, 2020

You can connect anything but there is no driver support for this device using the shelly addon.

rkandilarov added a commit to rkandilarov/docs that referenced this issue Dec 2, 2020
Fix missing picture. Add info about the supported "Temperature Sensor AddOn for Shelly 1/1PM" with link to the discussion arendst/Tasmota#7469 .
Still TODO - add proper template info for using the addon with ds18B20.
@wmertens
Copy link

wmertens commented Dec 14, 2020

Purely out of academic interest (for now): Would it be possible to connect an LCD module via the 1-wire interface with the addon? I'm thinking room thermostat which drives radiator valves, with a thermometer and a display, and maybe some buttons.

@pilot1981
Copy link

Hi,
anyone know if I can use temperature add-on to attach n.2 reed sensor (one for close sensor and one for open sensor)?

@wmertens
Copy link

wmertens commented Jan 4, 2021

@pilot1981 I don't know tasmota, but the add-on implements the 1-wire bus, so you need to make your reed switches talk to that, and have a driver in tasmota that supports that.

Shelly supports 1 reed switch that simply shorts the signal to ground (I believe), so then you can only have 1

@Maikel-K
Copy link

Maikel-K commented Oct 6, 2021

Would it be easy to change the maximum amount of DS18B20 sensors in the software?
I would like to use the Shelly 1PM with addon module with 6 temperature sensors too switch on floorheating pump and read the temperature of the water in and out.

@barbudor
Copy link
Contributor

barbudor commented Oct 6, 2021

And what do you think the limit is ?
There is no hard coded limit in Tasmota, you can put as many sensors as can fit into the SENSOR MQTT messages
I've seen up to 18 DS18X20

@Maikel-K
Copy link

Maikel-K commented Oct 6, 2021

As Shelly is limiting it to 3 sensors, I was thinking it was just copied those settings for example.
I saw a screenshot of only 3 sensors visible in the Tasmota home page of the device.

@pilot1981
Copy link

pilot1981 commented Oct 27, 2021

And what do you think the limit is ? There is no hard coded limit in Tasmota, you can put as many sensors as can fit into the SENSOR MQTT messages I've seen up to 18 DS18X20

@barbudor so you are able to use n.18 DS18B20 attached to the same shelly 1 using TASMOTA firmware? I think limit is related only to array dimension defined in TASMOTA firmware...

@arendst
Copy link
Owner

arendst commented Oct 27, 2021

The max limit is defined using #define DS18X20_MAX_SENSORS which is default set to 8.

Nothing stops you to change that to a different value but you will have to re-compile your binary.

An issue regarding Shelly is the fact that the hardware implementation uses two GPIO's to communicate with the DS18X20 devices making timing a problem resulting probably in the in-ability to support 18 devices.

@applechrist
Copy link

Would it be possible to use the XKC-Y25-NPN as well?

@tim4849
Copy link

tim4849 commented Jun 26, 2022

Hi all, I have connected to my Shelly 1pm temperature sensors DS18B20 via the addon sensor module. Now the timers do not work anymore. I had set up 16 timers to control (on/off) of my circulation pump. Likewise, the WEB interface responds very poorly, manual switching also does not work safely, obviously the 1pm restarts again and again.

I'm using follwing Template: {"NAME":"Shelly 1PM Temp","GPIO":[1,1,0,1,192,2720,0,0,0,0,0,224,0,4736],"FLAG":0,"BASE":18}

Who knows similar problems or what am I doing wrong? Please for help!

@ascillato
Copy link
Contributor

Hi, that seems to be an excess in power consumption. Do you have restarts when you disconnect the sensor?

@SuperMaximus1984
Copy link

Is it possible to use 2xDHT22 (AM2032) sensors in Shelly 1 with Add-on & Tasmota?
It was not possible in Shelly's standard firmware.

@chivas03
Copy link

Is it possible to use 2xDHT22 (AM2032) sensors in Shelly 1 with Add-on & Tasmota? It was not possible in Shelly's standard firmware.

Hey, have you been able to run at least on DHT22 with the Shelly1 Add-On based on Tasmota?

@SuperMaximus1984
Copy link

DHT22

Yes, sure. But there's not much sense for me to run Tasmota on Shelly as device itself unlike other ESP's does not physically support connectivity of more than 1 humidity sensor.

@notacoderjustauser
Copy link

my experience was, that the wifi connection in the 1pm is far more stable wenn running tasmota as when the original firmware is installed. This matters when the sensor is in a cellar or behind concrete walls for example.

@chivas03
Copy link

DHT22

Yes, sure. But there's not much sense for me to run Tasmota on Shelly as device itself unlike other ESP's does not physically support connectivity of more than 1 humidity sensor.

Hello, thanks for your input. For my application, it is OK to have one DHT22. (bathroom - thermostat + ventilation control)
I thought prior to use an ESP within a flush box, but with an external power supply, one relay and the sensor would lead to some extension of the available space - so I came up to use the Shelly with the add-on

@Kolia56
Copy link

Kolia56 commented Jan 26, 2024

As of 1/24/2024, DS18x20 is supported. See current development branch. See updated template as well

@sfromis
Copy link
Contributor

sfromis commented Jan 26, 2024

It was already supported for a long time, as this thread relates to ESP8266, not ESP32 and the "plus" variant of Shelly devices where it got to be supported very recently.

@Kolia56
Copy link

Kolia56 commented Jan 26, 2024

It was already supported for a long time, as this thread relates to ESP8266, not ESP32 and the "plus" variant of Shelly devices where it got to be supported very recently.

my bad, I apologise, I made a confusion because of numerous opened tabs in internet browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add to Docs Add info to Docs enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests