Thinking about this, @ElCid, is GET enough, or do you need to make a POST?
I’m thinking about giving the flexibility to decide the method (defaulting to GET) and payload to send as body. do you also need to send headers?
it might become quite complicated, but I’m exploring this option as we speak.
The option to select GET or POST would be best as some api’s only work with POST requests. As to headers, they may be needed, as in authenication
maybe a change in variables
say-
Url = The url of the request
Request - Get or Post
Type - Form data or json
onData - the form or data body for on request with substitutions .
ToggleData - toggle data
offData - off data
Headers - any headers you may want in json name value form
I’m thinking about adding a second variable to every command, called something like TurnOnCommandParameters, and when present, just send it via curl as command line parameters. This should be easier and you can send whatever you want. I will still support replace into the parameters as well.
Since every request should potentially be different, every commands should have this option. Default will be no arguments specified, the HTTP call will be sent via GET as today.
While I’m still working on a way to call CURL commands directly, there’s a new update available. I will add it to official AppStore in the coming weeks. If you want it fresh, get from github.
I just added support for virtual Window Covers/Roller Shutters/Blinds
In Vera those are mapped to dimmers anyway, so it was easy. There’s only a new Stop command, while Up/Down just set the corresponding brightness.
Do you want a Virtual Device making HTTP calls when tripped, or a device that it’s a virtual sensor?
The latter is easy to achieve, I use it to trigger scenes from external code (ie, my presence sensor is a virtual sensor attached to some logic pinging my phone, arpinging and getting position from IFFT). Just create a new device, specify device_type, device_file, device_json and leave altid blank.
I think it’s doable, I’ll try in the next batch of updates.
Both, sends http calls when tripped and untripped. and can be tripped by standard call to vera.
the idea is to have a standard http (shelly/sonoff) device attached to a standard (no smart) door/motion/fire sensor . Then i can arm them. I could then handle all the calls locally with node-red.
I use automate on every household members phones to log them in and out of the house. A s back up i ping the phones from node-red to. I can also call to automate to get locations. no other party is involved and it is strictly private from 3rd party companies (except are lord and master google due to location services-)
Ok, this makes sense. Different sensors are just cosmetic, the service is shared.
I’ll provide one call to arm/disarm and one to trip/untrip a remote device.
As promised, the new version supporting virtual sensor is on GitHub
I managed to implement all sensors (they’re basically the same), I’m just not finding the device file for glass break and co sensor, but they should implement security sensor, so just doc is incomplete. This should work as you requested, let me know if you find something not working.
yes if my device is out of service, i want my vera show me that the device not working .
for example if i ping my device and it is not responding , vera show it.
yes if my device is out of service, i want my vera show me that the device not working .
for example if i ping my device and it is not responding , vera show it.
Just create a scene, scheduled to run every 15 minutes, with a code similar to this:
local function ping(address)
local returnCode = os.execute("ping -c 1 -w 2 " .. address)
if(returnCode ~= 0) then
returnCode = os.execute("arping -f -w 3 -I br-wan " .. address)
end
return tonumber(returnCode)
end
local status = ping('192.168.1.42')
luup.set_failure(status, 314)
where 192.168.1.42 is your device IP and 314 is your device ID.