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


MQTT Broker implementation


JCM

Recommended Posts

welcome, do not hesitate to contact me

Edited by 10der
Link to comment
Share on other sites

I see now why it took a while to get it working :)

I have got a mail from Fibaro :)

 

Quote

Suspicious Login Attempts Prevented

We noticed 5 failed login attempts to your HC2 that seemed suspicious. 
For your security, the following IP address: 192.168.11.11 has been locked for 30 minutes.

 

Link to comment
Share on other sites

Please login or register to see this image.

/monthly_2018_07/image.png.579c0319b816ac5712898c429381f5bf.png" />

 

[email protected]

 

now you can also use any fibaro command.

example (set arm for some devices)

 

dZiZ9yKbVQ.png

Please login or register to see this code.

 

notice args = [0,1111]

 

0 - un-ARM

1111 pin code

===>

http://192.168.1.36/api/callAction?deviceID=8&name=setArmed&arg1=0&arg2=1111

 

Edited by 10der
Link to comment
Share on other sites

  • 2 weeks later...

I like to thank @10der for this huge effort! also @Lambik implementation worked well for months till now

You can say I'm  fool.

I try to use the module on nodered. I successfully connected to HC2 and got polling. The issue is that HC2 Server did not output to MQTT on Topic "home/status".

According to what I have understand, I added a block for MQTT input using topic "home/status/#" and connected with a HC2 device. I used just the ID (number) of the device. There is no debug output on this chain...I suppose I should get everything from a fibaro PIR sensor.

 

For troubleshooting, i used just a MQTT input using topic "home/status" and connected with a debug output. No output at all.

Any help?

Please login or register to see this attachment.

Please login or register to see this attachment.

Link to comment
Share on other sites

Please login or register to see this code.

 

Edited by 10der
Link to comment
Share on other sites

@10der no luck! No output! 

I tried also other device id that I can see that they reported on the debug of HC2 Server, with/without value and no output on device debug chain :(

 

is the topic home/status/# is the correct? Do I need something to build on HC2 side (suppose not)?

Edited by korniza
Link to comment
Share on other sites

Stop!

 

can you add debug here?

Please login or register to see this image.

 

and disable debug output in 

WcLgiVjXAm.png

 

 

 

stop stop stoip

 

i see issue! Ж)

you forgot about MQTT outer 

dgDhKh7r5X.png

lets play

 

Please login or register to see this code.

 

Edited by 10der
Link to comment
Share on other sites

15 minutes ago, 10der said:

Stop!

 

can you add debug here?

Please login or register to see this image.

 

and disable debug output in 

WcLgiVjXAm.png

 

 

 

stop stop stoip

 

i see issue! Ж)

you forgot about MQTT outer 

dgDhKh7r5X.png

lets play

 

Please login or register to see this code.

  

What a stupid! I thought that you already include MTTQ output on the HC2 Server module :)

Now I got it work! Huge Help! 

Thank you!

 

Link to comment
Share on other sites

Just to ask about Topic home/command/#. It is supposed to send a command back to HC2? Can you provide an example?

Link to comment
Share on other sites

sure!

 

Please login or register to see this image.

 

Please login or register to see this code.

 

topic: home/command/deviceid

payload true / false  ===> on / off

              any number 0..99 ===>  for dimmer level

the last version support json object in payload like params for API calling

for example

 

{"name":"setColor","args":[255,0,0,0]}

turn on a red channel in Fibaro RGBW controller

 

Please login or register to see this code.

 

Edited by 10der
  • Thanks 1
Link to comment
Share on other sites

A last one (real)!

Do you have a VD switch that nodered can read status?

I try to connect a wemo bulb using nodered. So I need a VD switch just to get status from nodered and turn on/off wemo bulb. Any example?

 

Also, what about Globals? how can I read/write a global on HC2 using this module? I see the example you uploaded on the past. Should I use home/global as Topic?

Edited by korniza
Link to comment
Share on other sites

34 minutes ago, korniza said:

Do you have a VD switch that nodered can read status?

I try to connect a wemo bulb using nodered. So I need a VD switch just to get status from nodered and turn on/off wemo bulb. Any example?

 

5

no. but you can. click VD button in Ffibaro UI and you will see in debug window with this event in node-red. just create a hook and go :)

 

36 minutes ago, korniza said:

Also, what about Globals? how can I read/write a global on HC2 using this module? I see the example you uploaded on the past. Should I use home/global as Topic?

it's the second question! 

 

Please login or register to see this code.

 

 

 

  • Like 1
Link to comment
Share on other sites

I try to upgrade the Global Variables setup so to poll all the globals and structure them as home/globals/variablename/value as it is done with devices.

As I'm not so familiar with nodered, I ask someone to do the dirty job :)

Link to comment
Share on other sites

i'm close!!!

believe it or not for me it's a huge step.

What is done:

I get all the values from Global variables and build a home/global/<variable_name> topic which has the value as payload. the reason of that is I do not want to query individual global. still I need to find a way to keep info about the variable is read-only/write.

Also there are variables that return as strings but they are tables. Need a way to manipulate them.

You may see that nodes are messy for now. Hoping some help to do it better.

 

Another issue till now is that I get errors on the "write" part of globals when I perform a request for reading but till now, I did not perform any troubleshooting on that. hope to find a solution.

Please login or register to see this code.

Please login or register to see this attachment.

  • Thanks 1
Link to comment
Share on other sites

PS: your json block is invalid... maybe forum past/copy broke it. 

Link to comment
Share on other sites

Please login or register to see this code.

Please login or register to see this image.

Edited by 10der
Link to comment
Share on other sites

3 hours ago, 10der said:

Please login or register to see this code.

Please login or register to see this link.

I get error on function node TypeError: Cannot read property 'value' of undefined

5 hours ago, 10der said:

PS: your json block is invalid... maybe forum past/copy broke it. 

 

Please login or register to see this code.

it is different approach from yours. I got an idea about the other parts I miss. 

Link to comment
Share on other sites

Nice start, realy cool! :)

I think there is something strange with the dispatcher, I can only get it to work by using JSON-formated payload.

 

Please login or register to see this code.

 

 

And there is a small typo in the device, says "Fivaro HC2 device".

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
Reply to this topic...

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