This should be correct but its not behaving as it should. Ideally if my sensor triggers then by my light config the bulb should be on or off depending on the state of the sensor. The switch config should not toggle the relay but only do so when I toggle it.
I hope I have the correct understanding because what I am trying to do is tell the state of the lamp regardless if my physical switch is pressed and there by be able to not disrupt mess it up when I toggle the relay.
thanks much tom you have shed a lot of light on situation
Your switch will react to changes made in home assistant or by the physical switch as you have a voltage monitor for feedback.
The problem may be that you have not correctly wired the relay and physical switch to both be able to control the light. The switch and relay can not be simply wired in series, or in parallel. It requires this configuration:
So I had a chance to check it and it does not work as it should at all. The Light config is able to see the correct state of the bulb when it is ON/OFF. But the slider does not do anything at all to the relay to control it from under the Light card. Similarly the Template command is also not able to change the state when I move the slider slider either. Form the above the only control I get is using the switch command for the relay only.
Made some more checks and I have no control on either the switch template or my light. The lamp icon on the light works flawless with the light activation and the switch corresponds with the light icon status. But if I try to move the switch to off if the light is on, it goes to the off position momentarily and then switches back on. What am I missing that will allow me to get control of the light and not have it stay locked to what ever state the voltage sensors is in?
So check through everything and realized because im using 2 way switching I needed to change my command from Switch to a Toggle and it all works fine.
Seems however that my sensors that are connected to my raspbian pi directly on GPIO pins are unable to be reliably detected by REMOTE pi command from my HA running on my next PI 3. If i encounter a power failure im stuck with my sensors not being detected and sometimes end up having to do multiple shutdown of both rasbian and HA pi and hope they play together. This is my new nightmare
Two questions come to mind as many have said their remote Gpio detection works flawless so is that because they are using the HA on docker on a virtual environment?
I have been looking at flyt method over mqtt and wanted to know if that may be a more reliable and viable method
retried flyte package and was able to download all the items including Cerberus but i got a new error
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pi-mqtt-gpio
AND then this
WARNING: The script pi_mqtt_gpio is installed in ‘/home/pi/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
I want to start building but I would like to know if you encountered any of these errors or how are you getting around the install without them being a problem?
So I am trying to create a file in my usr/bin/python folder and its being denied
The software part on the pi and navigating and creating files and folders are clearly my challenges.
did not use the virtual environment install…
did everything as above and updated just the pip3 from the correct location command and the error was gone.
Rebooted and ran the service and it ran and everything works flawless and seamless I was definitely missing out all along and can most definitely say this is by far the most relaible and seamless sensor detection method I have tried thus far. I have tried a HA instance with my sensors directly connected to Gpio on that Pi, then tried HA with a remote connected pi with sensors directly connected to Gpio on the remote pi and I have even tried Gpio2 custom components. I was never able to get reliable detection with any of them and I have spent quite some time tinkering in each method trying to make sure everything was done correctly and properly.
With everything and all the help I have received thus far is seems I always have another hurdle to cross and its now trying to get the systmd method to auto run the service on t reboot…I am getting a option to enable root or pi requiring a manual feedback. I guess python and tinkering remains my area of greatest challenge sigh.
but progress as slow as it may be is still progress and I appreciate all the assistance thus far
I have the same problem with my remote system sensor monitoring for the pi. Never solved it. If you are interested in monitoring your remote pi cpu memory etc this is a good option with discovery: Remote RPI system monitor
However I restart it so rarely that I’ve actually had to write down the startup instructions because I forget them in the intervening time (year+).
I never ended up using the virtual environment install method. Instead I was directed by some really smart guys to do the following and I hope it helps anyone here.
I defined the python environment following this
The versions numbers will of course have to be changed to the ones your system has and then the latest version set as default ( auto) in the whole system
Do an install for user pi
pip install pi-mqtt-gpio
create the config.yaml file
then for system wide
sudo -i
pip install pi-mqtt-gpio
create script file for run on startup using init.d method
nano /etc/init.d/mqtt.sh
-----insert the following------
#!/bin/bash
### BEGIN INIT INFO
# Provides: sample.py
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: S 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
sleep 5s
/usr/bin/python3 -m pi_mqtt_gpio.server /home/pi/config.yaml >> /var/log/mqtt_server.log 2>&1 &
then
sudo reboot
the sleep time of 5 sec was added to allow for any services that was not available on boot. When we used zero seconds service fails.
I asked anilet for some feedback on his system which uses master/ slave HA instances for additional implementation of room sensors with mqtt gateway but I know you already hooked on esp home.
Care to share any reasons why you opted for this method?