Page 1 of 1

writing to user varianble

Posted: Monday 21 October 2019 9:08
by desertdog
I have some bash scripts which are time-triggered to launch some scenes on Hue or Nanoleaf via their API's
example script:

Code: Select all

#!/bin/bash
curl -v -X PUT \
    --url  http://192.168.X.xx:16021/api/v1/***apikey***/effects/\
    --header 'content-type: application/json' \
    --data '{"select":"'"$1"'"}';
    
The trigger for the script is: script:///home/pi/domoticz/scripts/bash/nanoscene.sh "scene 1", where "scene 1" is the name of the scene in the Nanoleaf. By changing the name in the API call I can call different scenes.

This is working perfectly, but I would also like to write the name of the scene to a user variable, so I can use this in another scripting to see which scene is running. How can I do this?

Re: writing to user varianble

Posted: Monday 21 October 2019 9:23
by waaren
desertdog wrote: Monday 21 October 2019 9:08 Wow to write the name of the scene to a user variable, so I can use this in another scripting to see which scene is running.
If you want to set a value in a domoticz uservariable from a bash script:

Code: Select all

curl 'http://<domo ip>:<domo port>/json.htm?type=command&param=updateuservariable&vname=<variable name&vtype=2&vvalue=<your string>'