Skip to content

Add mqtt cover support for IS_CLOSING and IS_OPENING#30248

Closed
docsapro wants to merge 1 commit into
home-assistant:devfrom
docsapro:patch-2
Closed

Add mqtt cover support for IS_CLOSING and IS_OPENING#30248
docsapro wants to merge 1 commit into
home-assistant:devfrom
docsapro:patch-2

Conversation

@docsapro
Copy link
Copy Markdown

Hello,

Sorry Its probably not the way I should do that, but I am very new to Github and HomeAssistant, please forgive me :-)
Also I am not programmer so I would like to ask if someone can do a change for me.
I'm also not sure if I will phrase that correctly. Sorry about that if its the case. I will try to provide the max info.

Is it possible for someone to add the support of additional states (OPENING and CLOSING and STOPPED) with the usage of an additional MQTT topic. I think this a supported feature of the platform/entity ? with is_opening or is_closing ? (https://developers.home-assistant.io/docs/en/entity_cover.html#supported-features)

There would be 3 different payloads which would define the "direction" of the shutter.

here is an example of my homebridge equivalent with tasmota shutter if it helps to understand :

shutter2/tele/RESULT this topic from my tasmota provides this JSON message
{
"Shutter1": {
"Position": 100,
"direction": 0
}
}

So, with direction being 1, 0 or -1 I can know if it goes up, down or if it is stopped

in Homebridge ( Homebridge can do that with "PostionStateValue" : https://www.npmjs.com/package/homebridge-mqttthing#window-covering ),
this works :

"getPositionState": {
"topic": "shutter2/tele/RESULT",
"apply": "return JSON.parse(message).Shutter1.direction;"
}
},
"positionStateValues": [
1,
-1,
0 "getPositionState": {
"topic": "shutter2/tele/RESULT",
"apply": "return JSON.parse(message).Shutter1.direction;"
}
},
"positionStateValues": [
1,
-1,
0
]

Thank you very much 👍

Breaking Change:

Description:

Related issue (if applicable): fixes #

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Hello,

Sorry Its probably not the way I should do that, but I am very new to Github and HomeAssistant, please forgive me :-)
Also I am not programmer so I would like to ask if someone can do a change for me. 
I'm also not sure if I will phrase that correctly. Sorry about that if its the case. I will try to provide the max info.

Is it possible for someone to add the support of additional states (OPENING and CLOSING and STOPPED) with the usage of an additional MQTT topic. I think this a supported feature of the platform/entity ? with is_opening or is_closing ? (https://developers.home-assistant.io/docs/en/entity_cover.html#supported-features)

There would be 3 different payloads which would define the "direction" of the shutter.

here is an example of my homebridge equivalent with tasmota shutter if it helps to understand : 

shutter2/tele/RESULT this topic from my tasmota provides this JSON message 
{
    "Shutter1": {
        "Position": 100,
        "direction": 0
    }
}

So, with direction being 1, 0 or -1 I can know if it goes up, down or if it is stopped

in Homebridge ( Homebridge can do that with "PostionStateValue" : https://www.npmjs.com/package/homebridge-mqttthing#window-covering ),
 this works :

 "getPositionState": {
                    "topic": "shutter2/tele/RESULT",
                    "apply": "return JSON.parse(message).Shutter1.direction;"
                }
            },
            "positionStateValues": [
                1,
                -1,
                0 "getPositionState": {
                    "topic": "shutter2/tele/RESULT",
                    "apply": "return JSON.parse(message).Shutter1.direction;"
                }
            },
            "positionStateValues": [
                1,
                -1,
                0
            ]

Thank you very much 👍
@docsapro docsapro requested a review from a team as a code owner December 28, 2019 09:47
@homeassistant
Copy link
Copy Markdown
Contributor

Hi @docsapro,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@probot-home-assistant
Copy link
Copy Markdown

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks!

@MartinHjelmare MartinHjelmare changed the title Update cover.py to support IS_CLOSING IS_OPENNING Add mqtt cover support for IS_CLOSING and IS_OPENING Dec 28, 2019
@MartinHjelmare
Copy link
Copy Markdown
Member

Feature and enhancement requests should go in the Feature Requests section of our community forum. Thanks!

@lock lock Bot locked and limited conversation to collaborators Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants