Hi, I’m having problems with running two instances of HA. I have loads of sensors, switches I want to control via GPIO and they are dotted through my house. Having two pi’s will suit my requirement for number of gpio pins and distance between them. Also one pi has a touch screen so it can be used to control the system in the kitchen. I apologise for the long post, but I wanted to be clear.
Master Raspberry Pi 2, Slave Raspberry Pi B+
What I do:
Master:
$ hass
Slave:
$ python .homeassistant/slave.py
What happens:
Master.IP:1705
All temperatures show up and Switches show up READ ONLY (state not switch)
Slave.IP:8123
Empty HomeAssistant Page. After a few min 1 of the temperatures show up but nothing else.
IF I DO THIS INSTEAD:
Master:
$ hass
Slave:
$ sudo python .homeassistant/slave.py (SUDO ADDED TO THIS LINE)
What happens: (SAME)
Master.IP:1705
All temperatures show up and Switches show up READ ONLY (state not switch)
Slave.IP:8123
Empty HomeAssistant Page. After a few min 1 of the temperatures show up but nothing else.
BUT IF I DO THIS:
Master:
$ hass
Slave:
$ python .homeassistant/slave.py (allow to load then Ctrl C)
Then without restarting hass
$ sudo python .homeassistant/slave.py (SUDO ADDED TO THIS LINE)
What happens:
Master.IP:1705 (SAME)
All temperatures show up and Switches show up READ ONLY (state not switch)
Slave.IP:8123
WORKING HomeAssistant Page. All of the temperatures show up and control over GPIO.
My slave.py
#! /usr/bin/env python
import homeassistant.remote as remote
import homeassistant.bootstrap as bootstrap
import homeassistant.config as config
Location of the Master API: host, password, port.
Password and port are optional.
remote_api = remote.API(“192.168.0.12”, “????”, 1705)
Initialize slave
hass = remote.HomeAssistant(remote_api)
myconfig = config.load_yaml_config_file("/home/pi/.homeassistant/configuration.yaml")
To add an interface to the slave on localhost:8123
bootstrap.setup_component(hass, ‘frontend’, myconfig)
To add my entities
bootstrap.setup_component(hass, ‘switch’, myconfig)
bootstrap.setup_component(hass, ‘sensor’, myconfig)
hass.start()
hass.block_till_stopped()
My slave configuration.yaml
------------------------------------ DS18b20 TEMPERATURE SENSORS
sensor 1:
platform: onewire
names:
28-00000617adbd: Living Room
28-04150115a1ff: Back
28-01156198ebff: Front
----------------------------------------------- RPi-GPIO SWITCH
switch:
platform: rpi_gpio
ports:
26: RED
25: GREEN
24: YELLOW
invert_logic: False
- How do I gain control over the slave gpios from the master IP
- How do I get all items to show up on the slave without running
“$ python .homeassistant/slave.py” and then also “$ sudo python .homeassistant/slave.py”
thanks