Connecting ds18b20 without selecting an address from the list.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
uah007
Normal user
Posts: 15
Joined: 15 Oct 2022, 23:04
Location: Ukraine, Kyiv

Connecting ds18b20 without selecting an address from the list.

#1 Post by uah007 » 15 Oct 2022, 23:36

Is it possible to modify the P004 plugin so that when only one sensor is connected to the gpio, the plugin does not require the selection of the sensor address from the list and would be connected automatically? Just like it is implemented in Sonoff TN.

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Connecting ds18b20 without selecting an address from the list.

#2 Post by TD-er » 15 Oct 2022, 23:42

Hmm this can be a bit tricky.
What if multiple tasks were configured and 1 sensor is failing?

User avatar
uah007
Normal user
Posts: 15
Joined: 15 Oct 2022, 23:04
Location: Ukraine, Kyiv

Re: Connecting ds18b20 without selecting an address from the list.

#3 Post by uah007 » 16 Oct 2022, 00:17

I'll try to formulate it differently.
If one sensor is connected to the GPIO and you do not need to select the sensor address in the "Number Output Values:Single" task, it is already only one.
If several sensors are connected to one contact, then everything works as before.
Sorry, my "knowledge" of English makes me use google translator.

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Connecting ds18b20 without selecting an address from the list.

#4 Post by TD-er » 16 Oct 2022, 00:21

Don't worry about your English. It was clear to me what you meant.

What I mean is that it might be slightly more complex than one would expect at first as it requires the plugin to check whether there are multiple instances of the same plugin active to see if seeing only 1 sensor is what is expected.

So this may become a bit more tricky than what you may think.

User avatar
uah007
Normal user
Posts: 15
Joined: 15 Oct 2022, 23:04
Location: Ukraine, Kyiv

Re: Connecting ds18b20 without selecting an address from the list.

#5 Post by uah007 » 16 Oct 2022, 00:33

It's a pity.
I used EspEasy on 28 tobacco drying chambers and sometimes I have to change the modules, and register the old sensor in the settings. This work can be difficult for service personnel, especially at night.
Thank you for the work you and your colleagues are doing.

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Connecting ds18b20 without selecting an address from the list.

#6 Post by TD-er » 16 Oct 2022, 00:37

I will look into it, but I just wanted to warn you that it might be more than a very simple 1-line code change.

However I was thinking, maybe I could add a checkbox to the plugin where the user explicitly states the task may use the "1st found" sensor.
This would remove a lot of the possible complexity and possible unexpected results.

User avatar
uah007
Normal user
Posts: 15
Joined: 15 Oct 2022, 23:04
Location: Ukraine, Kyiv

Re: Connecting ds18b20 without selecting an address from the list.

#7 Post by uah007 » 16 Oct 2022, 00:41

That would be what need!

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Connecting ds18b20 without selecting an address from the list.

#8 Post by TD-er » 16 Oct 2022, 10:53

This is a quick attempt to implement it. https://github.com/letscontrolit/ESPEasy/pull/4300
Can you test to see if it is working? I don't have my Dallas sensors at hand right now, so it is untested.

A test build can be found here, in about 30 minutes: https://github.com/letscontrolit/ESPEas ... 3258878003
N.B. you need to be logged in to GitHub to download the Binaries zip file.

User avatar
uah007
Normal user
Posts: 15
Joined: 15 Oct 2022, 23:04
Location: Ukraine, Kyiv

Re: Connecting ds18b20 without selecting an address from the list.

#9 Post by uah007 » 16 Oct 2022, 20:30

Image

That's wonderful!
Now a simple electrician can change the temperature sensor!
:)

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Connecting ds18b20 without selecting an address from the list.

#10 Post by TD-er » 16 Oct 2022, 21:16

Great!
I will merge it, so it will be included in the next build.

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests