• X
    xg3n1us

    I’ve got a question while using rules.

    I have some 433MHz contact sensors for my windows at home connected via the homeduino plugin and have the following (working) rule:

    When Handy is absent for 2 minutes send text telegram to User “Window is $testkontakt.contact”

    In Telegram I get the message: Window is true or Window is false

    Can I somehow change the output of the variable to open or closed?

    I have about 10 windows and don’t want to create one rule for each state and window and then send 20 messages to Telegram. I want to send one message with each window state.

    Best Regards

    posted in Rules and Scripts read more
  • X
    xg3n1us

    Yes it is possible.

    I have the same sensor for some months now. After struggeling with pilight and don’t get used to the protocol development there, I changed to pimatic now. After some try and error and rereading every hit I’ve found so far, I’ve managed to get my first own protocol working :-)

    Add the name of the new protocol (I’ve called it soil1) in pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/controller.js

    Than just create a file (I’ve called it soil1.js) in pimatic-app/node_modules/pimatic-homeduino/node_modules/homeduino/node_modules/rfcontroljs/lib/protocols/

    This is the code for the protocol:

    module.exports = function(helper) {
      var protocolInfo, pulsesToBinaryMapping;
      pulsesToBinaryMapping = {
        '01': '0',
        '02': '1',
        '0003': ''
      };
    return protocolInfo = {
        name: 'soil1',
        type: 'weather',
        values: {
          temperature: {
            type: "number"
          },
          humidity: {
            type: "number"
          }
        },
        brands: ["Springfield"],
        pulseLengths: [484, 1952, 3900, 8792],
        pulseCount: 76,
        decodePulses: function(pulses) {
          var binary, result;
          binary = helper.map(pulses, pulsesToBinaryMapping);
          return result = {
            temperature: helper.binaryToSignedNumber(binary, 12, 23) / 10,
            humidity: helper.binaryToNumber(binary, 24, 31),
          };
        }
      };
    };
    

    Maybe it’s not perfect, but after all the data which is received is correct. The value name humidity is also not correct, should be moisture, but as I’m currently using the HomeduinoRFWeatherStation class for the device I can’t use moisture as value ;-)

    Best Regards

    posted in Hardware read more

Looks like your connection to pimatic forum was lost, please wait while we try to reconnect.