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

EVOK API how does relay_set_for_time work #75

Open
3 tasks done
aufi opened this issue Mar 30, 2019 · 2 comments
Open
3 tasks done

EVOK API how does relay_set_for_time work #75

aufi opened this issue Mar 30, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@aufi
Copy link

aufi commented Mar 30, 2019

Prerequisites

  • Are you running the latest Master or the latest release version?
  • Did you try to reinstall EVOK?
  • Did you perform a cursory search on the [forum] and [google]?

Log files needed

Include the output of the following commands on your Neuron/UniPi device:
https://pastebin.com/jgvXDrQ7

(I use xS40 extension, which looks to work same (nearly fine) as main module now, so I'm not sure if log entries are related)

Description

JSON RPC method relay_set_for_time doesn't work for me, it switch the output (which is OK), but does not return it back after timeout.

I compared my code to examples in forum and API docs and I'm either missing something or it doesn't work for me.

Steps to Reproduce

  1. Have latest released EVOK on raspbian on Neuron L203
  2. Run following (ruby, but should be the same for other languages):
require "jsonrpc-client"
evok_rpc = JSONRPC::Client.new("http://evok_host")
evok_rpc.relay_set_for_time("2_11", 1, 10.0)
=> {"modes"=>["Simple"], "alias"=>"al_obyvak_stul_svetlo", "relay_type"=>"physical", "value"=>1, "glob_dev_id"=>1, "dev"=>"relay", "circuit"=>"2_11", "pending"=>true, "mode"=>"Simple"}
# and light turn on

Expected behavior: Light (relay 2_11) will be switched off after 10 secs.

Actual behavior: Light (relay 2_11) stays on.

@martytriska martytriska self-assigned this Apr 15, 2019
@mkudlacek
Copy link

Hello @aufi, this is Martin from UniPi.

We were just walking through the current functionality and came across two problems:

  1. The procedure never worked as intended in the first place
  2. The name of the procedure doesn't correspond with the functionality which you can read in the code

The intended functionality was to be able to invert the state of the relay after some time. We just had a discussion over what could be the usage of such function. And since you are historically the first person trying to use this function, I would like to ask you about your intention so we can fix it properly. So, why do you need such function? What is your usecase?

The second problem is the naming, which suggests "set the relay <param_1> to value <param_2> for the <param_3> period of time". Basically this would be a pulse generator which is being used in automation much more frequently than the function described above, and in our humble opinion, should be the correct behaviour.

Thank you for your reply in advance and have a nice day,
Martin

@aufi
Copy link
Author

aufi commented Apr 15, 2019

Hi Martin, thanks for response!

My use-case is a jalousie/sunblinder switch. I planned switch engine on just for time until jalousie is pulled up/down and then turn it off. I have installed Somfy engines which have automatic switch off on fully open/closed state, but I can control jalousie from both button via direct switch and via Evok API and I need avoid situation when both directions (up and down) are switched on. Or at least decrease propability of this situation.

An alternative good solution would be to have an "exclusive flag" for group of relay outputs (implemented in direct switch) to ensure up and down switch is on in the same time. Hardware buttons have this "feature" by default, but when it becomes controlled by hardware buttons&API (e.g. too strong wind or blind all windows in house in the same time).

So far I worked with solution which proxies Evok events to MQTT [1] bus where several bots can listen including bot that can switch off the "up" relay if "down" direction was requested (but I don't have it fully working ATM).

[1] https://github.com/aufi/evok-to-mqtt

@kratochvil01 kratochvil01 added the enhancement New feature or request label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants