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

Node Red integration with hc2 SOLVED


Question

Posted (edited)

I wondered if anyone can point me in the right direction to find help with setting up basic node red structures for hc2? using node-red-contrib-fibaro-hc2 by @10der .I have a node red flow which turns on my tv , turns on netflix or youtube or live tv , all with wol command.

I want to run this from a device or scene from hc2. I can post from node red to hc2 -no problem but can't find a way to get commands from hc2, any ideas ??

 

Edited by MARCUSP.I.L

Recommended Posts

  • 0
Posted (edited)

1) please remove all

 

2) import this

Please login or register to see this code.

3) configure mqtt server ip address

4) configure hc2

turn on debug

and you should see debug info from your HC2

Please login or register to see this image.

turn off debugging

uvERBYapH5.png

 

so, now we can connect 1st device

 

1) drop mqtt in

2) drop 

hc2-device

 

3) connect mqtt in to hc2-device

4) setup Hc2 server in device

XdbkNbkxL4.png

 

5) try key any device name in inputline QEQY6TEfUN.png

press fnDbLwNmbW.png

and pick up your device

6) add /value

GfZuqaj6Ou.png

 

70fo9ULQLD.png

9LNbttsF22.png

 

 

 

 

Edited by 10der
  • Thanks 1
  • 0
Posted
On 4/26/2019 at 9:27 PM, MARCUSP.I.L said:

get commands from hc2

Sorry, Sir, unclear for me 

what a commands?

  • 0
  • Inquirer
  • Posted

    Thanks for reply, with commands I mean using the on state of a device to trigger a node red flow. I am trying to run a tv on flow when I turn on a light or scene, either by using  your hc2 node red nodes or with rest api. Your node red hc2 nodes are installed and work brilliantly, have post commands to hc2 working. Thanks again

    • 0
    Posted

    ah got it.

    • 0
    Posted

    as temp solution

     

    Please login or register to see this code.

     

    Please login or register to see this image.

     

    hpg9Fw13eM.png

     

    • 0
  • Inquirer
  • Posted

    Thanks @10der, just home , will try your solution. I t really helps me to see a solution first and then learn. Thanx.

    • 0
  • Inquirer
  • Posted

    Hei , is there something i am missing  @10der ? I imported your node to Node red, changed security settings etc  and it runs the scene on hc2. 

    But it seems that running the scene on hc2 doesn't do anything on node red.

    I see in your last message that there is a debug running 'Hello NODE RED', where is this located ? Have you put script into the scene on hc2? Thanks again, fighting to get my head around the whole concept of API.

     

    • 0
    Posted

    may I am is not clear to understand what you wish.

    I think what you want to call some LUA scenes in HC2.

     

    • 0
  • Inquirer
  • Posted

    Hei, i want to turn on a flow when i turn on a light or scene on my hc2.

    • 0
    Posted

    Ok. drop all.

    • 0
  • Inquirer
  • Posted

    great, i was thinking that i could use the nodes hc2 server or hc2 device to run the flow ? There is no-one online who has this set up so i have to ask the expert. Thanking for your time:)

    • 0
    Posted

    Please login or register to see this image.

     

    AUx5IbKjRY.png

     

    HkP9paRbWr.png3RYvCfICxW.png

     

    ezFnmxr85x.png

     

    3RYvCfICxW.png

     

    8etBQCGUUw.png

    aLzTdoe9hH.png

     

     

     

    Please login or register to see this code.

     

    31 minutes ago, MARCUSP.I.L said:

    great, i was thinking that i could use the nodes hc2 server or hc2 device to run the flow ? There is no-one online who has this set up so i have to ask the expert. Thanking for your time:)

     

    poohffffffffffffffff!!!!!!!!!!!!!!!!!!!

     

    for reproducing and making pics I need time. please don't jump to conclusions.

    thank you for understanding.

    • 0
  • Inquirer
  • Posted

    Just home again - Thank you @10der, thanks for your time and work , i understand more and more , i will look into this now, great pictures and step by step instructions, really helpful. I can clearly see that this took some time. Home center is far more interesting and useful with contributors like you. Brilliant work . 

    • 0
  • Inquirer
  • Posted

    Hei, implemented this node set up last night but failed to get it working. Have you used a mqtt input? I downloaded mqtt box and tried dozens of combinations , made a successful connection but can't get it to work in the flow. Sorry if this is real newbie question, perhaps i am in a little over my head ?

    I have to admit that mqtt is totally new to me and reading and trying hasn't worked for me. I read as much as i can understand.

    Lokking online is a little confusing as the information is sometimes contradictory, use mqtt from node red or install from npm , set up in mqtt box , or use raspberry . 

    Thanking you again for your help @10der

     

    • 0
    Posted

    Please login or register to see this link.

    • 0
    Posted (edited)

    Hey @MARCUSP.I.L

    Im in a similar position to you re code red. Re  understanding mqtt in node red there are some great youtube tutorials

    Have you installed the mqtt VD on Hc2 and have that talking to mqtt in node red?. 

    Please login or register to see this link.

    I think this is required ?

    Thanks to @10der most of the information is there but the set up from start to finish is hard to understand .

    ie Im sure my node red came with mqtt installed already and if so finding the target ip of the broker  is the same as pi ip address  with port attached 192.168.1.11:1883 ?

    so once you have installed  mqtt bridge on hc2, set up topic and credentials including target IP address  and  port ?

                                    Dragged Mqtt node broker and on pallet and se up topic and credentials including target ip address and port

                                    Install and set up fibaro node with hc2 credentials      

                                    Drag injector node and load string payload  with command with basic authentication and  say scene start command

       Is this it or am i lost.

    your thoughts?

                              

     

    Edited by Jamie mccrostie
    • 0
    Posted

    Re mqtt bridge install. The bit i'm struggling with is  unzipping and loading mqtt.php file in root directory of pi, I'm going around in circles.

    • 0
  • Inquirer
  • Posted (edited)

    Reading your post now @Jamie mccrostie  , same kind of run around here.. I dont have the vd installed , looking into this now.

    As far as i understand the flow i requested/ sent from @10der should run when the mqtt connects, independent of a vd ?

    Anyway, i dont have a pi and i can't get the mqtt palette to work and see now that i have issues when i try to install mosca (terminal loading node-red-contrib-mqtt-broker gives me all kinds of errors).

    I dont want to veer off on another course with hours of learning terminal commands but maybe it's needed ?

    I will look at the vd , and preinstalled mqtt node  again , have you tired an independent mqtt service like mqtt box?

    Agree that the info is diffuse, to say the least, and getting this up and running is time consuming, circles of trial and error with npm installs /brew/ and now mqtt . Sometimes wish there was a step by step instruction or a one time install app.

    Don't have it working yet but will use a few more nights b4 i give up.

    Thanks to both of you for getting me this far.

    Edited by MARCUSP.I.L
    • 0
    Posted
    1 hour ago, MARCUSP.I.L said:

    mosca

        I think dont use mosca it’s different purpose  delete it and its settings otherwise it keeps starting and stoping in background

    you can see this in node red terminal.

    On palette far right drop Menu  the config nodes settings are saved, select and delete there.

    Use std mqtt node 

    Ive got “ mqtt box”set up on lap top and can send debug message between node red broker and lap top and vicer verser. So now kind of understand how mqtt works.

    Thats why I figured you needed the mqtt bridge installed in vd as a client in HC2

     

     

    Of course im guessing all this from my trial and error

    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...