Skip to content

WindowCovering not working #56

Closed
Closed

Description

@yfre

WindowCovering was not working for me. I get the message "Could not add home" in the home app. commenting out following lines in WindowCoveringService solved the issue
/**
addCharacteristic(new HoldPositionCharacteristic(windowCovering));

	addCharacteristic(new ObstructionDetectedCharacteristic(() -> windowCovering.getObstructionDetected(),
			c -> windowCovering.subscribeObstructionDetected(c),
			() -> windowCovering.unsubscribeObstructionDetected()));

	if (windowCovering instanceof HorizontalTiltingWindowCovering) {
		addCharacteristic(new CurrentHorizontalTiltAngleCharacteristic(
				(HorizontalTiltingWindowCovering) windowCovering));
		addCharacteristic(new TargetHorizontalTiltAngleCharacteristic(
				(HorizontalTiltingWindowCovering) windowCovering));
	}
	if (windowCovering instanceof VerticalTiltingWindowCovering) {
		addCharacteristic(new CurrentVerticalTiltAngleCharacteristic(
				(VerticalTiltingWindowCovering) windowCovering));
		addCharacteristic(new TargetVerticalTiltAngleCharacteristic(
				(VerticalTiltingWindowCovering) windowCovering));
	}

*/

still unsure what is wrong with that characteristics.

Activity

  1. yfre commented on Jan 22, 2019

    @yfre
    ContributorAuthor

    here the json part generated for accessories that make home app to stop to work

    {
    "aid": 785117798,
    "services": [
    {
    "iid": 1,
    "type": "0000003E-0000-1000-8000-0026BB765291",
    "characteristics": [
    {
    "iid": 2,
    "type": "00000023-0000-1000-8000-0026BB765291",
    "perms": [
    "pr"
    ],
    "format": "string",
    "events": false,
    "bonjour": false,
    "description": "Name of the accessory",
    "value": "Arbeitszimmer Rollladen",
    "maxLen": 255
    },
    {
    "iid": 3,
    "type": "00000020-0000-1000-8000-0026BB765291",
    "perms": [
    "pr"
    ],
    "format": "string",
    "events": false,
    "bonjour": false,
    "description": "The name of the manufacturer",
    "value": "none",
    "maxLen": 255
    },
    {
    "iid": 4,
    "type": "00000021-0000-1000-8000-0026BB765291",
    "perms": [
    "pr"
    ],
    "format": "string",
    "events": false,
    "bonjour": false,
    "description": "The name of the model",
    "value": "none",
    "maxLen": 255
    },
    {
    "iid": 5,
    "type": "00000030-0000-1000-8000-0026BB765291",
    "perms": [
    "pr"
    ],
    "format": "string",
    "events": false,
    "bonjour": false,
    "description": "The serial number of the accessory",
    "value": "none",
    "maxLen": 255
    },
    {
    "iid": 6,
    "type": "00000014-0000-1000-8000-0026BB765291",
    "perms": [
    "pw"
    ],
    "format": "bool",
    "events": false,
    "bonjour": false,
    "description": "Identifies the accessory via a physical action on the accessory"
    }
    ]
    },
    {
    "iid": 7,
    "type": "0000008C-0000-1000-8000-0026BB765291",
    "characteristics": [
    {
    "iid": 8,
    "type": "00000023-0000-1000-8000-0026BB765291",
    "perms": [
    "pr"
    ],
    "format": "string",
    "events": false,
    "bonjour": false,
    "description": "Name of the accessory",
    "value": "Arbeitszimmer Rollladen",
    "maxLen": 255
    },
    {
    "iid": 9,
    "type": "0000006D-0000-1000-8000-0026BB765291",
    "perms": [
    "pr",
    "ev"
    ],
    "format": "int",
    "events": false,
    "bonjour": false,
    "description": "The current position",
    "value": 100,
    "minValue": 0,
    "maxValue": 100,
    "minStep": 1,
    "unit": "%"
    },
    {
    "iid": 10,
    "type": "0000006F-0000-1000-8000-0026BB765291",
    "perms": [
    "pw"
    ],
    "format": "bool",
    "events": false,
    "bonjour": false,
    "description": "Whether or not to hold position",
    "value": null
    },
    {
    "iid": 11,
    "type": "00000072-0000-1000-8000-0026BB765291",
    "perms": [
    "pr",
    "ev"
    ],
    "format": "int",
    "events": false,
    "bonjour": false,
    "description": "The position state",
    "value": 2,
    "minValue": 0,
    "maxValue": 2,
    "minStep": 1
    },
    {
    "iid": 12,
    "type": "0000007C-0000-1000-8000-0026BB765291",
    "perms": [
    "pw",
    "pr",
    "ev"
    ],
    "format": "int",
    "events": false,
    "bonjour": false,
    "description": "The target position",
    "value": 100,
    "minValue": 0,
    "maxValue": 100,
    "minStep": 1,
    "unit": "%"
    },
    {
    "iid": 13,
    "type": "00000024-0000-1000-8000-0026BB765291",
    "perms": [
    "pr",
    "ev"
    ],
    "format": "bool",
    "events": false,
    "bonjour": false,
    "description": "An obstruction has been detected",
    "value": false
    }
    ]
    }
    ]
    }
    
  2. timcharper commented on Jan 28, 2019

    @timcharper
    Contributor

    I'm also observing this; when I include a MockWindowCovering in the sample app, things fail horribly. It breaks the pairing and I have to delete the pairing info and start over with the sample app. It's really a catastrophic failure, and really quite weird.

  3. timcharper commented on Jan 28, 2019

    @timcharper
    Contributor

    Seems like one of the characteristics is misconfigured; I've stripped it back to the required characteristics, and it works;

    timcharper@97de9aa

  4. jrburk commented on Feb 5, 2019

    @jrburk
    Contributor

    Seems like one of the characteristics is misconfigured; I've stripped it back to the required characteristics, and it works;

    timcharper@97de9aa

    Hmm, can you post your code here. I think I have the minimal code, but the problem still exists.

  5. yfre commented on Feb 6, 2019

    @yfre
    ContributorAuthor

    Seems like one of the characteristics is misconfigured; I've stripped it back to the required characteristics, and it works;
    timcharper@97de9aa

    Hmm, can you post your code here. I think I have the minimal code, but the problem still exists.

    in class WindowCoveringService i commented out following lines
    /*
    addCharacteristic(new HoldPositionCharacteristic(windowCovering));
    addCharacteristic(new ObstructionDetectedCharacteristic(() -> windowCovering.getObstructionDetected(),
    c -> windowCovering.subscribeObstructionDetected(c),
    () -> windowCovering.unsubscribeObstructionDetected()));

    if (windowCovering instanceof HorizontalTiltingWindowCovering) {
    addCharacteristic(new CurrentHorizontalTiltAngleCharacteristic((HorizontalTiltingWindowCovering) windowCovering));
    addCharacteristic(new TargetHorizontalTiltAngleCharacteristic((HorizontalTiltingWindowCovering) windowCovering));
    }
    if (windowCovering instanceof VerticalTiltingWindowCovering) {
    addCharacteristic(new CurrentVerticalTiltAngleCharacteristic((VerticalTiltingWindowCovering) windowCovering));
    addCharacteristic(new TargetVerticalTiltAngleCharacteristic((VerticalTiltingWindowCovering) windowCovering));
    }
    */

  6. jrburk commented on Feb 6, 2019

    @jrburk
    Contributor

    Thank you. Now it's working for me too...

  7. added 4 commits that reference this issue on Feb 18, 2019
    f3b10b2
    f220824
    e4068ce
    7eb0a91
  8. timcharper commented on Feb 18, 2019

    @timcharper
    Contributor

    I've narrowed it down to HoldPositionCharacteristic, FYI

  9. timcharper commented on Mar 9, 2019

    @timcharper
    Contributor

    @jrburk I still have no idea why HoldPositionCharacteristic is causing this. The latest release will use BasicWindowCovering, in the meantime.

  10. sobeos commented on Jul 25, 2019

    @sobeos
    Contributor

    Any news on window coverings? I have horizontal tilting window coverings. HorizontalTiltingWindowCovering extends WindowCovering. WindowCovering is deprecated.

  11. sobeos commented on Jan 2, 2020

    @sobeos
    Contributor

    I still have no idea why HoldPositionCharacteristic is causing this.

    Problem is that the characteristic is write only.
    Homekit complains:
    "Non-readable characteristics must not contain 'value' key".
    The problem is in BaseCharacteristic -> makeBuilder

  12. sobeos commented on Jan 2, 2020

    @sobeos
    Contributor

    Looks like
    if (isReadable) {
    setJsonValue(builder, value);
    }
    is fixing the problem.

  13. timcharper commented on Jan 2, 2020

    @timcharper
    Contributor

    Great find! Would you mind opening up a pull request?

  14. yfre commented on Jun 10, 2020

    @yfre
    ContributorAuthor

    fixed in #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions