Sorry for my English which is a mix between mine and google
I write my notes here because I’m afraid of forgetting everything …
These are just mine … don’t read them
These are the commands to change values in Pimatic both from the LAN (local) and from REMOTE (internet)
IP = the ip of pimatic
PORT = the port for pimatic
VALUE = the value you want to enter (
ADMIN = the admin of pimatic
PASSWORD = the password of pimatic
VARIABLE = the name of the variable
DEVICE = the ID of the device
in --data “state=false” set the switch(device) to OFF
in --data “state=true” set the switch(device) to ON
… the variable must already have been created in pimatic
WRITE a VARIABLE from LAN via command line(terminal)
curl -X PATCH --header "Content-Type:application/json" --data '{"type": "value", "valueOrExpression": "VALUE"}' --user "ADMIN:PASSWORD" http://IP/api/variables/VARIABLE
CHANGE a DEVICE state from LAN via command line(terminal)
curl -X GET --user "ADMIN:PASSWORD" --data "state=false" http://IP/api/device/DEVICE/changeStateTo
or
curl -X GET --user "ADMIN:PASSWORD" --header "Content-Type:application/json" http://IP/api/device/DEVICE/changeStateTo?state=false
READ the DEVICE state from LAN via command line(terminal)
curl http://IP/api/device/DEVICE/getState --user "ADMIN:PASSWORD"
WRITE a VARIABLE from REMOTE via command line(terminal)
- To use the same commands remotely, logically you have to change the IP and add the port used from the outside (internet) in this way …
LOCALE… http://IP/api/device/DEVICE/getState
REMOTE… http://IP:PORT/api/device/DEVICE/getState
CHANGE a DEVICE state from LAN via browser (Chrome or Firefox)
http://ADMIN:PASSWOR@IP/api/device/DEVICE/changeStateTo?state=true
CHANGE a DEVICE state from REMOTE via browser (Chrome or Firefox)
http://ADMIN:PASSWOR@IP:PORT/api/device/DEVICE/changeStateTo?state=true
READ a VARIABLE value from LAN via command line(terminal)
http://ADMIN:PASSWOR@IP/api/variables/VARIABLE
VARIABLE create from pimatic does not have only the name but also the type
for example room.temperature or dimmer.percentage