GithubHelp home page GithubHelp logo

Comments (2)

mvalla avatar mvalla commented on August 23, 2024

Hi, devices are detected as switches because they are switches: I cannot imagine a way to understand automatically they are connected to a door instead of a light.

What you want to achieve can be probably obtained by proper configuration of items in openHAB i.e. obtain a pushbutton behavior. See the openHAB forum and search for threads like this:
https://community.openhab.org/t/push-button-instead-of-switch/30937

Since this does not appear to be an issue related to the binding, I will close this issue after some time.
M

from openhab-addons.

alessandro-lac avatar alessandro-lac commented on August 23, 2024

Here's a way to manage this situation:

Step 1:
Create a Push Button:
.sitemap:

Switch item=FF_LivingRoom_Door label="Entry Door" mappings=[ON="Open"] visibility=[FF_LivingRoom_Door_State == OFF]
	        Switch item=FF_LivingRoom_Door label="Entry Door" mappings=[ON="Close"] visibility=[FF_LivingRoom_Door_State == ON]

.items:

Switch   FF_LivingRoom_Door          "Entry Door"               <frontdoor>          (FF_LivingRoom)                 ["Lighting"]   {channel="", autoupdate="false"}
Switch   FF_LivingRoom_Door_State    "Entry Door"               <frontdoor>          (FF_LivingRoom)                 ["Lighting"]   {channel=""}

Remember to link both Items to the door in the PaperUI Things section.

Step 2:
Create a rule to close the door after you press the open button (otherwise the door lock will stay open)

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

// Global Variables

rule "Chiusura Porta"
when
    Item FF_LivingRoom_Door changed
then
  if ((FF_LivingRoom_Door.state == ON)) {
    sendCommand(FF_LivingRoom_Door, OFF)
  }
end

Hope this helps.

from openhab-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.