mirror of
				https://github.com/CCOSTAN/Home-AssistantConfig.git
				synced 2025-10-31 02:37:25 +00:00 
			
		
		
		
	Quick update to Solar stats maybe @dale3h
This commit is contained in:
		| @@ -23,6 +23,23 @@ notify: | ||||
| ### Building out some Historical stats for tweeting. ##################### | ||||
| sensor: | ||||
|  | ||||
|   - platform: sql | ||||
|     db_url: sqlite:///config/home-assistant_v2.db | ||||
|     queries: | ||||
|       - name: "Solar 24h" | ||||
|         column: 'solar_kwh' | ||||
|         unit_of_measurement: 'kWh' | ||||
|         query: >- | ||||
|           SELECT ROUND(SUM(solar_kwh), 2) AS solar_kwh | ||||
|           FROM ( | ||||
|             SELECT AVG(state) AS solar_kwh | ||||
|             FROM states | ||||
|             WHERE entity_id = 'sensor.solar_now' | ||||
|             AND state != 'unknown' | ||||
|             AND last_updated >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 24 HOUR) | ||||
|             GROUP BY HOUR(last_updated) | ||||
|           ) AS total_kwh; | ||||
|  | ||||
|   - platform: history_stats | ||||
|     name: Doorbell Presses | ||||
|     entity_id: binary_sensor.skybell_stone_door_button | ||||
| @@ -129,7 +146,7 @@ group: | ||||
|       - sensor.sensor_count | ||||
|       - sensor.script_count | ||||
|       - sensor.binary_sensor_count | ||||
|       - sensor.automation_count       | ||||
|       - sensor.automation_count | ||||
|  | ||||
| ############################################################# | ||||
|  | ||||
|   | ||||
| @@ -1,12 +1,18 @@ | ||||
| ##  These scripts are run from /home/pi  | ||||
| # ##  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 | ||||
|  | ||||
| #!/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 | ||||
| cd /home/hass/docker_files | ||||
| docker-compose down | ||||
| docker-compose pull | ||||
| docker-compose up -d | ||||
|   | ||||
							
								
								
									
										12
									
								
								config/shell_scripts/gitpull.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										12
									
								
								config/shell_scripts/gitpull.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| #!/bin/bash | ||||
| cd /home/hass/docker_files | ||||
| docker-compose exec home-assistant python -m homeassistant --config /config --script check_config | ||||
|  | ||||
| cd /home/hass/docker_files/homeassistant | ||||
| git pull origin master | ||||
|  | ||||
| cd /home/hass/docker_files | ||||
| docker-compose exec home-assistant python -m homeassistant --config /config --script check_config | ||||
|  | ||||
| cd ~ | ||||
| exit | ||||
| @@ -1,16 +1,16 @@ | ||||
| ##  These scripts are run from /home/pi  | ||||
|  | ||||
| #!/bin/bash | ||||
| cd /home/hass/docker_files | ||||
| docker-compose exec home-assistant python -m homeassistant --config /config --script check_config | ||||
|  | ||||
| cd /home/hass/.homeassistant | ||||
| source /srv/hass/hass_venv/bin/activate | ||||
| hass --script check_config | ||||
| cd /home/hass/docker_files/homeassistant | ||||
|  | ||||
| git add . | ||||
| git status | ||||
| echo -n "Enter the Description for the Change: " [Minor Update] | ||||
| echo -n "Enter the Description for the Change: [Minor Edit] " | ||||
| read CHANGE_MSG | ||||
| CHANGE_MSG=${CHANGE_MSG:-Minor Edit} | ||||
| git commit -m "${CHANGE_MSG}" | ||||
| git push origin master | ||||
|  | ||||
| cd ~ | ||||
| exit | ||||
|   | ||||
		Reference in New Issue
	
	Block a user