Read Door Sensor and motion status via local network

  • Hi, how can i get door sensor status and motion sensor status through local network and use it for script.

    what i want to do is, when the door sensor is open, turn shelly 2pm relay on. when door sensor is close, shelly 2 pm add a script to check if there is motion from motion sensor. if there is a motion, keep the relay on. else, turn the relay off. i want to do it all locally without internet connection.

    thanks

  • sangwilly 6. März 2023 um 12:31

    Hat den Titel des Themas von „Red Door Sensor and motion status via local network“ zu „Read Door Sensor and motion status via local network“ geändert.
  • this is possible, but you'd need advanced Javascript skills in order to to this.

    - create a scripting based HTTPServer

    - use actions from the DW2 to write the open/close status to that webserver

    - store open/close status in scripting based KVS (key value storage)

    - use actions from the motion sensor to write motion status to the the HTTPServer

    - store motion status in the KVS.

    periodically check the KVS values and turn on/off the relay based on those values.

    please check the scripting documentation for detailed infos.

    Shelly Script Language Features | Shelly Technical Documentation
    Since version 0.9.0
    shelly-api-docs.shelly.cloud

    >100 Shellies, darunter so gut wie alles was der Hersteller produziert hat. ;)
    :!: ich beantworte grundsätzlich keine Fragen per persönlicher Nachricht:!: