Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Send Global variable value from Node-Red


magicman

Question

Hi can anyone help me please? I want to send a  value from my Node-red and assign it to a Global variable value on my HC2.

 

The Global variable i wish to update is "message" and the value is "Connection established".

 

Tried some flows from here but always get JSON error.

Hop someone can help ... Thanks

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

100500 was answered by me

1) only via admin user

2) easy do this via VD. node-red -> call your VD ->VD change or update globals

Please login or register to see this code.

 

do not forget

 

Please login or register to see this image.

/monthly_2020_06/image.png.70b28a574a9c14e77c59dee0a8de252d.png" />

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi 10der thank you for you quick answer. Can you explain more about the VD route that sounds promising ?.

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi 10der me again!!

    your flow works perfectly and updates the global variable but scenes triggered by the global do not run ? am i missing something here?

     

    im sure you will know ;)

     

    Len

    Link to comment
    Share on other sites

    • 0
    9 hours ago, magicman said:

    but scenes triggered by the global do not run ?

    I do not have HC2 plus sclerosis ;) 

    1sh it’s right behavior as for Fibaro 

    if you want trigger scenes by global parameters we should provide key in POST - but sclerosis;) 

    try google this forum as far as I remember I was wrote about this 2 y ago 

    Edited by 10der
    Link to comment
    Share on other sites

    • 0

    @magicman

    Please login or register to see this link.

     

    Please login or register to see this link.

    • Expert

      Please login or register to see this link.

    Please login or register to see this link.

    That "invokeScenes" statment is available with REST API. See 

    Please login or register to see this link.

    .

    So if you change variable with REST API and not with fibaro:setGlobal(), than you can use "invokeScenes".

     

    In JSON body it will be {"value":"xyz","invokeScenes":true}.

     

    You can use it in LUA. I used it with HCL, so i had to made virtual device, that uses REST API.

     

    @Fibaro: You could implement "invokeScenes" into setvariable in Block scenes and in LUA scenes and set it to true by default.

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
    2 minutes ago, magicman said:

    Thank you 10der i will investigate these options

    nothing investigate here :)

    just add (chage) my flow

     

    image.png.35945aed702399dfe0acd8a8cc95cde8.png

    Link to comment
    Share on other sites

    • 0
    On 6/2/2020 at 8:47 PM, 10der said:

    100500 was answered by me

    1) only via admin user

    2) easy do this via VD. node-red -> call your VD ->VD change or update globals

    Please login or register to see this code.

     

    do not forget

     

    Please login or register to see this link.

     

     

    Hello

    I'm trying to get this to work but always have a JSON parse error.

    What is this virtual device required? I have been trying most of the day to get the MQTT broker working with fibaro and node-red and that seems to be working now but i cannot get node red to change any of the variables in the variable panel in fibaro using this node-red string. 

     

    My MQTT is working as i can get device info in node-red fine, It's just the other way (node-red to fibaro)

     

    Thanks for the good work!

     

    Regards

    Mathew

     

    Edit, I'm not new. I lost my account when the forum upgraded!

    Edited by M4TVW
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...