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

Shorter "on_for" time #3

Open
redskinhu opened this issue Nov 20, 2019 · 11 comments
Open

Shorter "on_for" time #3

redskinhu opened this issue Nov 20, 2019 · 11 comments
Assignees

Comments

@redskinhu
Copy link

redskinhu commented Nov 20, 2019

Hello

I would like to use shorter on_for time if it possible.
I tried smaller values than 1s but it is not working.
Is it possible change this?

Thanks
Great Job

@twrecked twrecked self-assigned this Nov 21, 2019
@twrecked
Copy link
Owner

I think it's possible. What sort of granularity would you need?

@redskinhu
Copy link
Author

Hello

I need about 300ms on_for time. I think 100ms would be ok.

Thanks
T

@twrecked
Copy link
Owner

Still looking at this!

@redskinhu
Copy link
Author

Great
Thanks

@twrecked
Copy link
Owner

I'm such an idiot. It all ready supports it. I use a standard time_period as the duration type. See the following example:

- platform: momentary
  name: switch100
  on_for:
    milliseconds: 300
  allow_off: True

@redskinhu
Copy link
Author

Hello

First I tested with 300ms and I realised this is still too long for me (original was 1s). After I changed to 100ms but I couldn't feel shorter. Next i tested 10ms and I couldn't feel shorter too. Sadly I can't measure but it definetly longer than 300/100/10ms (I feel about 500-800ms) and the switching speed isn't looks constant. Maybe it is a HA limitation?

Thanks

@twrecked
Copy link
Owner

I noticed a difference between 1s and 300ms but I didn't check any less that that.

I currently call a HA function call track_point_in_time to do the work. Now I know I can accept a smaller value I'll see if I can find an alternative with better granularity.

@redskinhu
Copy link
Author

Thanks in advance.

@twrecked
Copy link
Owner

It does look like it's a restriction with the current HA code.

But, I may be able to work around this by putting a delay directly in the code. Let me see if Python provides anything natively.

@Wagoneermaster007
Copy link

Hi! I am not sure how to use this switch. I have switches in the Modbus platform that needs to be momentary. How do I "connect" the momentary platform to the modbus platform?
image

@twrecked
Copy link
Owner

@Wagoneermaster007 Right now all the switch does is turn on (or off) for a short time. It doesn't hook into any other devices.

I use it to trigger actions - for example, I have one switch that tells the system bad weather is due and an action that notifies me of any open windows or doors when that switch turns on.

You could create an action that joins the momentary switch to your device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants