[OBSOLETE] DirecThings - Control your DirecTV receiver

If you send me one maybe I’ll look into it :stuck_out_tongue_winking_eye:

1 Like

Thanks.Once that’s fixed, I think I could then tell Alexa to set thermostat to 10 and it would change the channel. Maybe?

Yep. That’s exactly what I was doing when I ran into the bug.

Just pushed an update that should fix the issue I mentioned. I haven’t been able to test it yet though.

Unfortunately that API doesn’t appear as straightforward as DirecTV’s, not sure if it could be done in a SmartApp.

So, just tested the change and it works. Unfortunately (maybe fortunately?) Alexa will refuse to set any “temperature” outside of 40-90 degrees.

JoeBee. I just tried it and it works with a routine :slight_smile: Too bad about Alexa, Wish we could use another device. What about a security key pad?

Hey JoeBee, could you tweak your code a bit? I found a small flaw. When I run this smart app as a routine it works fine, except if it thinks its already on that channel then it won’t change the channel. For example, my routine is to change the channel to 10 at a set time. Which it does. Then during the day I’m watching tv using my remote to change channels. The next morning when the routine runs, it thinks its still on channel 10 when it’s not. At this point it won’t change the channel.Can you fix this?

I’m not really sure why that’s happening actually. The logic has no way to check what channel the receiver is on and will always attempt to tune the channel.

Could you get the logs for the SmartApp for one of the times it didn’t tune?

It’s not checking to see what station the receiver is at, it’s looking at the last station the smartapp is on. So if the smartapp is at 10 already , it’s not changing the channel even though the receiver is actually at another station.

From the log

Smart app;
‎10‎:‎10‎:‎58‎ ‎AM: debug evaluate(82, 67, 10.0

11814eb7-4c06-4c63-90a7-6950b188be05 ‎10‎:‎10‎:‎58‎ ‎AM: debug setCoolingSetpoint(10.0)

Routine: ‎10‎:‎10‎:‎57‎ ‎AM: info HH execute(true, null, null), newMode: null

The interesting thing is on the notification tab within the app under messages it says “I confirmed that the thermostat is already set according to your preferences”

Okay, so I think I have a solution. I’ve updated the SmartApp to do the following whenever the thermostat changes:

  1. Ignore any setpoints that contain “.1”
  2. Change the channel to the setpoint. Only using whole numbers.
  3. Set the thermostat setpoint to the channel number + 0.1

I haven’t tested it yet, if you do please let me know how it goes.

Thanks for trying but the smartapp doesn’t work at all now.

From log:
6:53:42 AM: error groovy.lang.MissingPropertyException: No such property: temperatureStr for class: script1472727222780864580419 @ line 116

Also you still have the code as v0.2

Give it another whirl. just pushed an update.

That did it! Works perfectly. Thanks, appreciate your time on this.


Could a Virtual Dimmer Switch handle the channel switching?

It’s possible. The documentation states that it’s “usually 0-100” for the light level value.

Honestly they just need to support a TV capability, or something that has the notion of a channel. Looks like maybe at one point they did but I can’t find that in any of the documentation.

Hey all, just pushed an update that is capable of changing the state of the virtual switch in response to the state of the receiver. As I’ve just started using it myself, there may be bugs.

1 Like

Thanks a lot for this! Is there a repo we can pull it from to easily update it later?

Not at the moment, no.

I’m currently working on creating a device type instead of a SmartApp, so far it is working much better.

Thanks! Will look forward to it.