1 wire counter DS2423 wrong data

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post
Post Reply
JMdomotique
Posts: 8
Joined: Sunday 09 April 2017 21:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

1 wire counter DS2423 wrong data

Post by JMdomotique » Sunday 03 September 2017 23:01

Version: 3.8153 now 3.873
Platform: Raspberry Pi 3
Plugin/Hardware: RFX (PCR800 , 2 x THGR810 ), 1-wire( 2 x DS1820 3 x DS2423 , 1 x DS2408, DS9490-usb )

Hi All,

All devices and system worked very well before update to 3.8153 .

since update to 3.8153, all DS2423 devices reading are wrong in domoticz.
Today I made the update to 3.873, no progress. Exactly the same problems.

Description:

It seem there is a reading problem with this number :
Device : 12C7 with SSH reading = 4469177 but in domoticz = 429467295 ???
Device : 2A6E with SSH reading = 27000004 but in domoticz = 429467295 ???
Device : 1C6C with SSH reading = 3205423 but in domoticz = 3205424128 ???

Strange, I find nothing that could explain this trouble.

Find below the screen shot .

Hope somebody could help me to understand and solve this issue.
Many thanks in advance.


DS2423_reading_trouble.gif
DS2423_reading_trouble.gif (105.92 KiB) Viewed 274 times

JMdomotique
Posts: 8
Joined: Sunday 09 April 2017 21:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by JMdomotique » Monday 04 September 2017 23:03

Hi guys,

nobody is using DS2423 dual counters ?

please help me

toast
Posts: 5
Joined: Wednesday 16 November 2016 13:51
Target OS: Linux
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by toast » Tuesday 05 September 2017 22:15

This is how it's been for me for a long time if your issue is the same.
In the source code the counter is multiplied with 1000. I always remove this when I compile to get the correct counter. I think your first values är what you get when the value is to large for the calculation. That's why they are the same.
I don't know what the intention is to multiply with 1000.
Perhaps something to do with power meter and kWh...

JMdomotique
Posts: 8
Joined: Sunday 09 April 2017 21:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by JMdomotique » Thursday 07 September 2017 0:33

Hi toast,

many thanks for your answer.
I think you right this multiplication with 1000 will bring the value to large.

Could you explain me please how you proceed to remove this multiplication .
And also where I can find the source code and how you proceed for the compilation.

I never do that task, but I open for learning.

Thanks in advance for your support

toast
Posts: 5
Joined: Wednesday 16 November 2016 13:51
Target OS: Linux
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by toast » Thursday 07 September 2017 8:05

Hi
You probably find guides on the wiki how to download the git repository and compile from sources.

I make this change for the counter
In the file: hardware/DomoticzHardware.cpp

unsigned long counter = (unsigned long)(metervalue*1000.0f);

To

hardware/DomoticzHardware.cpp
unsigned long counter = (unsigned long)(metervalue*1.0f);

JMdomotique
Posts: 8
Joined: Sunday 09 April 2017 21:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by JMdomotique » Sunday 10 September 2017 12:15

Hi toast,

many, many thanks for your help.

After some hours I found the guides to download and compile the sources directly in the raspberry pi.

I have now follow your instructions and upgrade the installation to version v3.8390.
This version use dark-th3me Theme after compilation.

You are absolutely right. The trouble is coming from this "metervalue*1000" .

Compilation is a very long process but the result is amazing. Since months I tried to find a way to resolve this trouble.

Find below screen shots of the result after the modification. On one counter you can see a small different.
(This is coming from the small delay between the both screen shots.)

@ all,
is there really no way to correct this wrong calculation with big number ???
What is the advantage with the multiplication of the metervalue by 1000 ????

Anyway thanks again very much this method help me to follow from now my electricity energy.



DS2423_reading_tnow_correct.gif
DS2423_reading_tnow_correct.gif (44.69 KiB) Viewed 172 times

User avatar
gizmocuz
Posts: 8491
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: 1 wire counter DS2423 wrong data

Post by gizmocuz » Sunday 10 September 2017 12:21

Okey, you should not edit DomoticzHardware.cpp as this is used by many hardware classes (classes without this error)
So this error/problem must be inside the 1wire class, and this class needs to be patched.
But please discuss it with the creator of this class before submitting a pull request with the needed changes
Quality outlives Quantity!

JMdomotique
Posts: 8
Joined: Sunday 09 April 2017 21:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by JMdomotique » Thursday 14 September 2017 8:29

Hi gizmocuz ,

understood tank's.

could you made me in connection with the creator of the one wire class and/or indicate where the concerned class is located ?

toast
Posts: 5
Joined: Wednesday 16 November 2016 13:51
Target OS: Linux
Domoticz version:
Contact:

Re: 1 wire counter DS2423 wrong data

Post by toast » Saturday 16 September 2017 0:29

Hi,
Ok, I was digging a bit mode at the code for this. I cant really write/read code... so excuse me if it looks stupid...
In hardware/1Wire.cpp

Code: Select all

SendMeterSensor(deviceIdByteArray[0], deviceIdByteArray[1]+unit, 255, (const float)count
er, "Counter");
changed to

Code: Select all

SendMeterSensor(deviceIdByteArray[0], deviceIdByteArray[1]+unit, 255, (const float)count
er/1000, "Counter");
Actually, now when I checked "SendMeterSensor" I can see that others also use /1000 in the code... Don't know why...


Regards,
Patrik

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests