enocean-js / node-enocean

an enocean implementation for node.js
GNU General Public License v2.0
29 stars 14 forks source link

Add D2-01-09 and D2-01-12 #32

Open dominikkv opened 7 years ago

dominikkv commented 7 years ago

Hi,

first of all I want to thank you for this amazing library. I haven't tested yet, but it looks great!

I have two smart switches: one two-channel switch and one switch with energy meater:

They send their state with two EEPs D2-01-09 and D2-01-12.

Is it possible to integrate those EEPs? They are VLD telegrams and I'm not sure if the library can handle this...

Thanks Dominik

Holger-Will commented 7 years ago

VLDs in general as well as universal teach in (UTE) are supported. some VLDs are implemented. However d2-01-xx is a complicated specification on its own. I'll see what i can do. I might have to get a these module you use myself so i can test them though... it might take some time.. I could also help you write a custom resolver for the special cases you need.

Jey-Cee commented 7 years ago

I have also the permundo smart mini plug PSC132 with the EEP D2-01-09. I'm totally new to the enOcean world and the EEP thing, so i could not create an EEP resolver at my own.

If the plug sends its state an error occurs: `TypeError: Cannot read property 'condition' of undefined

at C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\modules\genericResolver.js:14:12 at Array.forEach () at decode (C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\modules\genericResolver.js:13:12) at SerialPortListener.getData2 (C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\index.js:197:14) at SerialPortListener. (C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\modules\memory.js:56:21) at emitOne (events.js:115:13) at SerialPortListener.emit (events.js:210:7) at C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\index.js:108:12 at Array.forEach () at SerialPortListener. (C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\index.js:107:17)`

Holger-Will commented 7 years ago

oh, sorry. that is the new generic resolver, which does not handle VLDs yet. it should be wrapped in try catch. will fix this later today...

Jey-Cee commented 7 years ago

Thank you for your answer.

Holger-Will commented 7 years ago

ok first step taken. it should not crash on VLDs anymore. I can not test though. would be nice if you could confirm that it's not crashing anymore... still waiting for my nodon module :-(

Jey-Cee commented 7 years ago

No there is a message that it is not supported and then a new error.

2017-10-03 11:08:59.710 - not supported debug: enocean.0 Recived data that are known: {"timestamp":1507021739694,"rawByte":"550009070156d20460e40194b1310001ffffffff310048","packetType":1,"senderId":"0194b131","choice":"d2","subTelNum":1,"destinationId":"ffffffff","rssi":49,"securityLevel":0,"raw":"0460e40194b1310001","learnBit":1,"packetTypeString":"VLD","sensor":{"id":"0194b131","eep":"d2-01-09","title":"New undefined","desc":"I'm a new sensor..."},"values":[{"type":"unknown","unit":"unknown","value":"unknown"}]} TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at SerialPortListener.eo.on (C:\iobroker\node_modules\ioBroker.enocean\main.js:303:12) at emitOne (events.js:115:13) at SerialPortListener.emit (events.js:210:7) at C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\modules\memory.js:67:14 at Array.forEach (<anonymous>) at SerialPortListener.<anonymous> (C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\modules\memory.js:66:18) at emitOne (events.js:115:13) at SerialPortListener.emit (events.js:210:7) at C:\iobroker\node_modules\ioBroker.enocean\node_modules\node-enocean\index.js:110:12

Holger-Will commented 6 years ago

i got my nodon module now. Work has started to support VLDs propperly.

Holger-Will commented 6 years ago

new version 3.3.0 has very basic support for d2-01-xx. recieving should work now. had to fix the spec a bit... there are no datafield conditions specified in d2-01-00 although datafield conditions are used... encoding still needs some work, as does the documentation...

Holger-Will commented 6 years ago

mmh... the nodon module claims to be eep d2-01-12 but also send f6-02-01 telegrams. i don't know how to handle this case... any input very welcome...

Jey-Cee commented 6 years ago

Hi Holger, heute mal auf Deutsch. Seh ich das richtig das es um dieses Modul geht: http://nodon.fr/en/enocean/enocean-in-wall-module_13-1 Hast du dafür schon eine Lösung? Ich würde das Gerät einfach anhand der ID und der eep als d2-01-12 erkennen und falls relevant die f6-02-01 Telegramme als Daten zur Verfügung stellen.

