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

0 Members and 1 Guest are viewing this topic.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #30 on: February 04, 2015, 03:15:21 PM »
Sorry. I just noticed that you're using VC 2.1.2.7.

For me to be able to effectively help you, you'll need to download a more recent version of VC.

The Scrape.Get action that we've been using was only added in version 2.1.3.6.

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.1.3.6

(To handle authentication we need to be able to add a header, which can't be done with the older Scrape action.)

Do you know how to update your version? (Just download the installer from the VC downloads page, into your existing VC directory, and run it.)
« Last Edit: February 04, 2015, 03:17:31 PM 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 #31 on: February 04, 2015, 03:18:19 PM »
Sorry. I just noticed that you're using VC 2.1.2.7.

For me to be able to effectively help you, you'll need to download a more recent version of VC.

The Scrape.Get action that we've been using was only added in version 2.1.3.6.

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.1.3.6

(To handle authentication we need to be able to add a header, which can't be done with the older Scrape action.)

Do you know how to update your version? (Just download the installer from the VC downloads page, into your existing VC directory, and run it.)
Yes I'm ok with that.  I will; do it now.

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #32 on: February 04, 2015, 03:31:55 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>

Yes.... now I updated to version 2.1.3.6  this code works.  It switches the light on.

Great.....

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #33 on: February 04, 2015, 03:38:57 PM »
Ha. OK. So, for any commands, you'll need to use Scrape.Get, with the special header parameter exactly as I provided in the example:

Code: [Select]
Authorization: Basic YWRtaW46YWRtaW4=
The weird string is your username and password encoded in Base64. (I used this tool to convert admin:admin to B64 http://www.motobit.com/util/base64-decoder-encoder.asp)

Anyhow. Getting back to the original command: you can now use the original one with the 2 payloads so that it will be more flexible (allowing you to control different dimmable lights with one command, and different brightness values).

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<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.Get</cmdType>
    <params>
      <param>http://192.168.0.155/api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}</param>
      <param />
      <param />
      <param />
      <param />
      <param>Authorization: Basic YWRtaW46YWRtaW4=</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>


« Last Edit: February 04, 2015, 05:38:28 PM 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #34 on: February 04, 2015, 03:42:04 PM »
If you haven't yet done so, you'll need to create your own payload xml for your dimmable lights as in my original example if you want to use the command as it is written.

So, now might be the time to review those videos I mentioned, and then test out some other commands that are working in your browser for you.

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 #35 on: February 04, 2015, 03:44:04 PM »
Ok will do....  Thanks again for your help.

Steve

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #36 on: February 04, 2015, 03:55:16 PM »
Ha. OK. So, for any commands, you'll need to use Scrape.Get, with the special header paramter exactly as I provided in the example:

Code: [Select]
Authorization: Basic YWRtaW46YWRtaW4=
The weird string is your username and password encoded in Base64. (I used this tool to convert admin:admin to B64 http://www.motobit.com/util/base64-decoder-encoder.asp)

Anyhow. Getting back to the original command: you can now use the original one with the 2 payloads so that it will be more flexible (allowing you to control different dimmable lights with one command, and different brightness values).

You lost me with the encoding bit, but it works and that's good for me. I will look at the video's to get up to speed.

Thanks so much for your help tonight...

Steve
« Last Edit: February 04, 2015, 03:57:35 PM by Stealth »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #37 on: February 04, 2015, 03:57:37 PM »
Cheers. Have fun.
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 #38 on: February 04, 2015, 05:40:49 PM »
Hopefully you caught this on your own, but when I re-posted the Dim {1} to {2} percent command with your specific IP etc. there was a typo. I've fixed the command above, but basically I had a // instead of a single / after the IP address.

It should be:
Code: [Select]
http://192.168.0.155/api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}
And not:

Code: [Select]
http://192.168.0.155//api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}
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 #39 on: February 05, 2015, 08:18:09 AM »
Hopefully you caught this on your own, but when I re-posted the Dim {1} to {2} percent command with your specific IP etc. there was a typo. I've fixed the command above, but basically I had a // instead of a single / after the IP address.

It should be:
Code: [Select]
http://192.168.0.155/api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}
And not:

Code: [Select]
http://192.168.0.155//api/callAction?deviceID={1}&amp;name=setValue&amp;arg1={2}

No I missed the
Code: [Select]
// strange thing is it worked with it as also?...

I can now dim lights and switch them on/off with feedback.  The only thing I need to resolve is the TTS.SpeakSync is saying 'Turning Test Light 1' rather than saying 'Turn Test Light On'

I'm not sure I will be able to get check status working though.

Many thanks

Steve

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #40 on: February 05, 2015, 08:40:17 AM »
Not that strange -- I just didn't want to be the one potentially breaking working commands with a typo, given that I have no way to test my guesses from here. :)

If you run out of ideas for how to get your commands working, you can post your command xml so we can see what you've tried (and ideally also the VC log so we can see what Fibaro says is happening when you run them).
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 #41 on: February 05, 2015, 08:50:41 AM »
Thanks,

The part I'm struggling with at the moment is the TTS.SpeakSync is saying 'Turning Test Light 1' rather than saying 'Turn Test Light On'.  I'm looking through videos at the moment trying to find something on

If 1 convert on On ect...  Files are attached FYI

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #42 on: February 05, 2015, 09:33:14 AM »
The part I'm struggling with at the moment is the TTS.SpeakSync is saying 'Turning Test Light 1' rather than saying 'Turn Test Light On'.

Actually, the example you need is directly in the command you're trying to fix.

Your command uses 2 payload XML files. You didn't attach those files above, but based on what you're saying I will guess that the second payload XML file has values "1"--> "On", and maybe "0" --> "Off"?

The phrases that are associated with values are your "friendly payloads".

http://voxcommando.com/mediawiki/index.php?title=Payloads#Syntax

So you want {PF.2} in your TTS actions, not {2}.

----------------------

The log that you posted does not indicate that either of these commands were issued, by the way. In the future, whenever we ask for a log please make sure you have issued the voice commands we are trying to test before uploading the log. The log can't show us anything about behaviour that hasn't occurred. ;)

... With regard to getting status from your devices. I'm not seeing any command attempts for that yet. I guess I can look at the documentation online and suggest some guesses for you to try. That will take a bit of time.

Just as an aside: I did happen to see that you're trying to use the Our Groceries commands. Those won't work until you've entered your Our Groceries login info where indicated in the "update payload XML master list" command -- your email address and password need to replace the RoboB.SetText placeholders [[your login email address]] etc. You should enter that data without any square brackets (assuming you have an OurGroceries account already set up).
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 #43 on: February 05, 2015, 09:55:43 AM »
For your light status, please try the following (hardcoded for your device with ID 25). It will probably return a bunch of information, if it works at all.

Then I'll need to make some tweaks to the command based on that information, in order to isolate just the light status for you. To do that, I'll again need the VC log after you've issued the command.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="316" name="Method 1: Get status of {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Later, you'll be changing the hard-coded device ID 25 to {1} and using a devices payload xml file with all your devices in it.">
  <action>
    <cmdType>Scrape.Get</cmdType>
    <params>
      <param>http://192.168.0.155/api/devices?id=25</param>
      <param />
      <param />
      <param />
      <param />
      <param>Authorization: Basic YWRtaW46YWRtaW4=</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Get status of device number 25</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 #44 on: February 05, 2015, 10:26:39 AM »
Thanks the TTS actions are now speaking on rather than 1. That's another one sorted.  Much appreciated...

Log File
Sorry about that I understand now..

Our Groceries
On a side issue (we can park this for now if you wish?) I have problems with the auto login of Our Groceries. I do use it but I have to manually login via the browser first.  I have again reinserted my login details as you describe but its still not working for me in the version.  If I select the option to show the browser I can see data is getting dropped into the password field and the check box for save login gets checked but nothing is going in the email field?

Status Requests
I ran the new code and I have attached the log file.

Steve