Closed joachim198 closed 1 year ago
I also decoded the data from the switch: https://github.com/markusfeist/FhemMobileAlerts/blob/master/FHEM/51_MOBILEALERTS.pm Line 315 following. (I will also contribute to the documentation, but had no time so far.)
Device ID is 0x15. Packageheader is 0xCE The message has the follwing data (Offset 12): 16Bit tx-counter with info "triggered" and "batteryState" (like other devices) 8Bit info for pressed button:
Some testdata: ce5d8a6e0e1215ffffffffff4019114a090204000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016 = button 1 pressed short ce5d8bc69e1215ffffffffff401a210a4a0204000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011 = button 2 pressed short ce5d8bc9301215ffffffffff401d13cb0a030500000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e = button 1 pressed long ce5d8bcb801215ffffffffff4023128e0b040600000000000000000000000000000000000000000000000000000000000000000000000000000000000000003b = button 1 pressed two times
I did some simple coding and added the switch to the sensors.js:
//ID15: Switch MA10880 function Sensor_ID15() {} util.inherits(Sensor_ID15, SensorBase); Sensor_ID15.prototype.bufferSize = function() { return 4; } Sensor_ID15.prototype.transmitInterval = function() { return 6 * 60; } Sensor_ID15.prototype.generateJSON = function(buffer) { return { 'switchnum': buffer.readUIntBE(0,1).toString(16).charAt(0) ,'switchstate': buffer.readUIntBE(0,1).toString(16).charAt(1) }; } Sensor_ID15.prototype.debugString = function() { return this.temperaturAsString(this.json.switchnum[0]) + this.temperaturAsString(this.json.switchstate[0]); }
@markusfeist @joachim198
is this successfully tested, so that we can take it over?
for me it works fine! 1 year without any problems.
Any ideas of including the techno line MA 10880 switch?