Die Version 3.3.0 konnte ich bisher noch nicht testen, hoffe aber das ich am Wochenende dazu komme.

Jey-Cee commented 6 years ago

Ich konnte die aktuelle Version testen, sie funktioniert und ich bekomme Werte von meinem PSC234.

Holger-Will commented 6 years ago

top! Danke fürs testen!

Jey-Cee commented 6 years ago

Ich hab jetzt mal etwas gespielt und kann meinen PSC 234 auch schalten, dabei ist mir aufgefallen das der Wert AUTO_OFF_TIMER seltsame werte liefert. Aus liefert er mir 12, an 780 und manchmal auch irgendwas über 1000. Kannst du mir sagen was der Wert überhaupt bedeutet?

Was mir jetzt noch fehlt ist die Leistungsmessung, kann ich dir hier helfen das zu implementieren?

Holger-Will commented 6 years ago

Leistungsmessung: Du könntest nach Telegrammen mit CMD==0x07 suchen und mir eins der Telegramme mal als string schicken... (d2-01-09 sendet verschiedene Telegramme die mit dem Feld CMD unterschieden werden...)

AUTO_OFF_TIMER: k.a. muss ich mal in der Docu schauen ob ich was finde...

Jey-Cee commented 6 years ago

Hm ich weiss nicht wo ich das CMD==0x07 finde, irgendwo im code glaub ich mal eine aufschlüsselung gesehen zu haben. Jedenfalls bekomme ich nur 2 Arten von Telegrammen und hoffe eins davon ist das was du brauchst.

`{"timestamp":1508086934410,"rawByte":"550009070156d20460800194b1310001ffffffff2d00b8","packetType":1,"senderId":"0194b131","choice":"d2","subTelNum":1,"destinationId":"ffffffff","rssi":45,"securityLevel":0,"raw":"0460800194b1310001","learnBit":1,"packetTypeString":"VLD"}

{"timestamp":1508087024005,"rawByte":"55000a0701eba5ca7cff0b018433ce8001ffffffff3d006e","packetType":1,"senderId":"018433ce","choice":"a5","subTelNum":1,"destinationId":"ffffffff","rssi":61,"securityLevel":0,"packetTypeString":"4BS","raw":"ca7cff0b","learnBit":1} `

Holger-Will commented 6 years ago

550009070156d20460800194b1310001ffffffff2d00b8 das ist ein CMD 0x04 Telegramm... Mit diesem Telegramm werden Schaltzustände übermittelt. Mit 07ern bekommt man die Daten zum Stromverbrauch. Dies wird entweder in regelmäßigen zeitlichen Abständen gesendet, oder nach Verbrauchsintervallen (z.B. je kW). Man kann mit einem bestimmten Steuertelegramm diese Infos aber auch abfragen.

Jean-PhilippeD commented 6 years ago

Hi !

Now I have an enocean node instance working fine for almost all my devices, I gave a new try to this nodon module, and I see 2 telegrams (in fact 3 with the released value), the first on VLD with unknown value, and the others are correct value on RPS (A1, A0, released).

Jey-Cee commented 6 years ago

550009070156d20460800194b1310001ffffffff2d00b8 das ist ein CMD 0x04 Telegramm... Mit diesem Telegramm werden Schaltzustände übermittelt. Mit 07ern bekommt man die Daten zum Stromverbrauch. Dies wird entweder in regelmäßigen zeitlichen Abständen gesendet, oder nach Verbrauchsintervallen (z.B. je kW). Man kann mit einem bestimmten Steuertelegramm diese Infos aber auch abfragen.

Soweit die Theorie, ich dachte schon da stimmt was nicht weil ich kein 07er Telegramm bekomme, aber Tatsächlich sendet der PSC234 die Daten mit dem EEP A5-12-01. Die EEPD2-01-09 scheint nur zur Steuerung da zu sein. Und die EEP A5-38-08 ist dann wohl für die Repeater Funktion?