Posts: 6
Threads: 1
Joined: Mar 2017
Reputation:
0
So I have my setup working great with the relay board plugin. I had read in another thread about potentially using the rf control plugin to run basic http or API commands to control other stations. I have it set up now where I have a few 'outlying' stations that are hooked up to ESP8266's for running their relays. So far I just run/schedule these via cron on my raspberry pi and that has worked well but it would be nice to be able to also have those show up and be controlled via SIP. I had installed the rf_control plugin and it looks fairly straightforward to modify it to use http commands to turn the valves on/off but will it be able to work alongside the relay board plugin? And if so how would I modify the config to do that? Any ideas would be appreciated. Thanks.
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
2017 Jul 13, 03:20 PM
(This post was last modified: 2017 Jul 13, 06:30 PM by dan.)
Both plugins should be able run run at the same time.
You should only need to add the commands to control your remote stations. Once the rf plugin is installed it will generate a file in the SIP/data directory named "rf_control.json". You can edit that file to add your commands.
Try it and let us know how it goes. If there needs to be any changes to either the SIP code or the plugin code I will work with you to get things working and update the code on GitHub.
Dan
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
As the description of the plugin says it has been in a testing (beta) stage. It was written for a user who was setting up some stations that he wanted to control wirelessly. He had 2 types of commands he could send to the remote stations and the plugin code was set up to handle both but not at the same time.
I have been planning to split the plugin into 2 separate plugins. One for HTTP commands and the other for cli commands. There is some code in the current version that is commented out and needs to be activated in order to use HTTP commands.
The way it works is:
SIP issues a signal when a station is turned on or off. Plugins can "subscribe" to the signal and when the signal is received a function is triggered. The rf_control plugin runs a function called "on_zone_change()" which figures out which station changed and outputs the corresponding command to control the remote station. The commands are stored in a Python list and are accessed by their position in the list (index).
So, to answer your question, you will need to keep dummy commands in the list for the stations controlled by the relay_board plugin.
However I think there will also need to be some changes to the plugin in order to skip the stations controlled by the relay_board plugin. It would be good to have a defined place-holder in the command list that would be skipped by the plugin when that station is controlled some other way. Looking at the code it doesn't look like it has everything it needs to send GET commands.
Let me work on this. It should be fairly easy (famous last words). I'll try to put something together within the next day tor two.
Dan
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
2017 Jul 22, 09:10 PM
(This post was last modified: 2017 Jul 22, 09:11 PM by dan.)
It took longer that I expected but a replacement for the rf_control plugin is now available. It is called cli_control.
Once it is installed you can go to Plugins>cli_control and enter commands on the plugin's UI page rather than having to edit the cli_control.json file.
Dan
Posts: 6
Threads: 1
Joined: Mar 2017
Reputation:
0
Hey Dan,
Very much appreciate the work you did for this plugin, this does exactly what I needed. I have been using it for a few days now and it has worked perfectly. Thanks again.