[OBIS V2] - Jetzt auch mit SML-Unterstützung

Begonnen von Icinger, 08 April 2016, 19:54:44

Vorheriges Thema - Nächstes Thema

osid-timo

Hallo Icinger,
tolle Leistung, bei mir kommen jetzt auch die für mich wichtigen Daten im Log an:
2016.05.16 11:26:44 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.0*255(4571810.4947*Wh)
2016.05.16 11:26:44 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-2:2.8.0*255(4265801.645*Wh)

wie ist die vorgesehen Methode um diese Werte in die Readings aufzunehmen?

Gruß Osid-timo
FHEM Pi3: 1* CUL, 30* Homematic, 10* EnOcean
FHEM Pi3: IR-Lesekopf, BT->SMA
FHEM Pi3: ZHK, 1-wire, 1* VBus   Resol DeltaSol BS

HarryT

Hi

Thanks for your work.

With  the current 47_OBIS module I get:
  Constant subroutine main::URL redefined at /var/InternerSpeicher/fhem/lib/perl5/5.12.2/constant.pm line 130, <$fh> line 442.
  Possible unintended interpolation of @115200 in string at ./FHEM/00_SmartMeterP1.pm line 84, <$fh> line 505.
  2016.05.16 11:02:53 3: Opening SmartMeterP1 device /dev/ttyUSB1
  2016.05.16 11:02:53 3: Setting SmartMeterP1 serial parameters to 115200,8,N,1
  2016.05.16 11:02:53 3: SmartMeterP1 device opened
  2016.05.16 11:02:53 3: SmartMeterP1:Updating attribute 'removeLeadingZero' to 'true'
  2016.05.16 11:02:53 3: SmartMeterP1:Updating attribute 'removeUnitSeparator' to 'true'
  2016.05.16 11:02:53 3: SmartMeterP1:Updating attribute 'room' to 'Sturing'
  main::OBIS_decodeTL() called too early to check prototype at ./FHEM/47_OBIS.pm line 590, <$fh> line 517.
  Use of uninitialized value in concatenation (.) or string at ./FHEM/47_OBIS.pm line 127, <$fh> line 517.
  Use of uninitialized value in concatenation (.) or string at ./FHEM/47_OBIS.pm line 127, <$fh> line 517.
  2016.05.16 11:02:53 3: Opening MyObis device /dev/ttyUSB2
  2016.05.16 11:02:53 3: Can't open /dev/ttyUSB2: No such file or directory

A bit ugly as I use SmartmeterP1 and OBIS. But:
  Use of uninitialized value in concatenation (.) or string at ./FHEM/47_OBIS.pm line 127, <$fh> line 517. 
is persistent.

