Giter VIP home page Giter VIP logo

Comments (9)

stefanbode avatar stefanbode commented on July 20, 2024 1

Hi, yes stefan_bode at web de. Please see the newest version. introduced a new command counterdevider

from sonoff-tasmota.

stefanbode avatar stefanbode commented on July 20, 2024

In general no big deal to store the counter in RTC memory and maybe also in Flash. But we have to take into consideration how many pulses we expect in which timeframe. Additionally, it is interesting how you want to react on a reboot (accidentally or intended). Is there a requirement to remember the last state. What about power off? is it ok if we remember on 400 pulses and it was 415 when it was shut down on power?
Questions to anser:
1.) How many pulses in which timeframe you expect?
2.) Need the pulsescount survive a reboot? (Using RTC memory)
2.) Need the pulsecount survive power off (Using Flash)

from sonoff-tasmota.

stefanbode avatar stefanbode commented on July 20, 2024

I do see, that the behaviour is somewhere already in the code. Normally the count will only be reported by the TELEPERIOD (afaik). This will not give you exactly the state when 1L is reached, but you will get an update on the flow, for example, every 10sek.

from sonoff-tasmota.

roblad avatar roblad commented on July 20, 2024

Hi,

  1. Pulses not in timeframe - it could be 10, 100 in the same period of time - it is flow and when tap is open fully or many taps are opened the flow will be different.
  2. Currently I have AVR controller where I save value for every 100 L to EPROM. When there is power cut the latest value from EEPROM is taken - correction I send to the AFR through RMF69 and I receive through RMF69. The attache interput have 2 counters 1 is for getting 4100 for each 10 L of water and one is for counting each pulse.
  3. I need to keep some last value in eeprom i.e. or RTC memory, but main is a possibility to multiply counter for i.e. 410 pulses for 1 L and result it on MQTT or/and www. The best is to set somewhere the multiplayer in some variable.

PS.
Could you give me your e-mail ?

from sonoff-tasmota.

roblad avatar roblad commented on July 20, 2024

Hi,
It was tested and:

BTW - Is it possible to define COUNTERDEVIDER i user_config.h ?

I sugest to add/change to :
sonoff\xsns_01_counter.ino
line 25
uint32_t pulse_devider = COUNTERDEVIDER;
in user_config.h
line 161
#define COUNTERDEVIDER 10 // counter divider or set CounterDevider 1-4

RESULT without changes:

It does not count correctly when I set on type counterType as pulse debaunce for 100 ms

it count as it wants, usualy count each pulse or shows more of 10 20 50.

there was not send to consloe

The "CounterDevider1" was not set from console

After setting CounterDevider1 to 10 starts work.

What do you think about that suggestion:

// STB mode
//avoid DIV 0 on unitiialized
Settings.pulse_devider[i] = COUNTERDEVIDER;
if (Settings.pulse_devider[i] == 0 || Settings.pulse_devider[i] == 65535 ) {Settings.pulse_devider[i] = 1;}
// end

it seams to work when I sen in configure COUNTERDEVIDER to 10 (or set fromconsole - without any modyfication of code after setting CounterDevider1 to 10 ), every 10 pulse it gives 1.

Additionaly when on web there is some devider , I sugest add that information to WWW and to MQTT if you can.

And Counter result send every change as tele message or in some other possibility

tele/wemeos/SENSOR = {"Czas":"2017-12-04T21:17:24","Przelacznik1":"OFF","Licznik1":23,"Wej_analogowe0":3}

That is nice to have receive any pulse change to be just send to MQTT :-) the same for i.e. analog read status :-) by execute some command as:

21:24:50 CMD: Status 10
21:24:50 MQT: stat/wemeos/STATUS10 = {"StatusSNS":{"Czas":"2017-12-04T21:24:50","Przelacznik1":"OFF","Licznik1":31,"Wej_analogowe0":3}}

PS

I sent you e-mail with subject:

Tasmota roblad contact github

from sonoff-tasmota.

stefanbode avatar stefanbode commented on July 20, 2024

it should be
#define D_CMND_COUNTERDEVIDER "CounterDevider"
there is a command, not text to translate, it has CounterDevider1 or CounterDevider2 or CounterDevider3 or CounterDevider4 depends on max_counters
I suggested to change it - but I updated the response to #15

yep, there is a reason that command normally should stay in English. Changed back and will be updated with the next sync.

from sonoff-tasmota.

roblad avatar roblad commented on July 20, 2024

Hi,

Could you try to add other things, and I sent you a mail, could you answer ?

Thanks,
RL

from sonoff-tasmota.

stefanbode avatar stefanbode commented on July 20, 2024

I saw just one mail from you where you said: hello from monday. no requests

from sonoff-tasmota.

roblad avatar roblad commented on July 20, 2024

Hi,

I have not received , could yoy try again ?

from sonoff-tasmota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.