Custom component: Just Add Power HD over IP

Ok, so we are getting something back from the switch, which is a good start. Things go wrong when we try to contact the receivers. First up, remove those IP addresses you’ve got in against them. They can’t all be the same IP. The component should be able to get everything it needs address-wise from the switch.

Next edit the component source, line 137 and change it from

self._trace = False

to

self._trace = True

Restart and grab the log again and send it through again.

1 Like

Thanks. I don’t see a self.trace statement anywhere.

It will be later today before I get a proper look at this.

I had run a version without the IP addresses for the Rx but will try again.

FYI the documentation states IP of the switch. I assume it should be IP of the Rx?

There is definitely no self.trace statement in for config file

When removing the IP address parameter for the Rx it reverts back to time-outs for each rx:
2022-11-11 13:20:14.411 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: connection timed out
2022-11-11 13:20:14.741 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx2: connection timed out
2022-11-11 13:20:14.954 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx3: connection timed out
2022-11-11 13:20:15.167 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx4: connection timed out
2022-11-11 13:20:15.370 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx5: connection timed out
2022-11-11 13:20:15.574 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx6: connection timed out
2022-11-11 13:20:15.780 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx7: connection timed out
2022-11-11 13:20:15.989 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx8: connection timed out
2022-11-11 13:20:22.347 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform justaddpower is taking over 10 seconds.

The self._trace bit is in the component code, media_player.py. I’m trying to see what the switch has given us back.

When you use JADConfig, it usually will give IP addresses to the receivers with a specific pattern. If this hasn’t happened for some reason, you can set the IP address of each receiver in the config. Maybe manually set the IP for each receiver if you know what they are and see if that works. The error you are getting is because the IP address the component is guessing isn’t responding.

I’ve set the self.trace = True

The Rx IP addresses are as per the Rx_subnet parameter 192.168.100.0. I’ve added them specifically to each Rx as follows: Rx 1 192.160.0.100 to Rx 8 192.168.100.137.

Here’s the log:
2022-11-14 14:14:37.629 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration justaddpower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-11-14 14:15:53.825 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /supervisor/options request
2022-11-14 14:16:27.233 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx1 - Family Room
2022-11-14 14:16:27.234 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: getting switch configuration
2022-11-14 14:16:27.358 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: send switch command [show vlan\n]
2022-11-14 14:16:27.359 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.0.13: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:27.359 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.0.13: creating new connection
2022-11-14 14:16:29.094 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: command call took 1.857060 seconds
2022-11-14 14:16:29.125 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: response data is [b’show vlan\r\n\rCreated by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN\r\n\r\nVlan Name Tagged Ports UnTagged Ports Created by \r\n---- ----------------- ------------------ ------------------ ---------------- \r\n 1 1 Po1-8 V \r\n 2 CONTROL gi1,gi21-28 S \r\n 10 JAP_9x10 gi2-20 S \r\n 11 TRANSMITTER_1 gi2,gi13-20 S \r\n 12 TRANSMITTER_2 gi3,gi11-12 S \r\n 13 TRANSMITTER_3 gi4 S \r\n 14 TRANSMITTER_4 gi5 S \r\n 15 TRANSMITTER_5 gi6 S \r\n 16 TRANSMITTER_6 gi7 S \r\n 17 TRANSMITTER_7 gi8 S \r\n 18 TRANSMITTER_8 gi9 S \r\n 19 TRANSMITTER_9 gi10 S \r\n\r\nswitch4d5534#’]
2022-11-14 14:16:29.126 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: received response [b’show vlan\r\n\rCreated by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN\r\n\r\nVlan Name Tagged Ports UnTagged Ports Created by \r\n---- ----------------- ------------------ ------------------ ---------------- \r\n 1 1 Po1-8 V \r\n 2 CONTROL gi1,gi21-28 S \r\n 10 JAP_9x10 gi2-20 S \r\n 11 TRANSMITTER_1 gi2,gi13-20 S \r\n 12 TRANSMITTER_2 gi3,gi11-12 S \r\n 13 TRANSMITTER_3 gi4 S \r\n 14 TRANSMITTER_4 gi5 S \r\n 15 TRANSMITTER_5 gi6 S \r\n 16 TRANSMITTER_6 gi7 S \r\n 17 TRANSMITTER_7 gi8 S \r\n 18 TRANSMITTER_8 gi9 S \r\n 19 TRANSMITTER_9 gi10 S \r\n\r\nswitch4d5534#’]
2022-11-14 14:16:29.127 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Configured for Tx: 9, Rx: 10
2022-11-14 14:16:29.147 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [1] [[2, 13, 14, 15, 16, 17, 18, 19, 20]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [2] [[3, 11, 12]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [3] [[4]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [4] [[5]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [5] [[6]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [6] [[7]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [7] [[8]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [8] [[9]]
2022-11-14 14:16:29.148 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Split data: [9] [[10]]
2022-11-14 14:16:29.149 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:29.149 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.130: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:29.149 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.130: creating new connection
2022-11-14 14:16:29.365 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx1: connection timed out
2022-11-14 14:16:29.615 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx2 - Kitchen
2022-11-14 14:16:29.615 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx2: using cached switch configuration
2022-11-14 14:16:29.616 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:29.616 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.131: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:29.617 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.131: creating new connection
2022-11-14 14:16:29.851 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx2: connection timed out
2022-11-14 14:16:29.851 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx3 - Living Room
2022-11-14 14:16:29.852 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx3: using cached switch configuration
2022-11-14 14:16:29.852 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:29.853 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.132: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:29.853 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.132: creating new connection
2022-11-14 14:16:30.080 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx3: connection timed out
2022-11-14 14:16:30.081 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx4 - Master Bedroom
2022-11-14 14:16:30.082 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx4: using cached switch configuration
2022-11-14 14:16:30.082 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:30.082 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.133: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:30.083 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.133: creating new connection
2022-11-14 14:16:30.291 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx4: connection timed out
2022-11-14 14:16:30.293 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx5 - Play Room
2022-11-14 14:16:30.294 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx5: using cached switch configuration
2022-11-14 14:16:30.294 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:30.294 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.134: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:30.294 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.134: creating new connection
2022-11-14 14:16:30.511 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx5: connection timed out
2022-11-14 14:16:30.512 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx6 - Joseph’s Bedroom
2022-11-14 14:16:30.512 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx6: using cached switch configuration
2022-11-14 14:16:30.512 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:30.517 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.135: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:30.542 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.135: creating new connection
2022-11-14 14:16:30.747 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx6: connection timed out
2022-11-14 14:16:30.749 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx7 - Milly’s Bedroom
2022-11-14 14:16:30.750 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx7: using cached switch configuration
2022-11-14 14:16:30.750 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:30.750 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.136: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:30.750 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.136: creating new connection
2022-11-14 14:16:30.983 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx7: connection timed out
2022-11-14 14:16:30.984 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] Adding Rx8 - Lucas’s Bedroom
2022-11-14 14:16:30.985 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx8: using cached switch configuration
2022-11-14 14:16:30.990 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] Rx list: [{3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 1: 2, 2: 2}]
2022-11-14 14:16:31.012 DEBUG (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.137: connection attempt returned [‘NoneType’ object has no attribute ‘recv’]
2022-11-14 14:16:31.013 INFO (SyncWorker_2) [custom_components.justaddpower.media_player] 192.168.100.137: creating new connection
2022-11-14 14:16:31.215 WARNING (SyncWorker_2) [custom_components.justaddpower.media_player] Rx8: connection timed out

Seeing from the log that the switch is accessible and the Rx connections time out - I’ve just thought of something basic with regard to my network setup. I’m running HA on a VM on a Windows 10 laptop. The static IP address for the VM is 192.168.0.x. The IP address for the JAD switch is 192.168.0.y. However, the Rxs are on a different subnet: 192.168.100.z.
I changed the VM so it has access to the Rx subnet - and success!
The Rx are all showing as read only entities but when I access the entities the Tx sources appear as a drop down list under the Info tab. Selecting different sources switches as expected.

Thanks for your patience - although the issue was with my network setup your assistance on adding the debug information helped fix the problem.

I now need to figure out the best card to use to display the receivers and allow the switching within HA.

Thank you so much for your help.

Great stuff. Thanks for letting me know. If you find a better card than the default, let me know. The “new” card isn’t near as good as the old one for this stuff.

1 Like