I’ve created a component to control a Just Add Power 2G or 3G video matrix. Allows you to define your transmitters and receivers, then use the media player component to change sources.
More detailed info on how to configure can be found in the readme in GitHub.
Hi, thanks for creating this! I have a question, when adding this to the config I am getting compilation error. What device does this go under? do I make a justaddpower: device before adding - platform?
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/justaddpower/media_player.py”, line 110, in setup_platform
transmitters, receiver_id, extra[CONF_NAME])
File “/config/custom_components/justaddpower/media_player.py”, line 140, in init
self.get_switch_config()
File “/config/custom_components/justaddpower/media_player.py”, line 216, in get_switch_config
idx = int(rx_list[self._receiver_id])
KeyError: 1
That means that we’re trying to set the switch to receiver #1 but there aren’t any receivers. Try turning on debug logging and see what that shows. E.g. add this to your configuration.xml
Hi Bertbert, I think I have the issue, hahaha I am using a Luxel switch, I have the AMS4424P switch, I see now you only support the Cisco switch, any chance you would be able to support the Luxel switch as well? I am willing to pay you if you are interested.
Thanks,
Dave
Supporting the Luxul could be tricky since I don’t own one. In fact I’d never heard of them before JustAddPower. I’m guessing they must be more of a US based supplier.
Payment, even assuming I am able to add this, wouldn’t be required. This is a hobby. And as such, I’ve only a very limited amount of time I can spend on it usually only a couple of hours at the weekend.
But I’m happy to give it a try and see how far we get. I’d need you to be able to run tests on your switch and provide me the results. A couple of warnings before we go down this path:
This could take a while with a lot of back and forth and long pauses when I’m not able to work on it
No guarantee of success at the end of it
This is a public forum, so don’t publish any passwords in anything you send me (the default admin/admin is ok). Whilst it’d be unlikely that anybody could get into your switch, if you’ve used the same password elsewhere, you don’t want to put it on here. I don’t need any of your passwords ever.
Running commands on the switch is inherently risky, particularly when I’ve never used a Luxul. There is a small chance that you’ll need to reset the switch back to its previous config should something break. And (very, very unlikely) something could brick the switch. You’d need to accept a small bit of risk here.
That said, as long as you don’t mind having to restore your config it’s unlikely we’ll run into any problems.
If you want to continue, first thing I need to see is what the vlan setup response looks like. Log onto the switch and run
show vlan
I only actually do two things with the switch, get the config using the above command and set the config when changing source. I think the trickiest bit might be to parse the output from the above command. Fingers crossed it is similar to output from the Cisco and I can reuse most of what is there.
From what I see of the Luxul, the second bit (setting the config) should be nearly identical to the Cisco with just a few tweaks needed.
Hey, I saw this thread and would also be super interested in luxul support. I understand the warnings and can reset config etc if things go wrong. I would be happy to go back and forth with you with the info you need if you’re still interested.
Just some info on how it’s currently configured. I have a Luxul 7048P switch on the latest firmware, 4.1.3. Ports 2-12 are TX, 13-36 RX.
Here’s the output of show vlan:
# show vlan
VLAN Name Interfaces
---- -------------------------------- ----------
1 default Gi 1/1,37-50
10 JAP_11x24 Gi 1/2-36
11 TX_1_gi1/2 Gi 1/2,13,15-36
12 TX_2_gi1/3 Gi 1/3,14
13 TX_3_gi1/4 Gi 1/4
14 TX_4_gi1/5 Gi 1/5
15 TX_5_gi1/6 Gi 1/6
16 TX_6_gi1/7 Gi 1/7
17 TX_7_gi1/8 Gi 1/8
18 TX_8_gi1/9 Gi 1/9
19 TX_9_gi1/10 Gi 1/10
20 TX_10_gi1/11 Gi 1/11
21 TX_11_gi1/12 Gi 1/12
Additionally, I took a look at the commands it was sending to the switch to change sources around. It sends an enable password, which I redacted, but it’s not needed anyhow, at least the way jadconfig sets up the switch.
Sorry for late reply. I only get so often to get to work on this as well. So I ran into a couple of issues. One:
Invalid config for [media_player.justaddpower]: [user] is an invalid option for [media_player.justaddpower]. Check: media_player.justaddpower->switch->user. (See ?, line ?).
But since it defaults to cisco/cisco I just figured I’d add that user/pass to the switch to at least continue testing. Then I hit this:
2019-06-25 16:33:21 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for justaddpower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-06-25 16:33:23 WARNING (SyncWorker_4) [custom_components.justaddpower.media_player] Rx1: switch connection timed out
2019-06-25 16:33:23 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform justaddpower
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/justaddpower/media_player.py", line 112, in setup_platform
transmitters, receiver_id, extra[CONF_NAME])
File "/config/custom_components/justaddpower/media_player.py", line 142, in __init__
self.get_switch_config()
File "/config/custom_components/justaddpower/media_player.py", line 250, in get_switch_config
idx = int(rx_list[self._receiver_id])
IndexError: string index out of range
edited/updated it above. Since I couldn’t seem to get python3 to run on the hass.io connection I ran it from my mac, but then I didn’t have the hostname setup right.
Ok, so either not making a connection at all, or the commands are failing. I’ve put a new version of the test script up with a couple of extra debug lines, if you could give that a go.
First off, what sort of switch are you using? The component only currently is confirmed as working with Cisco switches.
The component will show as on if it has made any sort of connection to the switch. I think you’ll need to turn on debug logging and send me the log. To switch on the logging you’ll need to make a change to your configuration file, e.g.