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

0 Members and 1 Guest are viewing this topic.

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #60 on: February 21, 2015, 12:24:07 PM »
For those interested in using Voxcommando with the Fibaro HC2 and following this thread. 

Attached is the latest xml, now incorporating 'Scene Control'. 

Next on to temperature sensor reading and thermostat control.  I think this maybe a lot harder though!.

Commands already included in the attached xml -

1) Switch device # to level ###
2) Switch device # On/Off
3) Start scene #
4) Stop scene #
5) Get current status of device #
« Last Edit: February 22, 2015, 05:00:36 AM by Stealth »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #61 on: February 21, 2015, 03:44:27 PM »
Thanks for posting the new commands. At some point it would be good to list all of the commands that are in the command group, so that it's not a "mystery download".

re: controlling the thermostat -- I think you could try a URL that is similar to what you use to set dim levels for lights:

http://yourIPaddress/api/callAction?deviceID=7&name=setValue&arg1=39

However, instead of setValue, you should try setTargetLevel

Of course, you'd use the device ID for your thermostat and then try putting the desired temperature value after the "arg1=".

I'm basing that guess on the link you posted previously: http://www.fibarouk.co.uk/support/lua/actions-use-fibarocall-api/

If you run out of luck, they should definitely be able to help you on the Fibaro forum with those 2 commands. In VoxCommando, you can use http get, put, or post requests (http://voxcommando.com/mediawiki/index.php?title=Actions#Scrape).

« Last Edit: February 23, 2015, 02:44:05 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 #62 on: February 22, 2015, 04:51:08 AM »
Thanks nime5ter,

I can't try your syntax yet as I'm waiting for my Z-Wave thermostat to arrive.  I hope should be here within the next two weeks so I can complete the integration.  I will reportback as soon as I can.
« Last Edit: February 22, 2015, 04:12:21 PM by nime5ter »

Stealth

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 1
    • View Profile
Re: Fibaro Home Center 2
« Reply #63 on: March 05, 2015, 01:56:38 PM »
Whilst I am waiting for my Z-Wave thermostats to arrive I have hooked up some temperature sensors and I would like to ask Voxcommando to report the temperatures on command.

i.e "What is the Lounge temperature"

I am using this http command for a scrape report

http://192.168.0.155/api/devices?id={1}

{1} = Z-Wave node ID 81

This http command delivers the following dump -

{"id":81,"name":"Lounge Brass 75.5","roomID":4,"type":"com.fibaro.temperatureSensor","baseType":"com.fibaro.multilevelSensor","enabled":true,"visible":true,"isPlugin":false,"parentId":75,"remoteGatewayId":0,"interfaces":["zwave"],"properties":{"parameters":[{"id":1,"lastSetValue":0,"size":2,"value":0},{"id":2,"lastSetValue":0,"size":2,"value":0},{"id":3,"lastSetValue":1,"size":1,"value":1},{"id":4,"lastSetValue":1,"size":1,"value":1},{"id":5,"lastSetValue":255,"size":1,"value":255},{"id":6,"lastSetValue":255,"size":1,"value":255},{"id":7,"lastSetValue":255,"size":1,"value":255},{"id":8,"lastSetValue":255,"size":1,"value":255},{"id":9,"lastSetValue":0,"size":1,"value":0},{"id":10,"lastSetValue":20,"size":1,"value":20},{"id":11,"lastSetValue":200,"size":1,"value":200},{"id":12,"lastSetValue":8,"size":1,"value":8},{"id":13,"lastSetValue":0,"size":1,"value":0},{"id":14,"lastSetValue":0,"size":1,"value":0}],"associationSet":[{"devices":[],"groupID":1},{"devices":[],"groupID":2},{"devices":[1],"groupID":3}],"associationView":[{"devices":[],"groupID":1},{"devices":[],"groupID":2},
{"devices":1],"groupID":3}],"zwaveCompany":"Fibargroup","zwaveInfo":"3,3,52","zwaveVersion":"2.1","pollingTimeSec":0,"configured":"true","dead":"false",
"deviceControlType":"0","deviceIcon":"30","emailNotificationID":"0","emailNotificationType":"0","endPointId":"5","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"",
"manufacturer":"","markAsDead":"true","model":"","nodeId":"22","offset":"0.00","parametersTemplate":"85","productInfo":"1,15,5,1,16,2,2,1",
"pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","showFireAlarm":"true","showFreezeAlarm":"false",
"smsNotificationID":"0","smsNotificationType":"0","unit":"C","useTemplate":"true","userDescription":"","value":"20.00"},"actions":{"reconfigure":0},"created":1425556131,"modified":1425556131,"sortOrder":45}


I don't know how to filter out the "value":"20.00" which is the current temperature.

I believe I need to update nime5ter's previous syntax
Code: [Select]
"value":"(\w.*?)" that was used when checking if a node was on but I don't know where I can find any help documents on this.  Unfortunately videos didn't help me either. Forgive me if I'm totally off the mark with this.

Thank you in advance.

Steve


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #64 on: March 05, 2015, 02:02:30 PM »
If 20.00 is the data you want, then the syntax from earlier should work as is.

The pattern is exactly the same. "value":"(what you want)".
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 #65 on: March 05, 2015, 02:14:05 PM »
I'm obviously missing something.  Sorry to be dim

I use this syntax?

"value":"()"

What about the If statement part?


 

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #66 on: March 05, 2015, 03:12:58 PM »
You can use exactly the same regular expression action that you're already using to get the status of your light switches.

The regular expression that you already quoted above:
Code: [Select]
"value":"(\w.*?)"is what you need to use.

The result of this is stored as {Match.1}. The question is what you want to do with the information after that.

If you just want to ask VC, "What's the current temperature" and have a TTS announcement telling you the temperature, then that's all you do with it. 

1. Scrape. --> URL that you need to scrape
2. Results.Regex --> "value":"(\w.*?)"
3. TTS.Speak --> The current temperature is {Match.1} degrees Celsius.

If you want to do different things depending on what the temperature reading is, that may involve using a logic block.
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 #67 on: March 05, 2015, 03:33:10 PM »
I would just

1. Clone your "Get status of {1}" command (right-click on the command in your tree and click "clone"),

2. Edit the name of the cloned command to "Get temperature" or whatever you like

3. Delete the logic block

4. Add the TTS action
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 #68 on: March 05, 2015, 04:16:56 PM »
I would just

1. Clone your "Get status of {1}" command (right-click on the command in your tree and click "clone"),

2. Edit the name of the cloned command to "Get temperature" or whatever you like

3. Delete the logic block

4. Add the TTS action

Thanks thats just the job.  One last tweak would be good i.e. Rather that report 20.68  degrees celsius how do I tweak the syntax to only report to one decimal place i.e. 20.6 degrees celsius?


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Fibaro Home Center 2
« Reply #69 on: March 05, 2015, 04:21:41 PM »
Code: [Select]
"value":"(.*?)."
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 #70 on: March 05, 2015, 04:29:04 PM »
Code: [Select]
"value":"(.*?)."

Thats fantastic, thanks alot. 

You are great! ;)

Once I have the thermostat and have it working with Voxcommando I will upload a clean group of Fibaro xmls.

Cheers

Steve