Author Topic: Fibaro Home Center 2  (Read 31390 times)

0 Members and 8 Guests are viewing this topic.

jamesst

  • $upporter
  • Jr. Member
  • *****
  • Posts: 25
  • Karma: 0
    • View Profile
Re: Fibaro Home Center 2
« Reply #15 on: August 15, 2014, 11:06:33 AM »
Yes, that exactly how I use it, trough scrape action directly from VC. I have created fibaro.xml so that's fine.
Your command tree from the post up before works just fine.

 The eventghost part i need because of mediaportal events that I get to  trigger the scene in HC2 trough http commands.
But to close the circle I need to figure out how to get events form HC2 in the eventghost, but I will probably need to look elsewhere for that.

So in short VC works fine with fibaro HC2 this way.

Thanks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Fibaro Home Center 2
« Reply #16 on: August 15, 2014, 01:53:06 PM »
But to close the circle I need to figure out how to get events form HC2 in the eventghost, but I will probably need to look elsewhere for that.

Since we don't own Fibaro or have access to HC2 it is difficult to suggest how you can do this.

If events in HC2 can be configured to perform some kind of custom macros within HC2 then maybe you can send the events to either EventGhost or VoxCommando using TCP, HTTP, or UDP.  But I don't know what kind of HC2 events you are talking about, nor what is possible within that system.

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #17 on: February 04, 2015, 11:17:00 AM »
Thanks for posting this update. That's great to hear.

I think it should be possible to control your HC2 directly from VC, without using Eventghost, if you're interested.

The same "scrape" method is used. Based on the documentation I posted above from the Fibaro forum, here is a command for dimming your dimmable lights to a certain level.

[EDIT: I see now that I posted this example above as well, so nevermind. :) Sorry for the confusion]

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.6-->
<command id="290" name="Dim {1} to {2} percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} is the device ID for your dimmable devices. If you can find out those IDs, you can put them in a payload xml file like the example I have attached.&#xD;&#xA;{2} is the dim level, from 1-100">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://&lt;HC2 ip address&gt;/api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Dim</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\fibaro_dimmables.xml</payloadFromXML>
  <phrase>to</phrase>
  <payloadRange>1,100</payloadRange>
  <phrase optional="true">percent</phrase>
</command>

You will need to create your own payload xml file using your actual device IDs and device names of your choice. I have attached an example of what it would look like, but obviously this file won't work for you.

It sounds as though you have already figured out how to get device information from your Fibaro, so hopefully you can do this.

I'm trying to figure out how to get nime5ter's scrap tool to work so I can send commands to my Fibaro HC2 controller.  I purchased Voxcommando sometime ago, however I haven't played with it much so I'm a novice.

Can someone point me in the right direction where I can find instructions? 

So far I copied the provided code into an xml file and imported it to the voicecommands xml menu with a xml showing one of my lights using its z-wave ID25.

When I speak a command, Voxcommando recognises it ok but the light doesn't switch on.  I need to trouble shoot this but I don't know where to start.

If it helps, to switch light 25 on to say 50% here is the http command I would send from a brower -

http://admin:admin@192.168.0.155/api/callAction?deviceID=25&name=setValue&arg1=50

Any help would be appreciated.

Steve

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #18 on: February 04, 2015, 11:44:23 AM »
Hi Steve,

In terms of instructions, it sounds as though you would benefit from watching a couple of the key VC video tutorials to help you understand some of the fundamentals of how to use VC and xml you find on the forum etc., as it will save you a lot of time and headache in the long run.

First, an important tip is that you should not need to save xml you find in a code box on the forum to a file and then import it. You can actually just select that text, and copy and paste it directly into your command tree

Also, not all xml posted as message *attachments* are commands. Often these attachments are payload xml files that are used with a posted command. This should be evident from the context of the post.

Second, it will be important for your Fibaro needs to learn about how payloads work, and how to construct/edit commands in general.

For a quick start to learn about commands similar to what you want to do with the Fibaro, I recommend you watch the Vera video tutorial. The concepts discussed there will be generally applicable to the Fibaro, except that you'll be using the Scrape action instead of the Vera actions.

It's also important for all new users to watch at least the first Editing & Building Commands tutorial, though watching both of the "Editing Commands" tutorials will go a long way.
http://voxcommando.com/mediawiki/index.php?title=Video_Tutorials

You will ideally want to create a payload XML file that contains the IDs for your different dimmable lights associated with whatever phrase you want to use for each (25 --> living room light).

You will understand how this works much better by watching the Vera video.

However, you can start by directly copying and pasting the command URL you mention above into the Scrape commmand and hitting "save and execute". That should test whether the command effectively dims or brightens your light with ID 25 to 50% brightness.

As a starting point, I've attached an annotated image of the command I posted as well.
« Last Edit: February 04, 2015, 11:58:03 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #19 on: February 04, 2015, 01:08:06 PM »
Hi Steve,

