Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cover HK-ZCC-A sunchiner SR-ZG9080A open close state invert #13528

Closed
tomamplius opened this issue Aug 13, 2022 · 4 comments
Closed

cover HK-ZCC-A sunchiner SR-ZG9080A open close state invert #13528

tomamplius opened this issue Aug 13, 2022 · 4 comments
Labels
problem Something isn't working

Comments

@tomamplius
Copy link

tomamplius commented Aug 13, 2022

What happened?

I can invert position, but open close state is not invert

I can create pull request but there is 2 ways

First is update function

   cover_state: {
        key: ['state'],
        convertSet: async (entity, key, value, meta) => {
            const lookup = {'open': 'upOpen', 'close': 'downClose', 'stop': 'stop', 'on': 'upOpen', 'off': 'downClose'};
            value = value.toLowerCase();
            utils.validateValue(value, Object.keys(lookup));
            await entity.command('closuresWindowCovering', lookup[value], {}, utils.getOptions(meta.mapped, entity));
        },
    },

to

   cover_state: {
        key: ['state'],
        convertSet: async (entity, key, value, meta) => {
            const lookup = utils.getMetaValue(entity, meta.mapped, 'coverInverted', 'allEqual', false) ?
                {'open': 'upOpen', 'close': 'downClose', 'stop': 'stop', 'on': 'upOpen', 'off': 'downClose'} :
                {'open': 'downClose', 'close': 'upOpen', 'stop': 'stop', 'on': 'downClose', 'off': 'upOpen'};
            value = value.toLowerCase();
            utils.validateValue(value, Object.keys(lookup));
            await entity.command('closuresWindowCovering', lookup[value], {}, utils.getOptions(meta.mapped, entity));
        },
    },

second is create function like bticino_4027C_cover_state

What did you expect to happen?

Allow invert state on cover_state to_zigbee function

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.27.0

Adapter firmware version

1d03

Adapter

zigate

Debug log

No response

@tomamplius tomamplius added the problem Something isn't working label Aug 13, 2022
@Koenkk
Copy link
Owner

Koenkk commented Aug 13, 2022

Changing the standard cover state converter makes the most sense to me.

@Hankey71
Copy link

Hi !
I have the same problem with my SR-ZG9080A.
Have you a solution ?

@tomamplius
Copy link
Author

reverse cable between SR-ZG9080A and motor

@Hankey71
Copy link

OK... too bad !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants