Home Assistant can't connect to SPC Gateway

SPC Web Gateway support issues
Post Reply
markusla
Posts: 4
Joined: Sat 04 Aug 2018, 23:34

Home Assistant can't connect to SPC Gateway

Post by markusla » Sun 05 Aug 2018, 12:45

Hi Gol,
I'm trying to get Home Assistant to talk to my SPC Gateway that I've had inactive for a loooong time (4 years).
The gateway itself works, but might need to be updated. I'm still running version 1.1

The following components and platforms could not be set up:
spc
Please check your config.

The HA config looks like this;

Code: Select all

# SPC Gateway
spc:
  api_url: http://192.168.0.109:8088
  ws_url: ws://192.168.0.109:8088
SPC Gateway Config

Code: Select all

<config>
   <enable_get_auth>no</enable_get_auth>
   <enable_put_auth>no</enable_put_auth>
   <enable_ws_auth>no</enable_ws_auth>
   <enable_edp_encryption>no</enable_edp_encryption>
   <enable_ssl_encryption>no</enable_ssl_encryption>
   <access_control_list>-0.0.0.0/0,+192.168.0.0/24,+188.121.67.0/24</access_control_list>
   <http_port>8088</http_port>
   <tcp_port>16000</tcp_port>
   <spc_id>1000</spc_id>
   <gateway_id>1100</gateway_id>
   <spc_time_diff>0</spc_time_diff>
   <spc_dst>yes</spc_dst>
</config>
If i logon to the SPC Gateway via a browser, I'm able to get status of the alarm so that connection is working and is shown as correct inside the SPC Control Panel too.

Any ideas? Maybe worth with a upgrade to the latest version first? Where can I find that one? :)

markusla
Posts: 4
Joined: Sat 04 Aug 2018, 23:34

Re: Home Assistant can't connect to SPC Gateway

Post by markusla » Sun 05 Aug 2018, 13:01

Adding a little bit more info in case that helps,

Home Assistant Debug log;

Code: Select all

markus@ha01:/home/homeassistant$ sudo journalctl -f -u home-assistant@homeassistant | grep -i 'spc'
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 INFO (MainThread) [homeassistant.loader] Loaded spc from homeassistant.components.spc
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 INFO (MainThread) [homeassistant.setup] Setting up spc
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 DEBUG (MainThread) [homeassistant.components.spc] Attempting to retrieve SPC data from http://192.168.0.109:8088/spc/zone
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 DEBUG (MainThread) [homeassistant.components.spc] Data from SPC: {'status': 'success', 'data': {'zone': [{'id': '9', 'type': '1', 'zone_name': 'Entry Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '10', 'type': '0', 'zone_name': 'Livingroom Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '11', 'type': '0', 'zone_name': 'Sliding Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '12', 'type': '0', 'zone_name': 'Gym Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '13', 'type': '3', 'zone_name': 'Smoke Loft', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '14', 'type': '3', 'zone_name': 'Smoke Cinema', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '15', 'type': '0', 'zone_name': 'PIR Cinema', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '16', 'type': '0', 'zone_name': 'PIR Gym', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '17', 'type': '0', 'zone_name': 'PIR Hallway', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '18', 'type': '0', 'zone_name': 'PIR Livingroom', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '19', 'type': '3', 'zone_name': 'Smoke Washingroo', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '20', 'type': '3', 'zone_name': 'Smoke Bedroom', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}]}}
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 DEBUG (MainThread) [homeassistant.components.spc] Attempting to retrieve SPC data from http://192.168.0.109:8088/spc/area
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component spc
Aug 05 11:56:46 ha01 hass[19468]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 64, in async_setup
Aug 05 11:56:46 ha01 hass[19468]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 180, in get_areas
Aug 05 11:56:46 ha01 hass[19468]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 200, in _get_data
Aug 05 11:56:46 ha01 hass[19468]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 221, in _call_web_gateway
Aug 05 11:56:46 ha01 hass[19468]:  - [spc](https://home-assistant.io/components/spc/)
Aug 05 11:56:46 ha01 hass[19468]:  - [spc](https://home-assistant.io/components/spc/)
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: service=load_platform.binary_sensor, platform=spc, discovered=devices=[{'id': '9', 'type': '1', 'zone_name': 'Entry Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '10', 'type': '0', 'zone_name': 'Livingroom Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '11', 'type': '0', 'zone_name': 'Sliding Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '12', 'type': '0', 'zone_name': 'Gym Door', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '13', 'type': '3', 'zone_name': 'Smoke Loft', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '14', 'type': '3', 'zone_name': 'Smoke Cinema', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '15', 'type': '0', 'zone_name': 'PIR Cinema', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '16', 'type': '0', 'zone_name': 'PIR Gym', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '17', 'type': '0', 'zone_name': 'PIR Hallway', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '18', 'type': '0', 'zone_name': 'PIR Livingroom', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '19', 'type': '3', 'zone_name': 'Smoke Washingroo', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}, {'id': '20', 'type': '3', 'zone_name': 'Smoke Bedroom', 'area': '1', 'area_name': 'House', 'input': '0', 'logic_input': '0', 'status': '0', 'proc_state': '0', 'inhibit_allowed': '1', 'isolate_allowed': '1'}]>
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.spc from homeassistant.components.binary_sensor.spc
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.spc
Aug 05 11:56:48 ha01 hass[19468]:  - [spc](https://home-assistant.io/components/spc/)
Aug 05 11:56:49 ha01 hass[19468]: 2018-08-05 11:56:49 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 140394972465192: Sending {'id': 10, 'type': 'result', 'success': True, 'result': {'latitude': 0.0, 'longitude': 0.0, 'elevation': 0, 'unit_system': {'length': 'km', 'mass': 'g', 'temperature': '°C', 'volume': 'L'}, 'location_name': 'Home', 'time_zone': 'UTC', 'components': {'updater', 'automation', 'config.customize', 'websocket_api', 'binary_sensor', 'http', 'introduction', 'config.core', 'config', 'conversation', 'script', 'sensor', 'cloud', 'config.group', 'onboarding', 'frontend', 'logbook', 'api', 'tts', 'recorder', 'logger', 'config.script', 'auth', 'group', 'binary_sensor.spc', 'system_log', 'discovery', 'device_tracker', 'config.entity_registry', 'history', 'config.config_entries', 'zone', 'config.automation', 'map', 'sun'}, 'config_dir': '/home/homeassistant/.homeassistant', 'whitelist_external_dirs': {'/home/homeassistant/.homeassistant/www'}, 'version': '0.75.1'}}
Aug 05 11:56:49 ha01 hass[19468]: 2018-08-05 11:56:49 DEBUG (SyncWorker_10) [homeassistant.util.json] JSON file not found: /srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/binary_sensor/.translations/spc.en.json
It looks like it's erroring at reading
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 DEBUG (MainThread) [homeassistant.components.spc] Attempting to retrieve SPC data from http://192.168.0.109:8088/spc/area
Aug 05 11:56:46 ha01 hass[19468]: 2018-08-05 11:56:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component spc
Aug 05 11:56:46 ha01 hass[19468]: File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 64, in async_setup
Aug 05 11:56:46 ha01 hass[19468]: File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 180, in get_areas
Aug 05 11:56:46 ha01 hass[19468]: File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 200, in _get_data
Aug 05 11:56:46 ha01 hass[19468]: File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py", line 221, in _call_web_gateway
Though if I do the same in SPC Web Gateway and asks for 'spc/area' it works;

Code: Select all

{"status":"success","data":{"area":[{"id":"1","name":"House","mode":"0","last_set_time":"1533454827","last_set_user_id":"2","last_set_user_name":"lotta","last_unset_time":"1533466863","last_unset_user_id":"2","last_unset_user_name":"lotta","last_alarm":"1529991903"},{"id":"2","name":"Garage","mode":"0"},{"id":"3","name":"Cottage","mode":"0"}]}}

markusla
Posts: 4
Joined: Sat 04 Aug 2018, 23:34

Re: Home Assistant can't connect to SPC Gateway

Post by markusla » Sun 05 Aug 2018, 13:06

Sorry Gol! It looks like it's a HA problem and not a issue with the SPC Gateway, just found this:
https://github.com/home-assistant/home- ... sues/13306

Though, it would be great to get access to the latest version anyway :)

gol
Webbplatsadministratör
Posts: 79
Joined: Sun 01 Jun 2014, 19:38

Re: Home Assistant can't connect to SPC Gateway

Post by gol » Sun 05 Aug 2018, 13:13

Hi markusla,
I have sent latest version, 1.3, of SPC Web Gateway to you by mail.
//Goran

markusla
Posts: 4
Joined: Sat 04 Aug 2018, 23:34

Re: Home Assistant can't connect to SPC Gateway

Post by markusla » Sun 05 Aug 2018, 13:27

Thanks, got it an upgraded.

For anyone else facing this problem.
Download HA 0.58 and extract to your HA computer, then replace the spc.py file with the downloaded old version.

Please note, the destination path below can be different than mine, to be sure do:

Code: Select all

locate spc.py

# Which will list you the location of spc.py files. Its the 'components/spc.py' that needs to be replaced. 
/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py
/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/alarm_control_panel/spc.py
/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/binary_sensor/spc.py
So simply do this and then restart Home Assistant, problem solved.

Code: Select all

sudo cp home-assistant-0.58/homeassistant/components/spc.py /srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/spc.py

fergalom
Posts: 15
Joined: Fri 11 Sep 2015, 09:16

Re: Home Assistant can't connect to SPC Gateway

Post by fergalom » Thu 09 Aug 2018, 11:34

Hi Markus,

Tried your solution of downloading 0.58 and replacing spc.py in the 3 locations.

I’m now seeing this in my log

Code: Select all

2018-08-09 10:56:13 WARNING (MainThread) [homeassistant.loader] You are using a custom component for switch.hadockermon 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.
2018-08-09 10:56:14 ERROR (MainThread) [homeassistant.components.spc] SPC Web Gateway returned http status 401, response .
2018-08-09 10:56:14 ERROR (MainThread) [homeassistant.components.spc] SPC Web Gateway returned http status 401, response .
2018-08-09 10:56:14 ERROR (MainThread) [homeassistant.components.spc] Failed to connect to websocket: Bad status code: 401

2018-08-09 10:56:44 ERROR (MainThread) [homeassistant.components.spc] Failed to connect to websocket: Bad status code: 401
From SPC gateway, my config.xml is: (disabled SSL - not apparent this is required on the HA component page)

Code: Select all

<config>
   <enable_get_auth>yes</enable_get_auth>
   <enable_put_auth>yes</enable_put_auth>
   <enable_ws_auth>yes</enable_ws_auth>
   <enable_edp_encryption>yes</enable_edp_encryption>
   <enable_ssl_encryption>no</enable_ssl_encryption>
   <access_control_list>-0.0.0.0/0,+192.168.1.0/24</access_control_list>
   <http_port>8088</http_port>
   <tcp_port>16000</tcp_port>
   <spc_id>1000</spc_id>
   <gateway_id>1100</gateway_id>
   <spc_time_diff>0</spc_time_diff>
   <spc_dst>yes</spc_dst>
</config>
Relevant parts of configuration.yaml

Code: Select all

#Vanderbilt SPC
spc:
  api_url: http://192.168.1.16:8088
  ws_url: ws://192.168.1.16:8088
Any thoughts?

gol
Webbplatsadministratör
Posts: 79
Joined: Sun 01 Jun 2014, 19:38

Re: Home Assistant can't connect to SPC Gateway

Post by gol » Thu 09 Aug 2018, 12:13

You also need to set all *auth to no. The HA binding is not supporting user credentials.
//Goran

fergalom
Posts: 15
Joined: Fri 11 Sep 2015, 09:16

Re: Home Assistant can't connect to SPC Gateway

Post by fergalom » Thu 09 Aug 2018, 12:55

Sorted now, thanks Gol and Markus!

Post Reply