As a starting point, I've attached an annotated image of the command I posted as well.

Thank you for your reply and the links to the video's.  I'll make sure I study them to get up to speed.

I did try the quick test option you mentioned, by editing the url in the Scrape command and hit the "save and execute" button but unfortunately the light didn't switch on. (command I used is as below)

http://admin:admin@192.168.0.155/api/callAction?deviceID={25}&name=setValue&arg1={50}

When I paste the same command in a browser (without the curly brackets around the light number and level number it switches the light on ok.

I'm not sure if it's relevent but I am aware that the lua firmware/software has recently had a big rework on the Fibaro HC2 I wonder if that could be the reason its not working?.

Thanks again..... I'm off to watch these videos

Steve

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #20 on: February 04, 2015, 01:12:49 PM »
Yes. :)

Exactly. You should not use curly brackets if you are "hard coding" the device ID and dim level.

{} is VC syntax. It is used for variables, including payload values.

For this reason, you should watch the videos I mention. You need to learn what payloads are.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #21 on: February 04, 2015, 01:16:08 PM »
Yes. :)

Exactly. You should not use curly brackets if you are "hard coding" the device ID and dim level.

{} is VC syntax. It is used for variables, including payload values.

For this reason, you should watch the videos I mention. You need to learn what payloads are.

Yes I guess that was the case, hence I tried it both ways in the scrape command box without success.  This makes me wonder if it will work at all?
« Last Edit: February 04, 2015, 01:18:19 PM by Stealth »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #22 on: February 04, 2015, 01:36:55 PM »
The "admin:admin@" looks new, compared to what the documentation used to say.

If you can post a link to (current) Fibaro documentation you are using, I can take a look.

Also, turn on logging in VC (if it's not already on), save and execute the VC command using

Code: [Select]
http://admin:admin@192.168.0.155/api/callAction?deviceID=25&name=setValue&arg1=50
And then attach your VC log here, and I'll see if that can help us to diagnose the problem. There are a couple possibilities.

I don't think it's impossible, but I can't say for sure.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #23 on: February 04, 2015, 01:49:36 PM »
In the meantime, you could also try the following variation to see if it makes a difference (just a guess):

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="425" name="Dim device 25 to 50 percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape.Get</cmdType>
    <params>
      <param>http://admin:admin@192.168.0.155/api/callAction?deviceID=25&amp;name=setValue&amp;arg1=50</param>
      <param>application/x-www-form-urlencoded</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Dim device 25 to 50 percent</phrase>
</command>

You can copy and paste the above xml directly into a command group in your command tree.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #24 on: February 04, 2015, 02:19:48 PM »
In the meantime, you could also try the following variation to see if it makes a difference (just a guess):

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="425" name="Dim device 25 to 50 percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape.Get</cmdType>
    <params>
      <param>http://admin:admin@192.168.0.155/api/callAction?deviceID=25&amp;name=setValue&amp;arg1=50</param>
      <param>application/x-www-form-urlencoded</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Dim device 25 to 50 percent</phrase>
</command>

You can copy and paste the above xml directly into a command group in your command tree.

I tried your new code as instructed but still the light does not turn on from within VC.  I have attached the log file

The
Code: [Select]
admin:admin relates to-

User name: admin
Password: admin

Doc's are here:-
http://www.fibarouk.co.uk/support/lua/

Thanks

Steve


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #25 on: February 04, 2015, 02:43:56 PM »
Thanks. It looks like you only tested the new shot-in-the-dark command I posted, is that correct?

Can you please also test the original command that we know has previously worked for other users and send me the log again?
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #26 on: February 04, 2015, 02:47:41 PM »
Thanks. It looks like you only tested the new shot-in-the-dark command I posted, is that correct?

Can you please also test the original command that we know has previously worked for other users and send me the log again?

Yes you are correct. sorry, I will do it now...

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #27 on: February 04, 2015, 02:54:35 PM »
Log attached, whilst using your original code by hitting the save and execute button.

Steve

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #28 on: February 04, 2015, 02:58:59 PM »
It seems they've added some authentication requirements so we're getting an "unauthorized" error.

I've done a bit of online searching on their authentication requirements. There may be some trial and error here, so bear with me.

For your next test, try the following:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="425" name="New test: Dim device 25 to 50 percent" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape.Get</cmdType>
    <params>
      <param>http://192.168.0.155/api/callAction?deviceID=25&amp;name=setValue&amp;arg1=50</param>
      <param />
      <param />
      <param />
      <param />
      <param>Authorization: Basic YWRtaW46YWRtaW4=</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Dim device 25 to 50 percent</phrase>
</command>
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #29 on: February 04, 2015, 03:11:52 PM »
Thanks for your help its much appreciated...

I tried the latest code still no go yet.  Log also attached.