Now I get:
(https://postimg.org/image/h02u8y80h/)

and can compare that with:
(https://postimg.org/image/b7go7ud5d/)

So I miss the
  Gas readings and its timestamp
  TarifIndicatorElectricity


I don´t know what
  current_L1
  Unknown_Channel_22
is.

Is it possible to change the namings?
I think it would be more consistent if "power" was renamend to "consumption" as it is used for "total-consumption".


{HT}

FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

HarryT

Hi

I guess this is interesting info.

Thanks to/copied from:   # $Id: 00_SmartMeterP1 michelverbraak $
(The module was posted on this forum but has no clear copyright message.  I guess it is ok to use it, at least read it.)

  if ($obis_ref eq "0-0:1.0.0") {
   #Date-time stamp of the P1 message
   # YYMMDDhhmmssW
[...]
  elsif ($obis_ref eq "1-0:1.8.1") {
   # Meter reading electricity delivered to client low Tariff in 0,001 kWh
[...]
  elsif ($obis_ref eq "1-0:1.8.2") {
   # Meter reading electricity delivered to client normal Tariff in 0,001 kWh
[...]
  elsif ($obis_ref eq "1-0:2.8.1") {
   # Meter reading electricity delivered by client low Tariff in 0,001 kWh
[...]
  elsif ($obis_ref eq "1-0:2.8.2") {
   # Meter reading electricity delivered by client normal Tariff in 0,001 kWh
[...]
  elsif ($obis_ref eq "1-0:1.7.0") {
   # Actual electricity power delivered (+P) in 1 Watt resolution
[...]
  elsif ($obis_ref eq "1-0:2.7.0") {
   # Actual electricity power received (-P) in 1 Watt resolution
[...]
  elsif ($obis_ref eq "0-0:17.0.0") {
   # The actual threshold Electricity in kW
[...]
  elsif ($obis_ref eq "0-0:96.14.0") {
   # Tariff indicator electricity.
[...]
  elsif ($obis_ref eq "0-0:96.3.10") {
   # Switch position electricity
[...]
  elsif ($obis_ref eq "0-1:24.2.1") {
   # Last hourly value gas delivered to client in m3
[...]      
  elsif ($obis_ref eq "0-1:24.3.0") {
   $hash->{Telegram}->{Gas}->{used} = 1;
[...]
  elsif ($obis_ref eq "") {
   if (($hash->{Telegram}->{Gas}->{used} == 1) && ($hash->{Telegram}->{Gas}->{obis_ref} eq "0-1:24.2.1" )) {
      # Last hourly value gas delivered to client in m3
[...]
  elsif ($obis_ref eq "0-1:24.4.0") {
   # Valve position Gas

{HT}
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Icinger

@osid-timo:
Zitatbei mir kommen jetzt auch die für mich wichtigen Daten im Log an:
Code: [Auswählen]

2016.05.16 11:26:44 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.0*255(4571810.4947*Wh)
2016.05.16 11:26:44 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-2:2.8.0*255(4265801.645*Wh)

wie ist die vorgesehen Methode um diese Werte in die Readings aufzunehmen?
Diese beiden Datensätze sollten eigentlich auch als Reding angelegt werden.
Die RegEx greift bei denen.
Wenn dem nicht so ist, bräuchte ich bitte einen etwas längeren Daten-Auszug aus dem Log.

@HarryT:
Zitat2016.05.16 11:02:53 3: Can't open /dev/ttyUSB2: No such file or directory
So, how should that work then, if there's no USB2-Device?

ZitatSo I miss the
  Gas readings and its timestamp
  TarifIndicatorElectricity
As is stated yesterday, Gas isn't yet implemented.
But i sent you a private Message yesterday, with a version of OBIS, that also takes care of the Gas-Reading for testing.

ZitatIs it possible to change the namings?
-->see attribute "Channels"

Zitat
I think it would be more consistent if "power" was renamend to "consumption" as it is used for "total-consumption".
Obis has dedicated readings for total consumption and total feed.
But for the "power"-Readings: They can contain a minus-sign for feeding and a plus (or no sign) for consuming. But you can also rename them to something else by setting the Channel-Attribute.

hth, Stefan
Verwende deine Zeit nicht mit Erklärungen. Die Menschen hören (lesen) nur, was sie hören (lesen) wollen. (c) Paulo Coelho

HarryT

Zitat von: Icinger am 16 Mai 2016, 12:42:59
@HarryT:So, how should that work then, if there's no USB2-Device?
:-) I toggle USB2 and USB1 to switch between SmartmeterP1 and OBIS.
Zitat
As is stated yesterday, Gas isn't yet implemented.
But i sent you a private Message yesterday, with a version of OBIS, that also takes care of the Gas-Reading for testing.
Mea culpa, I didn't see the message. But I just tested it and it works.

However it works a bit different for Gas. The BK-G4 ETB gasmeter send its status to the  Landis E350 every hour. And the Landis E350 sends them  to FHEM every 10 seconds. So its timestamp is different from the Electricity timestamp. It would be nice if the Gas timestamp is also a reading.

Zitat

-->see attribute "Channels"
Obis has dedicated readings for total consumption and total feed.
But for the "power"-Readings: They can contain a minus-sign for feeding and a plus (or no sign) for consuming. But you can also rename them to something else by setting the Channel-Attribute.

hth, Stefan

I will play around with that.

Thanks
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Icinger

ZitatHowever it works a bit different for Gas. The BK-G4 ETB gasmeter send its status to the  Landis E350 every hour. And the Landis E350 sends them  to FHEM every 10 seconds. So its timestamp is different from the Electricity timestamp. It would be nice if the Gas timestamp is also a reading.
Hmm, thats something special, not realy OBIS-like :/

How about an event-on-change on the Gas-Reading? So you should always have a nearly corretc timestamp for the Gas-reading.
Verwende deine Zeit nicht mit Erklärungen. Die Menschen hören (lesen) nur, was sie hören (lesen) wollen. (c) Paulo Coelho

HarryT

Zitat von: Icinger am 16 Mai 2016, 13:17:05
Hmm, thats something special, not realy OBIS-like :/
Zitat
:-)  these are 2 devices. Common in the Netherlands.

The actual timestamp is the number just for the measurement.
In this case:
2016.05.15 18:10:03 5: OBIS (MyObis) - Msg-Parse: 0-1:24.2.1(160515180000S)(00041.661*m3)

160515180000S is the timestamp of the gas measurement.

Zitat
How about an event-on-change on the Gas-Reading? So you should always have a nearly corretc timestamp for the Gas-reading.

Better. I guess on the other measurement too. This will avoid the logging of growing very rapid.

In the logging I only see the Gas and the totals. Not the current measurement. The current measurements are very usefull for plotting. Is it possible to include them?

Regards
{HT}
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Icinger

Thats why i said yesterday, i dunno knbow what these Datas are:
1-3:0.2.8(42)
0-0:96.1.1(4530303331303033313438313939363135) -> E0031003148199615 (Serial??)
0-0:96.14.0(0001)
0-0:96.7.21(00001)
1-0:99.97.0(0)(0-0:96.7.19)
1-0:32.32.0(00000)
1-0:32.36.0(00000)
0-0:96.13.1()
0-0:96.13.0()
0-1:24.1.0(003)
0-1:96.1.0(4730303235303033333630333031323136) -> G0025003360301216 (Serial??)

If you tell me, what's what, i could include them 8)
Verwende deine Zeit nicht mit Erklärungen. Die Menschen hören (lesen) nur, was sie hören (lesen) wollen. (c) Paulo Coelho

HarryT

I have only this list:

"0-0:1.0.0" Date-time stamp of the P1 message  # YYMMDDhhmmssW
"1-0:1.8.1" Meter reading electricity delivered to client low Tariff in 0,001 kWh
"1-0:1.8.2" Meter reading electricity delivered to client normal Tariff in 0,001 kWh
"1-0:2.8.1" Meter reading electricity delivered by client low Tariff in 0,001 kWh
"1-0:2.8.2" Meter reading electricity delivered by client normal Tariff in 0,001 kWh
"1-0:1.7.0" Actual electricity power delivered (+P) in 1 Watt resolution
"1-0:2.7.0" Actual electricity power received (-P) in 1 Watt resolution
"0-0:17.0.0" The actual threshold Electricity in kW
"0-0:96.14.0" Tariff indicator electricity.
"0-0:96.3.10" Switch position electricity
"0-1:24.2.1"  Last hourly value gas delivered to client in m3
"0-1:24.3.0" ??
"0-1:24.4.0" Valve position Gas

So from the list of unknown readings in my logs, just
"0-0:96.14.0" Tariff indicator electricity.
can be added yet.

May be I can see some gas usage tonight and find out  if "0-1:24.2.1"  Last hourly value gas delivered to client in m3 is reported.

BTW you saw the part in my message about the missing current values in the log?

{HT}
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

osid-timo

Hallo Icinger,
wie gesagt mir geht es noch um die Werte:
1.8.0
2.8.0
im Reading

ein vollständiger Datensatz sieht wie folgt aus:
2016.05.16 15:51:02 5: SW:
2016.05.16 15:51:02 5: OBIS (EasymeterQ3C) - Internal timer set to 2016-05-16 15:51:12
2016.05.16 15:51:03 5: OBIS: Full message-> 1B1B1B1B010101017605CA4F081A62006200726500000101760101074553595133430B0645535901071B92BDC301016312EB007605CA4F081B6200620072650000070177010B0645535901071B92BDC3017262016504ABF884F10077078181C78203FF01010101044553590177070101010800FF6341B07262016504ABF884621E52FC690000000AA58A48500177070102020800FF6341B07262016504ABF884621E52FC6900000009EF882B5D0177070101010801FF6341B07262016504ABF884621E5201650006F7F60177070101010802FF6341B07262016504ABF884621E520165000000700177070101010803FF6341B07262016504ABF884621E520165000000710177070101010804FF6341B07262016504ABF884621E520165000000710177070101010805FF6341B07262016504ABF884621E520165000000710177070101010806FF6341B07262016504ABF884621E5201650000007C0177070102020807FF6341B07262016504ABF884621E5201650006827D0177070102020808FF6341B07262016504ABF884621E520165000000700177070100010700FF0101621B52FE55FFFF3D240177070100150700FF0101621B52FE550000472F0177070100290700FF0101621B52FE55000002E801770701003D0700FF0101621B52FE55FFFEF30D0177070100600505FF010101016341B001010163A83D007605CA4F081C62006200726500000201710163FF7C0000001B1B1B1B1A021E05
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: /ESY
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 129-129:199.130.3*255(ESY)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.0*255(4572697.608*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-2:2.8.0*255(4267338.4285*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.1*255(4566940*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.2*255(1120*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.3*255(1130*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.4*255(1130*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.5*255(1130*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-1:1.8.6*255(1240*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-2:2.8.7*255(4266210*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-2:2.8.8*255(1120*Wh)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-0:1.7.0*255(-498.84*W-498.84*W)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-0:21.7.0*255(182.23*W182.23*W)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-0:41.7.0*255(7.44*W7.44*W)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-0:61.7.0*255(-688.51*W-688.51*W)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: 1-0:96.5.5*255(16816)
2016.05.16 15:51:03 5: OBIS (EasymeterQ3C) - Msg-Parse: !


als Channels habe ich folgende Definition:
channels   {"21"=>"energy_L1","41"=>"energy_L2","61"=>"energy_L3","1"=>"energy_current","18"=>"energy_total","28"=>"feed_total"}

es wäre toll wenn auch das noch klappen könnte

Gruß Oswald
FHEM Pi3: 1* CUL, 30* Homematic, 10* EnOcean
FHEM Pi3: IR-Lesekopf, BT->SMA
FHEM Pi3: ZHK, 1-wire, 1* VBus   Resol DeltaSol BS

Icinger

Hi,

ich lad gleich mal wieder eine neue Version hoch.

Habe einige gravierende Umgestaltungen heute gemacht. Wobei die bisherige Funktionalität aber weiterhin gegeben sein sollte.
Ab sofort werden unbekannte Readings mit dem gesamten OBIS-Code gesetzt, also zB:
     2016-05-16 19:39:07   0-0:96.1.1      4530303331303033313438313939363135
     2016-05-16 19:39:07   0-0:96.14.0     0001
     2016-05-16 19:39:07   0-0:96.7.21     1
     2016-05-16 19:38:27   0-0:96.7.9      0
     2016-05-16 19:39:07   0-1:24.1.0      003
     2016-05-16 19:39:07   0-1:96.1.0      4730303235303033333630333031323136
     2016-05-16 19:39:07   1-0:22.7.0      0.259
     2016-05-16 19:39:07   1-0:32.32.0     00000
     2016-05-16 19:39:07   1-0:32.36.0     00000
     2016-05-16 19:39:07   1-0:99.97.0     0-0:96.7.19
     2016-05-16 19:39:07   1-3:0.2.8       42
     2016-05-16 19:39:07   Gas             41.661
     2016-05-16 19:39:07   Powerdrops      00000
     2016-05-16 19:39:07   Time_current    01-01-1970 01:00:01
     2016-05-16 19:38:27   Version         XMX5LGBBFG1009198749
     2016-05-16 19:39:07   current_L1      1
     2016-05-16 19:39:07   feed_L1         0.259
     2016-05-16 19:39:07   power           0
     2016-05-16 19:39:07   power_L1        0
     2016-05-16 19:39:07   total_consumption_Ch1 73.217
     2016-05-16 19:39:07   total_consumption_Ch2 26.572
     2016-05-16 19:39:07   total_feed_Ch1  91.209
     2016-05-16 19:39:07   total_feed_Ch2  154.517


Sofern bekannt ist, was diese Readings beinhalten, können sie mit dem channels-Attribut umbenannt werden.
zum obigen Beispiel:
attr <myDevice> channels {"1-0:22.7.0"=>"TestReading"}
Bei meinen bisherigen Tests mit euren Daten sind mir bislang keine Ungereimtheiten aufgefallen, ich hoffe, das bleibt auch so ^^

Frage an alle: Wollt ihr ein Attribut, mit dem man ungenutzte, unbekannte Readings auf "stumm" setzen kann? Oder ist das egal und ihr ignoriert diese Readings dann einfach?

lg, Stefan
Verwende deine Zeit nicht mit Erklärungen. Die Menschen hören (lesen) nur, was sie hören (lesen) wollen. (c) Paulo Coelho

HarryT

Can I download the version for a  test already?

If so, where?

{HT}

FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Icinger

Verwende deine Zeit nicht mit Erklärungen. Die Menschen hören (lesen) nur, was sie hören (lesen) wollen. (c) Paulo Coelho

HarryT

Nice.

A few problems, Time_current is not correct and not changed.

I used
  attr SmartMeter event-on-change-reading Gas,total_consumption_Ch1,total_consumption_Ch2,total_feed_Ch1,total_feed_Ch2,Powerdrops,consumption,feed_L1,TariffIndicator
  attr SmartMeter channels {"21"=>"consumption", "1"=>"power1", "15"=>"power16", "16"=>"power16", "0-0:96.14.0"=>"TariffIndicator", "Gas"=>"total_gas"}

"0-0:96.14.0"=>"TariffIndicator", "Gas"=>"total_gas"  doesn't do anything. Is my syntax wrong?

(https://postimg.org/image/b4o3v2rpt/)
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

HarryT

Hi

In the log I get:
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 0-0:96.1.1 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 0-0:96.14.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 0-0:96.7.21 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 0-1:24.1.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 0-1:96.1.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 1-0:22.7.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 1-0:32.32.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 1-0:32.36.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 1-0:99.97.0 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.
2016.05.16 22:36:33 3: WARNING: unsupported character in reading 1-3:0.2.8 (not A-Za-z/\d_\.-), notify the OBIS module maintainer.

{HT}
FHEM 6.2 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.