Publishing Environment - 1-Wire Temperature Statistics

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
antro31
New user
Posts: 7
Joined: 31 May 2020, 23:17

Publishing Environment - 1-Wire Temperature Statistics

#1 Post by antro31 » 29 Apr 2024, 19:59

Hi all,

First a big thanks for your software that helps me a lot in home automation.
A question I have, in ESPEasy, there is a possibility to have statistics regarding the use of DS18b20 sensors. Things such as Samples Read Success, Samples Read Retry.
Is there any way to publish these data over MQTT? (I would like to have them as attributes of my sensors).
Thanks a lot.

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#2 Post by Ath » 29 Apr 2024, 20:15

This data is currently not available, other than via the web UI. It can however be made available, after a little coding effort ;)
I'll see if that can be added without adding too much code, as this plugin is included in many builds, and some are really cramped for binary size issues :shock:
/Ton (PayPal.me)

antro31
New user
Posts: 7
Joined: 31 May 2020, 23:17

Re: Publishing Environment - 1-Wire Temperature Statistics

#3 Post by antro31 » 29 Apr 2024, 20:37

That would be awesome, thanks.
Even if available only through rules, it would be fine.

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#4 Post by Ath » 29 Apr 2024, 21:03

antro31 wrote: 29 Apr 2024, 20:37 Even if available only through rules, it would be fine.
That's what I was thinking of, as it's the easiest, and probably most compact, way of adding it.
/Ton (PayPal.me)

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#5 Post by Ath » 11 May 2024, 21:01

@antro31 I've added added PR #5051 to the ESPEasy repository to add this functionality. The binaries will be available from this GH Actions run.

Can you test and report your findings here?
/Ton (PayPal.me)

antro31
New user
Posts: 7
Joined: 31 May 2020, 23:17

Re: Publishing Environment - 1-Wire Temperature Statistics

#6 Post by antro31 » 13 May 2024, 22:42

Hello, I have tried something like:

Code: Select all

Publish esppool/read,[Pool#sensorstats,1,success]
In the command line, but does not seem to work.
Pool is the name of the task where I have connected my temperature sensor.
I am using build ESP_Easy_mega_20240511_normal_ESP8266_4M1M May 11 2024

What am I doing wrong?
Last edited by antro31 on 13 May 2024, 23:02, edited 1 time in total.

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#7 Post by TD-er » 13 May 2024, 23:01

since a comma (,) is an argument separator, you may need to add quotes to the 2nd arument

Code: Select all

Publish esppool/read,"[Pool#sensorstats,1,success]"
No idea if the rest is OK as this doesn't look like ESPEasy syntax.
Do you try to access these kind of stats? https://espeasy.readthedocs.io/en/lates ... statistics

Edit:
Ah nope, saw what Ton did: https://github.com/letscontrolit/ESPEasy/pull/5051
A bit strange to use a comma here, as we don't do that anywhere else. Why not a dot, Ton?

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#8 Post by Ath » 14 May 2024, 08:29

TD-er wrote: 13 May 2024, 23:01 Ah nope, saw what Ton did: https://github.com/letscontrolit/ESPEasy/pull/5051
A bit strange to use a comma here, as we don't do that anywhere else. Why not a dot, Ton?
Well, I did that also in other plugins, like P011 and P087, and in AdafruitGFX_Helper (for all supported Display plugins P095, P096, P116, P131, P141), and it works as intended.
But it might have been helpful/useful if that also used the dot as a separator, so maybe I'd switch to the dot and make the other implementations backward compatible.

@antro31
If you just type as a command [Pool#sensorstats,1,success] what do you get, a 0 or an empty value? And what if you replace 'success' with 'address' ?
/Ton (PayPal.me)

antro31
New user
Posts: 7
Joined: 31 May 2020, 23:17

Re: Publishing Environment - 1-Wire Temperature Statistics

#9 Post by antro31 » 14 May 2024, 08:46

Hi Ton,

Actually, it does nothing (neither with 'success', nor with 'address')
I tried [Pool#Temperature] and it gives me the right temperature.

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#10 Post by Ath » 14 May 2024, 09:03

Hm, I now see where I made a typo (actually, a copy/paste error) :oops:
Will be able to fix that later today, not near my ESPEasy development system ATM.
/Ton (PayPal.me)

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#11 Post by Ath » 14 May 2024, 12:46

I was able to fix it sooner than expected, so a GH Actions run is on its way.
Please update and retest.
/Ton (PayPal.me)

antro31
New user
Posts: 7
Joined: 31 May 2020, 23:17

Re: Publishing Environment - 1-Wire Temperature Statistics

#12 Post by antro31 » 14 May 2024, 15:06

Well done ! Seems to work OK.

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

Re: Publishing Environment - 1-Wire Temperature Statistics

#13 Post by Ath » 14 May 2024, 15:08

Great, thanks for the feedback :D
/Ton (PayPal.me)

Post Reply

Who is online

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