Sonoff Inching in HA

Hello,

I have integrated my sonoff relays trough HACS and sonoff integration

I can see the relays, but unfortunately i can not use the inching function that i have set in the ewelink app. I only can change state of relay. but I need inching because some of relays are dry contact for a gate opener.

Is there any way to add inching in HA Thank you !

Why don’t you set an automation to turn off the relay after x seconds? (Assuming inching means that)

Trigger on state change from off to on and stay in in state for 1 minute (to be configured)
Action to turn off the switch

This is a good option also.
I’m not sure how the code should look - i guess is a noobie question since should be very basic. I’m new in HA so not all feature are know to me
How the code should be, for a 0,1 sec timmer on a sonoff relay ?

description: inching with 100 milliseconds 
mode: single
trigger:
  - platform: state
    entity_id:
      - switch.water_pump
    to: "on"
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 100
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.water_pump

Great !
Where more exactly should i add this code ? In the automatisation.yaml ? or configuration.yaml ?

You can do it over UI going through settings - automations page.

so just copy/past and change entity ID with my actual sonoff relay ? or i have to adapt more the code ?

You can do that from the UI.

Go to integrations, find your Sonoff integration and click the X Entities button.

That should show all the entities configured with Sonoff. These are mine:

Just enable the INCHING Duration entity if it is disabled, click on the entity, go to the INFO tab and you can set there the duration:

1 Like

Hi, i found it !
One more thing, how i can make following thing ?
Crate a button in HA dashboard.
On press, sonoff relay is activated (inching 0,3 sec). Wait 6 sec and re-activate relay (same inching 0,3 sec)

In this way i want to open the gate just for 1-3 distance for pedestrians access

Thank you !

For that you will need an automation.

You can go to helpers, create a button and use it as the trigger for the automation.

i managed to do it ! Thx a lot for all support !