You can find the entire repo here.

This commit is contained in:
ccostan
2018-02-28 19:43:00 -05:00
parent ddcf503781
commit 40f8fd2edc
263 changed files with 0 additions and 194 deletions

View File

@@ -0,0 +1,12 @@
## These scripts are run from /home/pi
#!/bin/bash
cd /home/hass/.homeassistant
source /srv/hass/hass_venv/bin/activate
echo "Processing update"
pip3 install --upgrade homeassistant
hass --script check_config
exit

View File

@@ -0,0 +1,14 @@
## These scripts are run from /home/pi
#!/bin/bash
echo "Setting up Environment"
cd /home/hass/.homeassistant
source /srv/hass/hass_venv/bin/activate
echo "Processing update"
pip3 install --upgrade git+git://github.com/balloob/home-assistant.git@dev
echo "Code Check"
hass --script check_config
exit

View File

@@ -0,0 +1,44 @@
You can use this code to quickly create files from the template editor in HA. I use it mainly for `emulated_hue` and to quickly add in new Customize options to all things HA!
For the sandbox.
{% set trigger = {'entity_id':'sensor.downstairs_thermostat_hvac_state','to_state':'cooling'} %}
#########################################################
Create fast Customize for groups, sensors, covers etc... Just change that first line below 'sensor' to 'group', 'covers' etc..
{% for state in states.sensor -%}
{% if loop.first %}
{% elif loop.last %}
{% else %}
{% endif %}
{{- state.entity_id }}:
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
emulated_hue_hidden: {{state.attributes.emulated_hue_hidden if state.attributes.emulated_hue_hidden is defined else 'False' }}
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
homebridge_hidden: {{state.attributes.homebridge_hidden if state.attributes.homebridge_hidden is defined else "true"}}
{{'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
{{'homebridge_cover_type: '+ state.attributes.homebridge_cover_type if state.attributes.homebridge_cover_type is defined}}
{{'assumed_state: '+ state.attributes.assumed_state if state.attributes.assumed_state is defined}}
{% endfor -%}
#########################################################
#This code lists out EVERY possible entity and attribute for that entity.
# source: https://github.com/skalavala/smarthome/blob/master/Entities.md
#########################################################
{{ "_".ljust(90, "_") }}
{%- set domains = [states.light, states.switch, states.automation, states.device_tracker, states.group, states.media_player, states.proximity, states.script, states.zone, states.zwave, states.sensor, states.calendar ] %}
{{ "Entity ID".ljust(50) }}{{ "Entity Name" }}
{%- for domain in domains -%}
{% for item in domain %}
{{ "_".ljust(90, "_") }}
{{ item.entity_id.ljust(50) }}{{ item.name }}
{% for attrib in item.attributes %}
{%- if attrib is defined %}
{{attrib.ljust(50)}}: {{ item.attributes[attrib] }}
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- endfor %}
#########################################################

BIN
config/shell_scripts/codesend Executable file

Binary file not shown.

View File

@@ -0,0 +1,16 @@
## These scripts are run from /home/pi
#!/bin/bash
cd /home/hass/.homeassistant
source /srv/hass/hass_venv/bin/activate
hass --script check_config
git add .
git status
echo -n "Enter the Description for the Change: " [Minor Update]
read CHANGE_MSG
git commit -m "${CHANGE_MSG}"
git push origin master
exit

View File

@@ -0,0 +1,17 @@
## These scripts are run from /home/pi
#!/bin/bash
cat hassuser
sudo su -s /bin/bash hass
# source /srv/hass/hass_venv/bin/activate
# to Upgrade:
# pip3 install --upgrade homeassistant - Use HAUpdate.sh script
# To view The HA logs realtime
# sudo journalctl -u home-assistant -f | ccze

View File

@@ -0,0 +1,6 @@
# Restart Homebridge on HASS start
# shell_command:
# restart_homebridge: 'sudo su pi -c "pm2 restart homebridge"'
# start_homebridge: 'sudo su pi -c "pm2 start homebridge"'
# stop_homebridge: 'sudo su pi -c "pm2 stop homebridge"'

View File

@@ -0,0 +1,23 @@
#!/bin/sh
# this script uses hard-coded paths
# This deletes the readme file and begins rebuilding it..
cat /home/hass/.homeassistant/script/header.md > /home/hass/.homeassistant/script/README.md
grep -e '^[a-z]' /home/hass/.homeassistant/script/*.yaml | tr : '\n' > /tmp/scriptnames.txt
sed -i '/^$/d' /tmp/scriptnames.txt
for item in `cat /tmp/scriptnames.txt`
do
res=`grep -R script.$item /home/hass/.homeassistant/. --include=*.yaml`
echo "\n $item \n" | sed 's|/home/hass/\.homeassistant/| https://github\.com/CCOSTAN/Home-AssistantConfig/blob/master/|g'>> /home/hass/.homeassistant/script/README.md
echo "\n $res \n" | sed 's|/home/hass/\.homeassistant/\.| https://github\.com/CCOSTAN/Home-AssistantConfig/blob/master|g' >> /home/hass/.homeassistant/script/README.md
sed -i '/^$/d' /home/hass/.homeassistant/script/README.md
done
cat /home/hass/.homeassistant/script/README.md

View File

@@ -0,0 +1,11 @@
Turn off Disco lights
echo -e -n "\x01\x08\x00\xF2\x51\x01\x00\x05\x01\x51" > /dev/serial/by-id/usb-0658_0200-if00
Turn on Disco lights
echo -e -n "\x01\x08\x00\xF2\x51\x01\x01\x05\x01\x50" > /dev/serial/by-id/usb-0658_0200-if00
USING THE OZWCP WEB APPLICATION
cd /srv/hass/src/open-zwave-control-panel/; sudo ./ozwcp -p 8888
Specify your zwave controller, for example /dev/ttyACM0 and hit initialize