I just released v2 of my Virtual HTTP Devices Plug-in. As always, 100% local, 100% standard, mobile friendly and working on openluup/altui as well.
What’s new in v2:
Master/Children: now you can just create a master and have any number of children attached. They will still work separately, but this will greatly improve memory consumption on Vera. Please see GitHub for guidance on migration. No need to do it unless you have many devices on your system.
async update of device’s status. If you want to update the status of a device separately, just return something different than the HTTP code 200/300 family. it’s useful if your device doesn’t complete the response with the call and you want to update its status. Just use a normal Vera call to update the corresponding variable
added support for Scene Controllers (see my post in Shelly i3 for a use case)
more work around switches/heaters
stabilization and fixes
I’m still not sure I will add it to the official store, so get it from GitHub.
Hope all is well, I’m trying to figure out how best I can make a 4 plug IP switch work with your http plugin, any guidance would be appreciated… The details below hopefully will help.
on / off commands for one socket are sent via the following command.
Another question I wanted to ask was around future support for command line requests? For example I make a few calls to other devices, e.g. my NAS to see if a VM is running on a host. E.g below.
local command = io.popen("ssh -y -i /etc/dropbear/dropbear_rsa_host_key pi@192.168.1.37 '/QVS/usr/bin/virsh list --all' 2>&1")
print(command)
local msg = command:read("*a")
print(msg)
Which returns this.
Id Name State
----------------------------------------------------
5 6e856cb2-2793-4acd-9a15-9e1d28ff0caf running
- 137f2fcf-2db2-43a8-8dc3-9964dfe6aabf shut off
- 4ad65c4d-99d5-4c2f-aca4-edaca820e8df shut off
- 7b0f8c69-de6y-4aa2-a601-1414304fff30 shut off
- 84e9b437-7e09-4ee6-ba4e-201096b9266c shut off
- d7216338-8e39-4107-b8e0-2019cd150ed2 shut off
set debugmode variable to 1 and look at logs. There’s maybe something going on.
you could send any complex command via curl support. Look at docs.
If you want to sync back status, you’ll have to write some code. I was thinking of a way to ping an endpoint for status, but I’m not sure it could be an easy task to be general enough.
Just wanted to suggest a possible idea for a future feature and that’s to add a ‘GetStatusURL’ option, where the person can add a url in to get the current status and your plugin will looks for either a “1” or “True” for on, and a “0” or “false” for off being returned.
If their ‘GetStatusURL’ does not return exactly that, then also have a ‘GetStatusLua’ option too, where you can put some Lua code in that the plugin runs to return once again either a “1” or “True” for on, and a “0” or “false” for off.
I appreciate you can do scene for this , and set variables, but I just thought it would be nice to have everything in the same device/plugin etc.
I’m still not 100% convinced. The use case here is to avoid polling and using pushing instead (ie from Tasmota or whatever), but I’ll try to add something in the next version.
Perhaps I’m missing something, how do you get push to work with quite old and very basic http request based plug sockets (those that just have basic on/off/status capability ) ?
I’m trying to stay away from polling, because I’m sure it will impact the stability of your Vera. But I’ll add it anyway, as an optional feature for everyone who needs it and want to run it at their own risk.
I’m trying to turn off a registered http devices in Vera UI, which I know is already turned off at source. So I’m not expecting the command to work, I’m just looking to make the UI match with the actual state of the device,
As I can’t seem to turn it off in the UI, looking in the log, there seems to be this related entries .
Yes, just update the status variable. It should be covered in the readme. I’m using it to initiate a request from the Ui and update the status based on the actual action being execute successfully.
@therealdb Can you modify the Virtual Heater so it can be used as a HVAC thermostat? The idea is to be able to change mode and setpoint it does not need to turn off when Cool/Heat temperature is archived i need it to control third party HVAC Split system through HTTP calls.