@barry-hamilton Same problem here
Best posts made by Moacir Vilela Sêga
-
RE: Javascript error occurred in the main process
Got the same problem as you. Something broke
-
RE: Javascript error occurred in the main process
@Russ I suppose you are already working on it?
Latest posts made by Moacir Vilela Sêga
-
RE: Javascript error occurred in the main process
@Russ I suppose you are already working on it?
-
RE: Javascript error occurred in the main process
Got the same problem as you. Something broke
-
RE: Pass color and brightness parameters using TRIGGERcmd Smart Home Alexa skill
@russ I dont know what to tell you now. It is just working normally now. I didn't change neither my script nor tried to re-add the device.
I decided to test it before changing to your script and it worked. -
RE: Pass color and brightness parameters using TRIGGERcmd Smart Home Alexa skill
@russ I am using Alexa. I did a simple python script
import pyttsx3 import threading import sys from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume, IAudioEndpointVolumeCallback from comtypes import CLSCTX_ALL, COMObject from ctypes import POINTER, cast class fala: def __init__(self,msg,voice=0): threading.Thread(target=self.thread,args=(msg,voice,)).start() def thread(self,msg,voice): tts = _TTS(voice) tts.start(msg) del(tts) class _TTS: engine = None rate = None def __init__(self,voice): self.engine = pyttsx3.init() self.engine.setProperty('volume',1.0) voices = self.engine.getProperty('voices') self.engine.setProperty('voice', voices[voice].id) def start(self,text_): self.engine.say(text_) try: self.engine.runAndWait() except: fala(text_) class AudioEndpointVolumeCallback(COMObject): _com_interfaces_ = [IAudioEndpointVolumeCallback] def OnNotify(self, pNotify): print('OnNotify callback') list2 = sys.argv[1:] devices = AudioUtilities.GetSpeakers() interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None) volume = cast(interface, POINTER(IAudioEndpointVolume)) callback = AudioEndpointVolumeCallback() volume.RegisterControlChangeNotify(callback) try: if isinstance(int(sys.argv[1]),int): fala('volume definido para ' + str(int(sys.argv[1]))) volume.SetMasterVolumeLevelScalar(int(sys.argv[1])/100,None) except: fala(' '.join(list2))
So if I say a number it changes the volume, but if I say a color or "Turn on/off" it says On, Off or the Color. (Basically it tries to say it out loud if the parameter is not a number)
Now, it only works during On and Off. All the colors or the numbers are not working as valid parameters.
This is how it is coded in TriggerCMD currently:
{ "trigger": "Protocolo", "command": "python \"D:\\Programming\\Python\\teste vozes.py\"", "offCommand": "", "ground": "foreground", "voice": "Protocolo", "voiceReply": "", "allowParams": "true" }
-
RE: Pass color and brightness parameters using TRIGGERcmd Smart Home Alexa skill
Did it stop working? I used this to control my computer volume, and I think since yesterday it isnt working anymore, even after deleting the devices