Create a generic button that triggers an HTTP request to an IP and port

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.
Post Reply
brucemiranda
Posts: 9
Joined: Tuesday 08 August 2017 21:16
Target OS: -
Domoticz version:
Contact:

Create a generic button that triggers an HTTP request to an IP and port

Post by brucemiranda » Thursday 14 September 2017 10:54

If there is already such a device then forgive me, and please point me to it.

But there are several devices on my network that simply work on HTTP requests. i.e. When I click the Power button, all it does is makes an HTTP request to that device's IP on a port.

So instead of creating several devices like e.g. the ONKYO device, why not just create a generic device and allow the user to determine the Button Name and the Button action.

Ofcourse, this will just be a Push command with no feedback, if the command was received and/or acted on. I completely get that parsing the status of these individual devices may be a bit more involved and not as generic.

Nautilus
Posts: 635
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Create a generic button that triggers an HTTP request to an IP and port

Post by Nautilus » Thursday 14 September 2017 11:51

Yes there is (if I understood the question correctly :)). Look for "selector switch" (or "virtual selector" / "dummy selector" -> see e.g. viewtopic.php?f=4&t=15523&p=146844&hili ... or#p146844) if you want to have a device with several buttons to trigger different http requests. Or you can also use the normal on/off (or push buttons) devices as long as you create them through a dummy hardware and then set suitable on and off actions (http url or script) for them. Or control them through the event system (Blockly, Lua, dZvents)...

brucemiranda
Posts: 9
Joined: Tuesday 08 August 2017 21:16
Target OS: -
Domoticz version:
Contact:

Re: Create a generic button that triggers an HTTP request to an IP and port

Post by brucemiranda » Thursday 14 September 2017 13:31

If that is the only way to do it then it reinforces my message about removing the limit of the Selector Switch and allowing the user to select both the Level and the Level Name. https://github.com/domoticz/domoticz/issues/1756
Currently because the Selector Switch uses % it only allows 10 levels and they are spaced at intervals of 10. I might want to add a lot more actions than 10 to a device.

Is there anything I can use that is similar but without the limitations?

Nautilus
Posts: 635
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Create a generic button that triggers an HTTP request to an IP and port

Post by Nautilus » Thursday 14 September 2017 13:52

brucemiranda wrote:
Thursday 14 September 2017 13:31
Is there anything I can use that is similar but without the limitations?
I don't think so. But what comes to your original question (at least part of it):
why not just create a generic device and allow the user to determine the Button Name and the Button action.
then that is exactly what a selector switch does :) Gives you a generic device and allows you to set the button names and actions. Although with the 10 (11) action limit. I too would like to see a possibility to set more levels but maybe it has been thought from the usability point of view given the current GUI. At least I cannot think any nice way from a layout perspective to fit 10+ buttons on a single block.

Then there is of course the option to build your own interface, either from scratch (see e.g. PHP floorplan by Egregius) or add a php / html page under the custom menu in Domoticz GUI containing what you need. I've done the latter for my car heaters for which I want to be able to select a time when the cars should be ready etc.

brucemiranda
Posts: 9
Joined: Tuesday 08 August 2017 21:16
Target OS: -
Domoticz version:
Contact:

Re: Create a generic button that triggers an HTTP request to an IP and port

Post by brucemiranda » Thursday 14 September 2017 14:17

The GUI already allows a drop drop on the block. So that shouldn't be an issue. Ofcourse I agree that more than 10 buttons is just not usable.

Now? Is there an easy way to Grep the output of the status of any command issued to check the device status?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests