Hi,
if it possible to call a (pimatic api) url direct in a rule without curl or wget and shell ececute call?
I think to call a json api method in nodejs are a bread an butter function Or maybe its better to call api directly .
Here are some examples with keyword ‘wget’:
call local url directly from rule
IF $mailboxfilled
THEN wget "/api/device/dummy-presence/changePresenceTo?presence=false"
call foreign url directly from rule
IF $mailboxfilled
THEN wget "usr:pass@1.1.1.1/api/device/dummy-presence/changePresenceTo?presence=false"
call foreign url directly from rule and set variable with result
IF $mailboxfilled
THEN set $type to wget "usr:pass@1.1.1.1/api/device/dummy-presence".device.attributes.type
or
IF $mailboxfilled
THEN set $type to wget "usr:pass@1.1.1.1/api/device/dummy-presence" select device.attributes.type
call api function changePresenceTo …
IF $mailboxfilled
THEN set api.dummy-presence.changePresenceTo(presence = true)
or set value directly
IF $mailboxfilled
THEN set api.dummy-presence.presence to presence
IMHO it’s not just for call api function, we can control other things on foreign machines (send push, sms or other messages) or get some values from other systems.
Simple is beautiful!, Just my 2 cents.
Frank