When I list multiple hosts under the gc100 platform entry it fails.
When I do not include a host under the gc100 entry and try to put it in the switch/sensor configuration variables, the logs state the config needs an IP tied to the host.
Anyone know how to have more than one of these global cache units on the same HA instance?
For those that are interested…my work around is below:
A) I copied the gc100.py file and named it gc100a.py. I then edited its contents to change all gc100 code to gc100a (file is here: /srv/homeassistant/lib/python3.5/site-packages)
The only exception here is (where I left the gc100 alone):
class GC100SocketClient(object):
"""A Python client for the GC100 socket server."""
queue = queue.Queue()
subscribers = {}
_socket_recv = 1024
B) I also copied the gc100 directory and named it as gc100a (found here: /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/gc100)
I then edited all of the files within the directory anywhere gc100 was referenced to “gc100a”.
The only exceptions are:
Within manifest.json where I had to leave the following as gc100:
Within binary_sensor.py where I had to leave the following as gc100 ‘GC100BinarySensor(’:
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the GC100 devices."""
binary_sensors = []
ports = config.get(CONF_PORTS)
for port in ports:
for port_addr, port_name in port.items():
binary_sensors.append(GC100BinarySensor(
Was there ever a follow up on this and perm resolution? Googling suggests the answer is no. Even the HA docs still only represent a single entry in the config.yaml file.
I have numerous Global Cache products needing to be added… I’ll look to incorporate your workaround in parallel.
It looks like code has changed since you modified yours - roughly 2 months after. I didn’t have the file path you had and some of the coding was different.
I did read up on custom components and made a “custom_component” dir under /config. I grabbed the files from the GC100 Git. I presume the init.py file is the gc100.py file (I named mine after the last octet of IP, so gc100-214).
When I goto check my config, I just get a spinning wheel forever. This is what i have in my config file:
If I # it out, code checks fine.
Also attached are screen shots of my gc10-214.py and my switch.py. The switch.py and the gc100-214.py file sits in /config/custom_component/gc100-214. Would appreciate anyone’s sanity check of my editing… I am pretty good at modifying code to do what I need it to do.