Feller-AG / wiser-api

MIT License
12 stars 1 forks source link

configure switch to simulate push button #7

Open neckcen opened 1 year ago

neckcen commented 1 year ago

Hello,

I am trying to configure a switch to behave like a push button. Using the current API, I believe the closest approximation would be setting delayed_off, however this does not help in my case (press time should vary). Did I miss anything or is this feature not (yet?) available?

My use case: a Feller pirios 360R eco which can be turned on either momentarily (<2s press) or for an extended duration (>2s press). I honestly do not care much about the momentary on, but turning it off requires a short press again which means delayed_off=2500 does not work.

woodworm commented 1 year ago

Since version 5.1.19 we support user scripts. The scripts can be executed by SmartButtons events. There are examples on the Script webpage. Maybe you can implement your requirement with this feature.

neckcen commented 1 year ago

The switch in question is not a smartbutton, so I was hopping to be able to directly change the input type. Something similar to:

PATCH  /api/devices/config/{config_id}/inputs/{input_channel}
{
  "type": "momentary_on"
}

I do however have a smart button nearby so I'll try with a script for now and see what can be done.