We have moved at community.getvera.com

Author Topic: VoxCommando - Control Vera by Voice  (Read 24275 times)

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: VoxCommando - Control Vera by Voice
« Reply #15 on: February 27, 2014, 07:06:10 pm »
Thanks @Agile

Are you suggesting something like this.

Command, using Raw 

data_request?id=lu_action&output_format=json&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&DeviceNum={1}&action=SetCurrentSetpoint&NewCurrentSetpoint={2}

And then adding the following.

Phrase = turn
Xml = Vera1/devices.xml,
Phrase = to
Payload range = 15,16,17,18,19,20,21,22
Phrase = degrees

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #16 on: February 27, 2014, 07:19:34 pm »
Parkerc,
this is what I am doing, same as you but you can do a range with your payload vs listing it all out (personal preference):

Code: [Select]
           <cmdType>Vera.Raw</cmdType>
                <cmdString>data_request?id=lu_action&amp;DeviceNum=18&amp;serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Heat&amp;action=SetCurrentSetpoint&amp;NewCurrentSetpoint={1}</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.Speak</cmdType>
                <cmdString>Temperature has been adjusted to {1} degrees</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Set Heat, Set Temperature, adjust heat, adjust temperature</phrase>
            <payloadRange>0,100</payloadRange>


Using Vera Raw like you stated (but I just put the therm device # in there versus using a payload since I only have 1)

And create one payload as a range and do 0,100 vs listing them out (I am US, so its for F)

As you can see, I also have it doing voice back to me confirming my changes


Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: VoxCommando - Control Vera by Voice
« Reply #17 on: February 27, 2014, 07:32:57 pm »
Thanks Wayne

What's interesting (if I have understood what you've done in your command correctly) is that you are saying via TTS the temperature you've requested, however that's  not actually confirmation that it's changed. (It might not go through ?

Have your thought of a way in which you can make it wait and check if the new set point has been accepted - and then tell you ?

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #18 on: February 28, 2014, 09:16:01 am »
Vera.Get.Temperature will return the current temperature.  I don't think it will return the setpoint.  I have only tested it with my 3-in-one and 4-in-one sensors.  With an HVAC it may also work, but I imagine it would return the room temperature, and not the setpoint temp.

You could probably use a raw command to query Vera on the setpoint temperature.  You might need to wait a short time after setting it, before checking its value.

You should also be able to use events to be alerted to a new setpoint temp.  I don't have an HVAC Zwave device here to test with, but in VC 1.188 you can customize events to some extent in the plugin settings.  This is a new feature that has not yet been documented.

I am open to adding new Vera actions in VC for getting and settings variables so that you don't need to use raw actions.  If someone could itemize the actions they would like to have and provide the appropriate raw codes I will be happy to create these "convenience" actions to the next release of the Vera plugin for VC.

I can see that we need an action to set the HVAC set-point temp and one to read it.  Anything else?
« Last Edit: February 28, 2014, 09:29:13 am by jitterjames »

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #19 on: February 28, 2014, 10:41:53 am »
I may not have looked hard enough, but I have a lot of PLEG conditions that I have notifications sent from. Is there a way to have these notifications polled by Vera so that I can create actions on them?

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #20 on: February 28, 2014, 11:10:02 am »
Hi waynehead99

I'm not sure if this question is directed at me but is that is the case, I must say I don't really understand what you are asking.  First of all I'm not familiar with the PLEG plugin (assuming that's what you are referring to), nor do I know if Vera can poll these conditions.  I don't see what it has to do with VoxCommando, but you are mentioning "actions" which is a VC term so I am thinking that you are probably asking something about VoxCommando.

If this is a question for me, please clarify it for me with the understanding that I'm not familiar with "PLEG".

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: VoxCommando - Control Vera by Voice
« Reply #21 on: February 28, 2014, 11:34:37 am »
@Waynehead99 I think the current VoxCommando plugin aren't setting/querying the TemperatureSetpoint1_Cool or TemperatureSetpoint1_Heat...so you would need to do this with the VoXCommando Vera.Raw command and write your own logic...or perhaps this support will be added in the future like getting the thermostat temperature (not cool or heat set point).

From Rex's Sample Code, here are the key items:
http://forum.micasaverde.com/index.php/topic,18679.msg152234.html#msg152234

Thermostat
Set ModeTarget, read ModeStatus. "Off", "HeatOn", "CoolOn", "AutoChangeOver".

Code: [Select]
local mode = luup.variable_get("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "ModeStatus", dID)

luup.call_action("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "SetModeTarget", {NewModeTarget = "Off"}, dID)

Set and read CurrentSetpoint. (Degrees)

Code: [Select]
local setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "CurrentSetpoint", dID)

luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint", {NewCurrentSetpoint = "25"}, dID)

local setpoint = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "CurrentSetpoint", dID)

luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "SetCurrentSetpoint", {NewCurrentSetpoint = "30"}, dID)
« Last Edit: March 01, 2014, 01:59:30 pm by AgileHumor »
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: VoxCommando - Control Vera by Voice
« Reply #22 on: February 28, 2014, 11:54:23 am »
HAL Version 1 ...  used Microsoft Speech engine ... It interrogated Vera to see what devices were available ... and built the grammar dynamically.

The HAlServer was like VoxCommando ... I actually had two remote microphone clients ... one for windows and one for android. Of course the WIndows one could be on the same machine as the server ... but did not have to be.

The voice recognition was better with the Android client than a local microphone on windows ... because of the digital signal processing in the phones to eliminate background noise.

I no longer support it ... I now use Voice Recognition on my Android phone directly (New HAL Version II)

If you want to get some ideas check out the old Website is:
http://rts-services.com/HalServer

To see the type of grammar see:
http://rts-services.com/HalServer/Help.html

An example generated grammar file is at:
http://rts-services.com/HalServer/Test.grxml

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #23 on: February 28, 2014, 02:11:31 pm »
PLEG is Program Event Logic Generator used to perform advanced scenes on Vera, however it won'to come into play with what he is asking.
http://forum.micasaverde.com/index.php/board,48.0.html
I was responding to waynehead99 who was specifically asking about PLEG so obivously he thinks that it comes into play but I don't understand in what way he thinks it relates to VoxCommando.  But maybe his question was not about VoxCommando.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: VoxCommando - Control Vera by Voice
« Reply #24 on: February 28, 2014, 03:03:54 pm »
Hi @jitterjames

Thanks for agreeing to look into adding some more device type functionality e.g HVAC on a future release.

Can we help you create a default set of commands too to maybe help others who enable the plugin? Just a few basic default ones for Dimming and On/Off could be good


Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #25 on: February 28, 2014, 04:05:27 pm »
Thanks very much for the offer but I think this should be pretty straightforward for us to do ourselves.  I already have these commands made, it is just a question of organizing them into a default configuration and including them in the installer, which I will do.  I have been spending most of my time on a beta release of VC 2.0 or I probably would have done this already.

What would probably help though, is if I proposed a standard set of "starter" commands and could get some feedback from all of you.  I think that what AgileHumor has already done is probably pretty close to what I would do for the basic commands.

At some point I will also create a tutorial showing basic setup for newbies and some details on customizing the events in the plugin etc.

I am certainly interested in continuing to add to the functionality of the plugin and am pleased to see interest growing in this community. It is a great motivator for me.

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #26 on: February 28, 2014, 04:14:39 pm »
James

I brought up pleg to confuse you. Sorry about that. Basically what I am asking is that Vera can do notifications and send those out via text or email or another plug in. In either case there is a notification being triggered and that's what I am curious if it can be polled. So we can see events in Vc from Vera and trigger actions based on those. I would like to be able to trigger events based of notifications the same way. So I have a condition to let me know my garage door is open after a certain period and it sends me a push thru Vera. I want to poll that notification in Vc and create a tts action.

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #27 on: February 28, 2014, 04:34:30 pm »
Well it worked!   :P

I don't know of any way to poll Vera to see what email notifications it is sending.

I do know how to recognize events generated by Vera when device or scene states change (or is it status? I can't keep those straight)

I do know that you can send messages to VoxCommando using UDP, TCP, or HTTP messages.  To send a message to VC using luup code is quite easy, so if you were creating your own scene in Vera you could send a message to VoxCommando.

I believe you can also send messages to VoxCommando using the Vera alerts plugin for Vera.  But unless PLEG allows you to customize how or where notifications are sent so that you can redirect them to something other than an email I don't see how you can use that.

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #28 on: February 28, 2014, 04:36:37 pm »
So I have a condition to let me know my garage door is open after a certain period and it sends me a push thru Vera.

How are you currently doing this?

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #29 on: February 28, 2014, 04:40:21 pm »
I have a scene triggered that has a notification attached to it. I use Vera alerts to send a push to my phone.

I would need to look at the logs to see what is writin when a notification is triggered that may help but my coding skillz consist of knowing binary contains 0 and 1 and not much more. So I may be asking for something that can't be done.