Tuicemen.com

Advanced search  

News:

Share your Automated House and Ideas in the Members Section! :0~

Pages: [1] 2

Author Topic: Voice Control of DIM level [implemented]  (Read 562 times)

alzy

  • Sr. Member
  • ***
  • Helpful Rating: 0
  • Offline Offline
  • Posts: 168
Voice Control of DIM level [implemented]
« on: February 09, 2017, 01:02:21 pm »

Add the ability to tell Alexa the DIM level.
« Last Edit: March 13, 2017, 04:32:16 pm by Tuicemen »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #1 on: February 09, 2017, 02:37:30 pm »

I first looked at this when initially creating Alex10.
There are a few issues here:
1: Currently the way the bridge sends program script to Alex10.
This can easily be recoded if someone wishes to undertake the process of playing and experimenting with scripts.

2: HA-Bridge is a Philips hue emulator which sends dim commands of 0-255 recently changed 1-254
This can also be over come with a math equation to convert  values  to 0-100

3:Each time the HA-Bridge changes code for dim as above may mean recoding Alex10 Bridge script writes
Not a big deal as you just wouldn't up date your copy of HA-Bridge until the math was worked out which could also mean your missing out on added options to the bridge.

These may not seem like much  to over come but I already spent several days (not just mins)finding a method (scripting) that worked with the Bridge.
For anyone wishing to experiment with scripts and the math involved to convert you can visit the HA-Bridge GitHub page and post a question if you get stuck.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

alzy

  • Sr. Member
  • ***
  • Helpful Rating: 0
  • Offline Offline
  • Posts: 168
Re: Voice Control of DIM level
« Reply #2 on: February 10, 2017, 05:36:15 am »

1. x10 commander takes a spoken DIM level in %. The bridge plunks it into a DIM url containing device, house code ,unit code, and an intensity variable (replaced with the spoken DIM level) and sends it to the x10 Commander server which issues the x10 command to the x10 controller.
Can the bridge insert the spoken DIM level into a variable in the DIM batch file via Alex10?

2. If you had someone who can't code, but could help with testing , would that make it worth looking into?

Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #3 on: February 10, 2017, 06:23:24 am »

The bridge can't take a dim value and put it into a batch file.
The Bridge uses Jason and will add a dim value in Jason to a Jason script.

Testing Alex10 code isn't the issue here Alex10 will already see a variable.
So if someone were to play with bridge scripts  to turn Alex devices on/off the dim would be easy.
I'll code Alex10 so it will throw a message when it sees the dim value (variable) if that will help.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

alzy

  • Sr. Member
  • ***
  • Helpful Rating: 0
  • Offline Offline
  • Posts: 168
Re: Voice Control of DIM level
« Reply #4 on: February 10, 2017, 07:51:59 am »

Does this link shed any light on the solution? I would help but I can't code my way out of a paper bag!
https://github.com/bwssytems/ha-bridge/issues/197
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #5 on: February 10, 2017, 08:05:51 am »

Unfortunately no, it doesn't show variables which a dim value would be.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

alzy

  • Sr. Member
  • ***
  • Helpful Rating: 0
  • Offline Offline
  • Posts: 168
Re: Voice Control of DIM level
« Reply #6 on: February 10, 2017, 08:19:24 am »

Maybe you could ask bwssystems how it might be done.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #7 on: February 10, 2017, 08:34:15 am »

This isn't on the top of things to do list.
However once the list gets smaller I'll dig into it more.
In the mean time I've added code so end users can experiment.
Once Alex10 sees a second argument it will display exactly what it sees.
That way end users can report back and the correct code can be created to handle it.
I'll have that update shortly on the server. (Chr)

Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

alzy

  • Sr. Member
  • ***
  • Helpful Rating: 0
  • Offline Offline
  • Posts: 168
Re: Voice Control of DIM level
« Reply #8 on: February 10, 2017, 08:43:07 am »

Great! Thanks.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #9 on: February 13, 2017, 10:34:35 am »

I had a bit of time this morning to look over this.
And I can say I've made a bit of progress!  :0~ I can dim from the bridge with a script. ~:0~
Not brighten  :(
Once dimmed you have to turn completely off then you can turn on and dim again.
I still have lots to experiment with but it is looking promising.
When I have some more free time I'll do more
(Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #10 on: February 19, 2017, 02:41:39 pm »

Some of my best ideas come while I'm sleeping however it is remembering them once I wake up. :-[
While waiting on some new softstart modules I've been mulling over how to do a dim and bright function from a single call from the bridge.
Doing some math conversions and small equations, I think I just might have this figured out ??? ::) :`) There is a bit of code to add for this and it may not be 100% accurate but if Alex10 is left running you should be able to call both a dim and bright. 8)
I'll keep everyone updated how this idea is progressing in this thread. :)!
 
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #11 on: February 21, 2017, 04:08:39 pm »

Ok a bit of progress here.
Thought not what I was expecting! :-[

Alexa, brighten <Device Name> to <Position> -doesn't work(for me)
Alexa, brighten <Device Name> -doesn't work (for me)

Alexa, set <Device Name> to <Position> -Sometimes work(for me)
Alexa, dim <Device Name> -sometimes works(for me)
Alexa, dim <Device Name> to <Position>% -works Most times (for me)
Alexa <Device name> <position>% -works 99% of the time (for me)

 The word set makes Alexa look for a skill 90% of the time (for me)
 The word brighten Alexa just refuses to hear (for me)
Results may vary per user what doesn't work for me may work for you. ::) :`)

Here's how it works:
When you send a dim command Alex10 looks at the current state the bridge is seeing(reporting as seeing).
If the dim% position is lower then being reported a brighten is sent less the reported dim value.
If the dim% position reported is higher then the command a dim is sent less the reported value.

There is still a good bit of coding that needs to be done and hopefully I can improve on the overall success of the commands working ??? ::) :`)
With these code changes Alex10 no longer will write Batch files for dim commands( maybe even on/off as well)
However Alex10 will still continue to accept Batch files as triggers, and Alex10 only triggers events in a batch file it was configured (coded) to do. ;>
« Last Edit: February 22, 2017, 07:13:41 am by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #12 on: February 22, 2017, 12:43:33 pm »

looks like the more you use the dim function the less likely Alexa fails to send the command.
I still can't get her to understand the brighten command which according to the HA-Bridge read me is suppose to work :o ::) :`)
I added a auto round up of the dim values which seem to work better then just using the whole number if there were decimals.
I also added a auto sync so dim values don't get thrown off after several commands.
I'll run this for a few days now to be sure nothing strange shows up.
For now it is looking good maybe a weekend release! :)!
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #13 on: February 23, 2017, 03:00:21 pm »

Ok So my new softstart modules arrived today and things aren't working as I'd hoped (cB)
With alex10 not running only dim commands are seen and it appears it isn't seeing the % value.
I had expected it would only dim but expected it to dim by the value.
Not sure if this is just a softstart issue or is the same for non soft start just yet. (CZB)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 24
  • Offline Offline
  • Posts: 3118
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Voice Control of DIM level
« Reply #14 on: February 24, 2017, 10:08:39 am »

I think I narrowed down the issue. ??? It is looking like it was a issue with code I was using to sync the bridge dim values.
The Bridge doesn't except decimals and occasionally (in one place) that was being sent which would cause everything to get screwed up.
I just may be back on track for a weekend update release. ??? ::) :`)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!
Pages: [1] 2