Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Alexa.PowerController #63

Open
auchter opened this issue Jun 20, 2017 · 11 comments
Open

Alexa.PowerController #63

auchter opened this issue Jun 20, 2017 · 11 comments

Comments

@auchter
Copy link
Owner

auchter commented Jun 20, 2017

Found something interesting while issuing a "turn off" command to a media_player device that was exposed via the Video Skill API.

type object 'Alexa' has no attribute 'PowerController': AttributeError
Traceback (most recent call last):
File "/var/task/haaska.py", line 788, in event_handler
ha, event)
File "/var/task/haaska.py", line 404, in invoke
obj = make_class(allowed)(namespace, name, ha, event)
AttributeError: type object 'Alexa' has no attribute 'PowerController'

Looks like there's a new interface coming: Alexa.PowerController, with TurnOn and TurnOff methods. Couldn't find any documentation about this, though...

@auchter
Copy link
Owner Author

auchter commented Jun 20, 2017

72eb69a

That gets "turn off" and "turn on" working again for media_players

@keatontaylor
Copy link
Contributor

keatontaylor commented Jun 20, 2017

Hmm, what voice command did you actually say?

I cannot seem to duplicate this behavior. Are your media players also exposed via the Smart Home Skill as well?

@keatontaylor
Copy link
Contributor

keatontaylor commented Jun 20, 2017

Had to add Alexa.PowerController to the capabilities payload.

endpoint['capabilities'] = [
                        alexa_interface('Alexa.RemoteVideoPlayer'),
                        alexa_interface('Alexa.ChannelController'),
                        alexa_interface('Alexa.PlaybackController'),
                        alexa_interface('Alexa.PowerController')]

Also pure speculation, but I bet that in the coming weeks we'll see Amazon announce playback and power controls for some manufacturer of smart TV. So we may be getting volume controls soon too. :)

@trisk
Copy link
Contributor

trisk commented Jun 22, 2017

Looks like we also need Alexa.PercentageController for volume:

object 'Alexa' has no attribute 'PercentageController': AttributeError
Traceback (most recent call last):
File "/var/task/haaska.py", line 795, in event_handler
ha, event)
File "/var/task/haaska.py", line 411, in invoke
obj = make_class(allowed)(namespace, name, ha, event)
AttributeError: type object 'Alexa' has no attribute 'PercentageController'

@keatontaylor
Copy link
Contributor

This is awesome!

@keatontaylor
Copy link
Contributor

Looks like it is expecting something different in the response payload, as it seems to be always saying "something went wrong" when I try and issue commands. No errors in the log.

@trisk
Copy link
Contributor

trisk commented Jun 22, 2017

trisk/haaska@a91c04d makes PercentageController function on the HA service call side, but still haven't figured out the response format so I get "I'm not quite sure what went wrong" after completing the command.

@keatontaylor
Copy link
Contributor

Got another one.
Traceback (most recent call last):
File "/var/task/haaska.py", line 176, in invoke
operator.attrgetter(name)(self)()
AttributeError: 'PercentageController' object has no attribute 'AdjustPercentage'

@keatontaylor
Copy link
Contributor

@BladeRunner68
Copy link

Guys, Amazon today released a major update for their Alexa smart home API - will be interested to see how you can use this with Haaska (excellent script BTW).

Fill your boots:

https://github.com/alexa/alexa-smarthome/tree/master/sample_messages

https://developer.amazon.com/blogs/alexa/post/bd91b3e6-9799-445e-9cfc-7e3e2d78980f/alexa-delivers-rich-easy-to-use-new-features-for-smart-home-consumers-and-developers

@keatontaylor
Copy link
Contributor

Looks like they're unifying the API that they've created so far and taking steps to enhance features such as querying the state of devices, and from the sounds of it being able to trigger smart home devices via the alexa app with a graphical interface. (that would be nice)

I'm especially interested in the fact that they've broken the thermostat control away from the thermostat sensor, so we may see other "sensor" interfaces coming soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants