How can i set in a rule the presence at the DummyPresence? I.e.:
set dummydevice to presence
Set presence in DummyPresence
How can i set in a rule the presence at the DummyPresence? I.e.:
set dummydevice to presence
present
execute "curl USER:PASSWORD@192.168.0.110/api/device/DUMMYDEVICENAME/changePresenceTo?presence=true >/dev/null 2>&1"
absent
execute "curl USER:PASSWORD@192.168.0.110/api/device/DUMMYDEVICENAME/changePresenceTo?presence=false >/dev/null 2>&1"
@p4co86 said:
curl USER:PASSWORD@192.168.0.110/api/device/DUMMYDEVICENAME/changePresenceTo?presence=true
Thanks, after some try’s … i guess the correct url are with DUMMYDEVICEID. Here my url for curl:
curl "user:pass@127.0.0.1:8080/api/device/dummy-presence/changePresenceTo?presence=true"
{
"success": true
}
But thank you, it works!!
@Frank-Herrmann In my opinion, the DummyPresence sensor should have a set action provider to make it easier to use. Unfortunately, this has not been implemented (yet). Being forced to use a shell execute is pretty pointless. An alternative approach could be what you are suggesting in post 672. However, using action provider where applicable will always be far more efficient then doing a REST request.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said:
… using action provider where applicable will always be far more efficient then doing a REST request.
Sure, that’s in this case correct. But what are happend with calls to foreign servers with JSON services? To write for every Service a plugin is IMHO also not really usefull.
In example, i have a REST Service to control my webcam, how can i send a command without shell execute and curl and write an extra plugin? A DummyButton and a rule with a command for this button sounds good for me
@Frank-Herrmann I agree, for simple REST queries, say a GET request to get a value, your proposal of using REST queries as part of actions should work fine and there should be no need to do a shell-execute or to require a plugin. However, for more complex queries this may not be suitable and it may be an overhead if you have to use multiple queries to read individual values.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@Oitzu Cool, i’ll try this after my vacation
@p4co86 Hmm, ok i called this url and the indicator are filled, but after one second he set automatic to empty.
Call url:
curl admin:xxxx@127.0.0.1:8080/api/device/dummy-mailbox/changePresenceTo?presence=true
after some seconds:
for me it works when i called the url it is filled till i call the false url
EDIT: i rember this: you have to set autoreset to false
"autoReset": false,