@countjuh and @dvanwerkhoven
Well, i finally had time to check this issue out. I have seen someone giving an example;
onclick="PressButton(config['Open])" id="rolluik-fenna">
After looking through the pimatic-socket.js file, there is no PressButtom function… could you please clarify why this should work @incmve ?
So, what can we do about it? Well, create the function.
Lets look at the normal function to TOGGLE, found in the /js/pimatic-socket.js file;
function toggleDevice(device)
{
socket.emit('call', {
id: 'executeAction-1',
action: 'executeAction',
params: {
actionString: 'toggle ' + device
}
});
}
In particulair;
actionString: 'toggle ' + device
This line toggle’s the given id in the index.html.
To use this for a button, simply add this under that function as a new function;
function pressButton(device)
{
socket.emit('call', {
id: 'executeAction-1',
action: 'executeAction',
params: {
actionString: 'press ' + device
}
});
}
As you can see, the function is “pressButton” and the actionString now does a press event instead of a toggle event.
Now, to the fun (and working) part, this is how you press a button;
<div class="thumbnail tile tile-medium tile-red uibutton" onclick="pressButton('spotjes25')" id="spotjes25">
Both values are the ID for the button, not the device.
In this case; device is spotjes-schakelaar and had 3 buttons, spotjes25 spotjes 50 and spotjes75.
Let me know if this works