amatt 5 Share Posted November 11, 2018 Can someone help me with Node-Red? I need to tell node-Red to change a global value in HC2. Thanks for the Help Quote Link to post Share on other sites
0 10der 656 Share Posted November 11, 2018 node-red-contrib-fibaro-hc2 0.0.75 but this version still in development. no ETA. sorry but you can use simple flow [{"id":"c4cdbe4c.c1dba","type":"http request","z":"66b2aa16.b03184","name":"HC2: set global","method":"PUT","ret":"obj","url":"http://192.168.1.36/api/globalVariables/{{{topic}}}","tls":"","x":660,"y":320,"wires":[["5b95809f.d03c"]]},{"id":"5b95809f.d03c","type":"debug","z":"66b2aa16.b03184","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":850,"y":320,"wires":[]},{"id":"264c340d.44157c","type":"change","z":"66b2aa16.b03184","name":"do not touch","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.name","pt":"msg","to":"topic","tot":"msg"},{"t":"set","p":"payload.value","pt":"msg","to":"value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":320,"wires":[["c4cdbe4c.c1dba"]]},{"id":"aa1ac1c7.272a9","type":"inject","z":"66b2aa16.b03184","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":320,"wires":[["b14bb006.b56ff"]]},{"id":"b14bb006.b56ff","type":"change","z":"66b2aa16.b03184","name":"change me!","rules":[{"t":"set","p":"topic","pt":"msg","to":"Test","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"Ololo","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":320,"wires":[["264c340d.44157c"]]}] do not forget chage HC Ip address + set basic auth Quote Link to post Share on other sites
0 kallecux 17 Share Posted October 11, 2019 Hi there! Do you have newer information to modify a global variable via node red? Greetings! Karl Heinz Quote Link to post Share on other sites
0 10der 656 Share Posted October 11, 2019 todo plan 1) fix reconenction on network errors 2) set global vars when? maybe ath this weekend. Quote Link to post Share on other sites
0 alexpelli 3 Share Posted October 18, 2019 Hi... is it possible to get globalvalue from HC2 to Nodered with a similar flow process? Quote Link to post Share on other sites
0 10der 656 Share Posted October 18, 2019 (edited) yes oops: UPD no only changed values :( topic has name home/globalVariables Edited October 18, 2019 by 10der Quote Link to post Share on other sites
0 Kage 20 Share Posted May 24, 2020 hoi 10der i am totally new with node-red but wanted to try your "simple" flow i have set my ip and credentials like this http://user:[email protected]/api/globalVariables/{{{topic}}} where put i my global like for example the global in HC2 = marantz into this flow is it also possible to put the payload directly into the global of HC2 for example if i say to google or alexa or siri set input marantz to hdmi2 Quote Link to post Share on other sites
0 10der 656 Share Posted May 24, 2020 @Kage sorry, not sure what I right understand you 1st what url is? My not not required any http 2nd yes my node can’t change global var 3d you can’t change global var if user is not admin so, if you want to change global var please simple create a new VD with button where you can. Change global var and call press this button from NodeRed Quote Link to post Share on other sites
0 Kage 20 Share Posted May 24, 2020 (edited) thx for quick replay, This is what i wanted to do, say to Alexa "set volume to 40 i have a global named marantzVol and the payload is, when i say the line, 40 now when the payload is 40 that is what i wand into my global to HC2 😄 When i youse your flow as above you mention change ip and basic auth. so i did like http://user:[email protected]/api/globalVariables/{{{topic}}} do i have to change de topic in this line or where do i put my global from HC2 in I get the variable to change only it is the value that is given as Ololo. now only if it can be the payload of ALexa Edited May 24, 2020 by Kage progress Quote Link to post Share on other sites
0 10der 656 Share Posted May 24, 2020 For what purposes you are trying to use HC? node red has a native tons ready for use solution for Alexa/ sonos etc its look like tripping from Ukraine Lviv to Poland Kraków (~300km) via for example Los Angles Quote Link to post Share on other sites
0 Kage 20 Share Posted May 24, 2020 When i say the frase "Alexa set reciever at 40" than the global in HC2 have to change in 40, That triggers a scene that controls the Marantz. For now i get it to work only for text not numbers i change the text value Ololo into a msg whit value payload than when i say a frease like "On" it change the global in HC to ON but whit numbers only it will not work.......Yet Quote Link to post Share on other sites
0 10der 656 Share Posted May 24, 2020 HC2 (and not HC3) can hook parameters when you calling scenes why you use global s for it?! just encode your parameters to table and pass to call as last parameter in scene you can hook this parameters no global var at all Quote Link to post Share on other sites
0 Kage 20 Share Posted May 24, 2020 (edited) i know it can be done by parameters directly into a scene but i am new with node-red and this is stap one 😁 its not only for the Marantz but this is de testcase for me now so for completing the first stap, how can i change the number from Alexa into a text-value, 8 must be "8" GOT IT!!😉 made a function with var x = msg.payload; if (x>0) { var msg_o = {payload : String(msg.payload)} thx again just playing with it, just raining outside Edited May 24, 2020 by Kage 1 Quote Link to post Share on other sites
0 Kage 20 Share Posted May 24, 2020 So global isn't a option because there is nog trigger if you work with startSource. Then trigger it to startScene like 10der says. ☹️😊 Quote Link to post Share on other sites
Question
amatt 5
Can someone help me with Node-Red?
I need to tell node-Red to change a global value in HC2.
Thanks for the Help
Link to post
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.