I was looking for a workaround. A script that reads the GPIO status and then relays it as input to HASS. Any help or point me to the right direction. I am also looking at command_line as a platform too. Any help would be appreciated
I am sorry I could not quite follow. I need HASS because my RasPi is acting as a bell. There are 7 different entrances; with two speakers (who is sensitive to each entrance) with its own tone and 7 Segment Display indicating the entrance and LCD Display indicating the same. It provides notification in LG TV WebOS. Planning to get iOS also done. Everything works but HASS sometimes do not reflect the true value of the input pin. After some digging around I understood its a common problem. I am looking for a work around. I don’t even mind going to the actual python script (source of hass) and modifying. So its not just controlling IO pins but a lot more. If I directly check the status through a multimeter or through WiringPI or even just GPIO by exporting and reading - I can see the expected value but somehow the same is not passed down to HASS. Kindly help.
Not sure if this help but you can put a php script on a raspberry pi and start apache. It is now a web based switch than HA or anything can react with. I would change the output below to 1 or 0 so HA can determine its state.
<?php
//set pins mode to output
system ( "gpio -g mode 21 out" );
//activate and print
system ( "gpio -g write 21 1" );
echo ( "fireplace off " );
system ( "gpio -g read 21" );
But I have HA installed in my RPi. I was looking at the component python_scripts or commandline. I will however look at sending it as MQTT to HA. Do you think it will be a big overhead to Pi? I will be running it 24x7 non stop.
However, in order for this to work I need to export and set the pin as input at once. I tried many methods including crontab, rc.local, .bashrc. I had no success. Any idea on how to get a script running just once at the boot and once during shutdown?
Thanks.
@gpbenton - Is there a way we can chat. I have another project incoming that would excessive use of MQTT and looking at a soln to have a client-server architecture. To have 1 HA and then communicate to others. Is there DM in this? More info at Targeted UI/ or HA to HA communication