DS2423 counter

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
a.g. pennypacker
New user
Posts: 1
Joined: 25 Feb 2021, 19:04

DS2423 counter

#1 Post by a.g. pennypacker » 25 Feb 2021, 19:16

I have a DS2423 counter for 1-wire net. It has 2 inputs and a battery backup. Is it possible to connect this counter to a Wemos D1 mini?
Its connected to a S0 output at my powermeter.

My wemos has this firmware: ESP_Easy_mega_20210223_normal_ESP8266_4M1M

I had this counter in a 1-wire net before wich i dont use anymore. Sinse it is still connected to my S0 output i thought it would be fun to connect it to a wemos instead

This is how counter are connected to my powermeter today. https://wiki.m.nu/index.php/Inkoppling_ ... C3%A4knare
Sorry for the Swedish in that link.


Could anyone please help me how i should connect and configure ESP Easy.

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

Re: DS2423 counter

#2 Post by TD-er » 25 Feb 2021, 20:27

Hmm the documentation page for the plugin is lacking some in-depth info I guess....
https://espeasy.readthedocs.io/en/lates ... #p100-page

The plugin is included in the "custom" builds, not the "normal" build.
Its label suggests it should be in the "testing" build, but it is later excluded for "LIMIT_BUILD_SIZE" builds, which is... the testing build :(

ToniA
Normal user
Posts: 69
Joined: 26 Aug 2016, 20:37

Re: DS2423 counter

#3 Post by ToniA » 26 Feb 2021, 21:02

I wrote that plugin, at least in my home environment it's working fine. You just need to build the image yourself to include it.

You need three wires between Wemos D1 mini and the Dual Counter board:
* +5V to 5V on Wemos
* GND to G on Wemos
* DQ to D4 (GPIO-2) on Wemos, on D4 you don't need an external pullup resistor for the 1-wire bus

Sherif
New user
Posts: 9
Joined: 04 Dec 2017, 23:01

Re: DS2423 counter

#4 Post by Sherif » 06 Mar 2025, 16:14

ToniA wrote: 26 Feb 2021, 21:02 I wrote that plugin, at least in my home environment it's working fine. You just need to build the image yourself to include it.

You need three wires between Wemos D1 mini and the Dual Counter board:
* +5V to 5V on Wemos
* GND to G on Wemos
* DQ to D4 (GPIO-2) on Wemos, on D4 you don't need an external pullup resistor for the 1-wire bus
Do you know if exist pluggin of DS2423 which allow to simply reads counter A and B ?
The current one give incremental value, which is not useful in my application.

User avatar
Ath
Normal user
Posts: 4269
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS2423 counter

#5 Post by Ath » 06 Mar 2025, 22:10

Sherif wrote: 06 Mar 2025, 16:14 Do you know if exist pluggin of DS2423 which allow to simply reads counter A and B ?
The current one give incremental value, which is not useful in my application.
That wasn't yet supported, though the value is available, it just wasn't accessible. I've added PR #5276. This GH Actions run is started to build the binaries for you to test.
The CountTotal value is available from rules, on displays etc. by using variable [<TaskName>#CountTotal]
Please report your findings :)
/Ton (PayPal.me)

Aria James
Normal user
Posts: 10
Joined: 08 Mar 2025, 20:47

Re: DS2423 counter

#6 Post by Aria James » 12 Mar 2025, 20:54

Yep, you can definitely connect the DS2423 to your Wemos D1 Mini using the 1-Wire plugin in ESPEasy. Just connect DQ to GPIO4 (D2) with a 4.7kΩ pull-up to 3.3V, GND to GND, and VCC to 3.3V. Then, enable the 1-Wire plugin in ESPEasy and set it up. Should work great!

User avatar
Ath
Normal user
Posts: 4269
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS2423 counter

#7 Post by Ath » 13 Mar 2025, 21:09

Sherif wrote: 06 Mar 2025, 16:14 Do you know if exist pluggin of DS2423 which allow to simply reads counter A and B ?
@Sherif Are you able to test the build with the added feature of CountTotal? When logged in to your (free) Github account you can download the desired binaries from here
/Ton (PayPal.me)

Sherif
New user
Posts: 9
Joined: 04 Dec 2017, 23:01

Re: DS2423 counter

#8 Post by Sherif » 14 Mar 2025, 23:51

Ath wrote: 13 Mar 2025, 21:09
Sherif wrote: 06 Mar 2025, 16:14 Do you know if exist pluggin of DS2423 which allow to simply reads counter A and B ?
@Sherif Are you able to test the build with the added feature of CountTotal? When logged in to your (free) Github account you can download the desired binaries from here
My apologise for late answer, I have not received any notification about answer.
I upload new FM but dont see any changes, in device I do see same choice and got only delta:
Zrzut ekranu 2025-03-14 234947.jpg
Zrzut ekranu 2025-03-14 234947.jpg (84.93 KiB) Viewed 861 times
I m begginer in ESP so dont know what do you mean by [<TaskName>#CountTotal]

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

Re: DS2423 counter

#9 Post by TD-er » 15 Mar 2025, 00:39

Sherif wrote: 14 Mar 2025, 23:51 [...]
I m begginer in ESP so dont know what do you mean by [<TaskName>#CountTotal]
Everywhere in ESPEasy where you want to reference a "taskvalue" (meaning an output value of some measurement), you can refer to it using this notation.

For example if you have a task for a very common temperature/humidity/air-pressure sensor named "bme280" which has task values "temperature", "humidity" and "pressure".
Then you can refer to those values using these kind of notations:

Code: Select all

[bme280#temperature]
[bme280#humidity]
[bme280#pressure]
For example to show the latest measured values on a display.
Or use them in calculations, in an email, in logs, etc.

So when Ton mentions [<TaskName>#CountTotal]
He means you can replace <TaskName> with the name of your task you created for this DS2423 counter plugin.

Assume you have named your task "MyCounter", then you can use [MyCounter#CountTotal] (including the square braces [] )

User avatar
Ath
Normal user
Posts: 4269
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS2423 counter

#10 Post by Ath » 15 Mar 2025, 10:52

I've considered to add the CountTotal value as a 'visible' value for the plugin, but that will increase the code size somewhat more, as it should be possible to disable (disabled by default), to not break current configurations that send the CountDelta value to a controller.
Will add this as an optional setting.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 4269
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS2423 counter

#11 Post by Ath » 15 Mar 2025, 12:14

I've added an option to enable CountValue as a regular Value for the plugin, disabled by default, and also enabled the Plugin Stats feature.

@Sherif:
As you seem to be using an ESP8266 build (and GH Actions Runs are not building every committed change, at the moment), I've compiled an ESP8266 Collection B build for you to test: Please report your findings. ;)
/Ton (PayPal.me)

Sherif
New user
Posts: 9
Joined: 04 Dec 2017, 23:01

Re: DS2423 counter

#12 Post by Sherif » 15 Mar 2025, 13:00

TD-er wrote: 15 Mar 2025, 00:39 For example to show the latest measured values on a display.
Or use them in calculations, in an email, in logs, etc.

So when Ton mentions [<TaskName>#CountTotal]
He means you can replace <TaskName> with the name of your task you created for this DS2423 counter plugin.

Assume you have named your task "MyCounter", then you can use [MyCounter#CountTotal] (including the square braces [] )
ok, but what I have to do with this syntax ?
When I executed it as command I got:
Command unknown: 0.00
Also what define a device name ? If it is in device tab then there is no possiblity to choose TotalSum for A and B.

User avatar
Ath
Normal user
Posts: 4269
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DS2423 counter

#13 Post by Ath » 15 Mar 2025, 13:43

Sherif wrote: 15 Mar 2025, 13:00 ok, but what I have to do with this syntax ?
When I executed it as command I got:
Command unknown: 0.00
Also what define a device name ? If it is in device tab then there is no possiblity to choose TotalSum for A and B.
You should start with enabling Rules in the Tools/Advanced page, if that's not already enabled.

There is no TotalSum available from this plugin, as only the count from either the A or the B counter is read, but we can still retrieve that value:
- You already have Licznick_A for task (device) 1, ok.
- Add another device task, using the same plugin DS2423, and probably should name that Licznik_B. Give that the same settings as Licznik_A, except using Counter B.
- Add another device task, using the Dummy Device, give that the Name Licznik (used as an example), and change the Values name from dummy to TotalSum. It can have an Interval setting of 0.
- For each task you can configure the Controller as desired, if you are using a Controller.
- Add in the Rules tab this code:

Code: Select all

on Licznik_A do
  let,1,[Licznik_A#CountTotal]+[Licznik_B#CountTotal] // Add both values
  TaskValueSetAndRun,Licznik,TotalSum,[var#1]  // Store the value in the Dummy Device, and send the data out
endon
This code *only* counts the TotalSum when Licznik_A is read (every Interval seconds), so no need to also do that for Licznik_B.

You now have all counter values available:
- [Licznik_A#CountDelta]
- [Licznik_A#CountTotal]
- [Licznik_B#CountDelta]
- [Licznik_B#CountTotal]
- [Licznik#TotalSum]

And they can all be sent to a Controller (not sure what you are using to collect the data)

When finding this via search:
NB: This requires the feature of having the CountTotal value available, as newly introduced via the PR linked above!
NB2: The PR has been merged on 2025-03-15, so releases after this date will have this feature available.
Last edited by Ath on 16 Mar 2025, 15:08, edited 1 time in total.
/Ton (PayPal.me)

Sherif
New user
Posts: 9
Joined: 04 Dec 2017, 23:01

Re: DS2423 counter

#14 Post by Sherif » 15 Mar 2025, 13:49

Ath wrote: 15 Mar 2025, 12:14 I've added an option to enable CountValue as a regular Value for the plugin, disabled by default, and also enabled the Plugin Stats feature.

@Sherif:
As you seem to be using an ESP8266 build (and GH Actions Runs are not building every committed change, at the moment), I've compiled an ESP8266 Collection B build for you to test:
ESP_Easy_mega_20250315_collection_B_ESP8266_4M1M.zip

Please report your findings. ;)
Thank you so much !!!
Yes, it is working ;)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests