How can i send a toast message via REST API to pimatic? I’m using node-red and want to switch devices via REST and also send toast messages for example: “Switched on lamp1”
-
Send toast message
-
May be it can be done easier, but what I try is: define a variable, update this variable via REST API and define a rule like this: "if $myVariable.value == “on” then log “Switched on lamp1”.
-
@Heizelmann That is a solution until someone implement this feature as a REST call. But for each toast message i need a rule
-
@kenci Depends on what exactly want to do. You can also use a variable as parameter in the rule.
-
@Heizelmann I’m using node-red to do some REST-API calls to pimatic. In node-red i send a HTTP-Request to switch a device on. For that purpose i want to inform a user in the frontend of pimatic that “device x” has been switched remotely on.
I thought something like this:
Sending a POST with messageToast tohttp://pimatic.url/api/frontend/sendToast
-
@kenci If I understood right, you already sent a request for switchig a device and then you want to send an additional request for only showing a toast. Is this right? If it is you can define a variable ‘myToast’ and send a PATCH request to that variable containing the message string. Then you need only one rule to show this toast.
-
@Heizelmann Good ideal! I will create a variable called
nodeToast
. After that create a ruleIF $nodeToast gets updated THEN log "NodeRed: $nodeToast"
But it would be cool if @sweetpi could add this to the API.
-
will move that to the feature requests - so pls. upvote the first post in this threat pls !
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !