Page 1 of 1

RESOLVED: Can't add a command

PostPosted: Sat Dec 15, 2018 1:10 pm
by colovin
Hi, this looks interesting. I'm able to discover my Broadlink Device and it is able to capture the command. When I go to add the command it errors out. Here is what I'm getting on the log.
Traceback (most recent call last):
File "plugin.py", line 120, in _get_saved_IR_commands_list
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
ValueError: No JSON object could be decoded

I'm sure it's operator error :-) not sure what I'm doing wrong.

Re: Can't add a command

PostPosted: Sun Dec 16, 2018 6:27 am
by Ksullivan
Hi
I had the same issue but when I did the latest Indigo update it righted itself.
Perhaps run the indigo installer again.

Keith


Sent from my iPad using Tapatalk

Re: Can't add a command

PostPosted: Sun Dec 16, 2018 11:05 am
by colovin
I've got the latest Indigo release but it doesn't play nice with the old AirFoil plugin which I use a lot. I've never been able to figure out AirFoil Pro, so until I do I'm stuck on 7.1.1.

Re: Can't add a command

PostPosted: Mon Dec 17, 2018 9:13 pm
by rapamatic
I'm getting the same error message on the latest release of Indigo trying to learn commands with a Mini 3... is there some dependency I need installed or something else to try?

Re: Can't add a command

PostPosted: Thu Jan 03, 2019 2:00 pm
by rapamatic
Ok, got this working. The issue seems to be the plugin returns an error when there are no saved commands for a device. The relevant section of code is below. Without doing too much troubleshooting, my guess is that dev.pluginProps["commands"] is a property of the device, but with a blank string or something like that, so json.loads returns an error.

Code: Select all
   def _get_saved_IR_commands_list(self, dev_filter, values, type_id, did):
         """ Devices.xml Callback Method to return saved commands for this device. """
         dev = indigo.devices[did]
         if "commands" not in dev.pluginProps:
             return [("none", "- none -")]
         return json.loads(dev.pluginProps["commands"])


To get around this issue, the following steps work:

1) delete the old Universal Remote Device
2) Create new device
3) Hit the discover button to find the device
4) enter some nonsense temp IR command - give it whatever name/raw command you want
5) hit add command
6) save

That seems to work fine, and then you can go about learning new real commands after that (and then can delete the temp command)...

Re: Can't add a command

PostPosted: Thu Jan 03, 2019 5:41 pm
by colovin
It took a little fiddling but yes, if is finally working great. I followed the steps that were outlined and was getting the same error codes. I'm not exactly sure what I did, but after doing it a few times it finally took and has been working like a champ since. I think you need to reload the plugin after every attempt. First I just typed gibberish into the raw command line and named it test. I couldn't get it to save to the command window. Then I did a learn command and saved the text of the raw command. Reloaded the plugin, started all over with a new device and put the actual command in the raw command window and it saved to the command window.

It's nice to have Indigo control instead of using the app. Also I've setup some scripts, saved as apps, that I can run from my desktop. Very neat, thanks for discovering the fix.

Re: Can't add a command

PostPosted: Sat Jan 05, 2019 4:53 pm
by TwitchCaptain
I'll see if I can find this bug and squash it. Thanks for the reports!

Re: Can't add a command

PostPosted: Sat Jan 05, 2019 10:27 pm
by TwitchCaptain
This should fix it. https://github.com/davidnewhall/indigo-broadlink/pull/6 - if anyone can test that would be sweet.

I'll release a new version later this week.

Re: Can't add a command

PostPosted: Mon Jan 07, 2019 10:36 am
by rapamatic
This update seems to have fixed that bug. Working fine for me now. Thanks!


Sent from my iPad using Tapatalk