attr AC pinX falling pullup min 25
rising
or falling
, followed by an optional pullup
and the optional keyword min
and an optional number as minimal length of pulses and gaps between pulses.
+
attr MyCounter pinD4 falling pullup 25
-
+
For analog inputs with connected reflective light barries, you have to add analog out
and the GPIO pin number of the pin where the light source (LED or laser) is connected, the keyword threshold
followed by the lower and upper threshold separated by a komma.
+
attr MyCounter pinA0 rising pullup min 3 analog out 27 threshold 120,220
-
-
-
+
attr myCounter interval 60 600 5 2
-
+ attr myCounter board NANO ++
+
attr myCounter pulsesPerUnit 75
-
-
+
attr myCounter readingPulsesPerUnitA7 75
attr myCounter readingPulsesPerUnitD4 1000
-
+
-
+
attr myCounter readingNameCountD4 CounterHaus_internal
-
-
+
attr myCounter readingNameLongCountD4 CounterHaus_long
-
+
-
+
attr myCounter readingNameInterpolatedCountD4 CounterHaus_interpolated
-
+
-
+
attr myCounter readingNameCalcCountD4 CounterHaus_kWh
-
+
-
+
attr myCounter readingNamePowerD4 PowerHaus_kW
-
+
-
+
attr myCounter verboseReadingsD4 1
-
+
- get history
The optput of get history
will look like this:
-
+
Seq 12627 2020-03-22 20:39:54 Pin D5 0.080 seconds at 0 -> pulse counted
Seq 12628 2020-03-22 20:39:55 Pin D5 1.697 seconds at 1 -> gap
Seq 12629 2020-03-22 20:39:56 Pin D5 0.080 seconds at 0 -> pulse counted
@@ -2720,31 +2799,38 @@ sub ArduCounter_ReadAnswer($$)
Seq 12642 2020-03-22 20:40:05 Pin D5 1.699 seconds at 1 -> gap
Seq 12643 2020-03-22 20:40:07 Pin D5 0.080 seconds at 0 -> pulse counted
Seq 12644 2020-03-22 20:40:07 Pin D5 1.698 seconds at 1 -> gap
-
+
-
+
attr myCounter flashCommand avrdude -p atmega328P -c arduino -b 57600 -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]
-
+
[PORT]
is automatically replaced with the serial port for this device as it is specified in the define
command.[HEXFILE]
or [BINFILE]
are synonyms and are both automatically replaced with the firmware file appropriate for the device.
For ESP32 boards [HEXFILE]
would be replaced by ArduCounter-8266.bin for example.[NETPORT]
is automatically replaced by the tcp port number used for OTA flashing.
For ESP32 this usually is 3232 and for 8266 Bords it is 8266.
+
attr myCounter keepAliveDelay 30
-
+
-
+
attr myCounter keepAliveTimeout 3
-
-
+
attr myCounter keepAliveRetries 3
-
-
+
attr myCounter nextOpenDelay 20
-
-
-
+
attr myCounter openTimeout 5
-
-
-
+
attr myCounter silentReconnect 1
-
-
-
+
attr myCounter deviceDisplay 36,l,l/m
attr myCounter deviceDisplay 36,kWh,kW
-
-
- enableHistory, enableSerialEcho, enablePinDebug, enableAnalogDebug, enableDevTime
-
+