Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to schedule simple commands? #3507

Closed
akauppi opened this issue Jan 7, 2024 · 3 comments
Closed

How to schedule simple commands? #3507

akauppi opened this issue Jan 7, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@akauppi
Copy link

akauppi commented Jan 7, 2024

I am slightly embarrassed to be asking this.. It's perfectly fine that the project doesn't aim to schedule device actions, but.. here goes.

I've got ZWave-JS-UI running and my devices are recognized. I'd like to schedule simple "power on/off" actions for some smart plugs. Is there any way I could do this without resorting to whole Home Assistant? Having databases and what not it looks way heavier than what I would need for: keep lights on between 10am .. 10pm.

@akauppi akauppi added the question Further information is requested label Jan 7, 2024
@robertsLando
Copy link
Member

Yes, you can: https://zwave-js.github.io/zwave-js-ui/#/usage/setup?id=scheduled-jobs

Basically you can schedule custom driver functions to run,

@akauppi
Copy link
Author

akauppi commented Jan 8, 2024

Thanks.

That means technically it could be done. But the developer experience wasn't great (I don't see a cursor, and get no logs out though I tried). It would be coding in dark, and without API docs, I guess. Cannot switch the bulb on.

What I do see is a "targetId" (2-37-0, see below). If you have a snippet that switches such on/off, I can give it a try.

image

On my own, I'll go and make some Rust automation to do this.

@robertsLando
Copy link
Member

robertsLando commented Jan 8, 2024

Here is your driver function to write true on that specific switch:

const zwaveClient = this.zwaveClient

const vId = {
    nodeId: 2,
    commandClass: 37,
    endpoint: 0,
    property: 'targetValue',
}

zwaveClient.writeValue(vId, true)

@robertsLando robertsLando changed the title Any way to schedule simple commands? How to schedule simple commands? Jan 8, 2024
@zwave-js zwave-js locked and limited conversation to collaborators Jan 8, 2024
@robertsLando robertsLando converted this issue into discussion #3509 Jan 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants