Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amazon Echo Hue Simulator Driver
#21
If I setup a device as a dimmer, can I still say "Alexa, turn on Office lights". Or do I need to say "Alex, set office lights to 100%"?

Any ideas on also having a mix so that I can use the On command vs setting a dim level? Many of my lights have a setting for their OnLevel that is less than 100%. I'd like to be able to say both "Alexa, turn on office lights" (Send On command) and "Alexa, set office lights to 50%" (Send 50% to dim level). Can I do that?
Reply
#22
If you set an onvalue and offvalue on a dimmer you can do both. So for example:

Code:
<Device>
   <Name>MyDimmer</Name>
   <Type>Dim</Type>
   <Moniker>MyLights</Moniker>
   <Field>fieldname</Field>
   <OnValue>100</OnValue>
   <OffValue>0</OffValue>
</Device>
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#23
OK, I'll do that. I was just hoping that I wouldn't have to duplicate it. Think I'll write up a quick powershell script to query the nodes on my ISY and get each one's On value and then re-generate my EchoConfig.xml.
Reply
#24
wuench Wrote:Here is triggered action example that will split the values for TV event and run two global actions to actually turn on/off the TV. Just create a triggered event with Is User Action From <EchoDriver>.

Code:
// --------------------------------------------
// Parse Name,Command,Value
// --------------------------------------------
TrigEvent::GetUserActionVals(LVar:Type, LVar:Data)
System::GetNthToken(%(LVar:Data), ,, 1, LVar:Name)
System::GetNthToken(%(LVar:Data), ,, 2, LVar:Cmd)
System::GetNthToken(%(LVar:Data), ,, 3, LVar:Value)

// --------------------------------------------
// TV
// --------------------------------------------
If System::Equals(%(LVar:Name), TV, No Case)
   If System::Equals(%(LVar:Value), true, No Case)
      // Turn On TV
      System::DoGlobalAct(\\User\\TV_On)
   Else
      // Turn Off TV
      System::DoGlobalAct(\\User\\TV_Off)
   End
End

Weunch, I'm been playing with your driver today. I am trying to duplicate your trigered event above. Here is what I have:

TrigEvent::GetUserActionVals
P1=LVar:Type
P2=LVarBig Grinata

System::GetNthToken
P1=%(LVarBig Grinata)
P2=,
P3=1
P4=LVar:Name

System::GetNthToken
P1=%(LVarBig Grinata)
P2=,
P3=2
P4=LVar:Cmd

System::GetNthToken
P1=%(LVarBig Grinata)
P2=,
P3=3
P4=LVar:Value

// ////////////////////////////////////
// TV
// ////////////////////////////////////
If System::Equals
P1=%(LVar:Name)
P2=TV
P3=No Case

If System::Equals
P1=%(LVar:Value)

P2=true
P3=No Case

System:Big GrinoGlobalAct
P1=\\User\\AVOnTV
P2=

Else
System:Big GrinoGlobalAct
P1=\\User\\AVOffTv
P2=

End
End

However whether I tell Alexa to turn the TV on or off, it only turns it off. Doesn't matter if tv starts is currently on or off, it will only run the off global event.

Can you see where my event is wrong?
Thanks
George M
Reply
#25
It looks ok to me. That example is the same one I use in my config. You may want to add some system:log commands in there to see what values you are getting back and what is happening.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#26
George M: Did you get the triggered event to work? I have almost the same issue that you have. Mine turns on with "Alexa TV On", but won't turn off with "Alexa TV Off".

Since this is my first user action thingy, I don't have much of a clue on what I'm doing. So very much interested on what might be the solution in the code.
Reply
#27
Oh, I see the issue now. In your 2nd, 3rd lines you are using %(LVar:xxx) instead of LVar:xxx.

For variable assignment you need to use the name which is w/o the percent/parens. For compares and other stuff you need the value which is with the percent/parens.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#28
wuench Wrote:Oh, I see the issue now. In your 2nd, 3rd lines you are using %(LVar:xxx) instead of LVar:xxx.

For variable assignment you need to use the name which is w/o the percent/parens. For compares and other stuff you need the value which is with the percent/parens.

You just went over my head. Is it in the area of getting the tokens or in the area of commands?

When I look at the driver under last commands, the info seems correct.

"TV, on, true" and TV on, false"
Thanks
George M
Reply
#29
George M Wrote:You just went over my head. Is it in the area of getting the tokens or in the area of commands?

When I look at the driver under last commands, the info seems correct.

"TV, on, true" and TV on, false"

Nevermind. I was reading it wrong. You might want to copy/paste actions from the summary screen, it makes it a lot easier to read. I really wish copy/paste from inside the action didn't do that crazy formatting.

What does your XML file entry look like?
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#30
George M Wrote:You just went over my head. Is it in the area of getting the tokens or in the area of commands?

When I look at the driver under last commands, the info seems correct.

"TV, on, true" and TV on, false"

I had an error in the nested IF statements, so now mine works with the syntax as originally posted by Wuench. Mine is below but the sprinkler global action is just a dummy one for now (as I had it coded already and the relay switch is across the room).

TrigEvent::GetUserActionVals(LVar:Type, LVarBig Grinata)
System::GetNthToken(%(LVarBig Grinata), ,, 1, LVar:Name)
System::GetNthToken(%(LVarBig Grinata), ,, 2, LVar:Cmd)
System::GetNthToken(%(LVarBig Grinata), ,, 3, LVar:Value)
If System::Equals(%(LVar:Name), TV, No Case)
If System::Equals(%(LVar:Value), true, No Case)
System:Big GrinoGlobalAct(\\User\\SprinklerOn, )
Else
System:Big GrinoGlobalAct(\\User\\SprinklerOff, )
End
End
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  RunTimer2 driver rbroders 18 6,019 Yesterday, 04:38 PM
Last Post: rbroders
  Writing Driver - Varying commands based on checksum gReatAutomation 3 307 07-22-2019, 01:08 PM
Last Post: Dean Roddey
  Samsung HLxxA750 DLP Beta Driver jrunde 37 19,627 07-19-2019, 01:24 PM
Last Post: gReatAutomation
  New Driver - How hard would this be? kblagron 4 860 05-20-2019, 11:28 AM
Last Post: zaccari
  Cytech Comfort Driver znelbok 6 788 04-10-2019, 05:39 PM
Last Post: znelbok
  OpenHAB Driver whozeawhat 6 2,627 01-16-2019, 06:45 AM
Last Post: greymatter
  LIFX Driver bobskie708 14 4,373 01-10-2019, 06:36 PM
Last Post: Dean Roddey
  XBMC Driver wuench 428 190,924 12-28-2018, 11:07 AM
Last Post: dogman
  Driver for Bigass Fan lleo 7 1,190 11-25-2018, 08:57 AM
Last Post: Dean Roddey
  Generic Modbus Driver - Serial & IP znelbok 25 15,151 10-09-2018, 08:59 AM
Last Post: Ron Haley

Forum Jump:


Users browsing this thread: 1 Guest(s)