diff --git a/config/custom_components/sensor/database.py b/config/custom_components/sensor/database.py.disabled similarity index 100% rename from config/custom_components/sensor/database.py rename to config/custom_components/sensor/database.py.disabled diff --git a/config/custom_components/sensor/duke_energy.py b/config/custom_components/sensor/duke_energy.py new file mode 100755 index 00000000..bfebfc11 --- /dev/null +++ b/config/custom_components/sensor/duke_energy.py @@ -0,0 +1,80 @@ +""" +Support for Duke Energy Gas and Electric meters. + +For more details about this component, please refer to the documentation at +https://home-assistant.io/components/sensor/duke_energy/ +""" +import logging + +import voluptuous as vol + +from homeassistant.components.sensor import PLATFORM_SCHEMA +from homeassistant.const import CONF_USERNAME, CONF_PASSWORD +from homeassistant.helpers.entity import Entity +import homeassistant.helpers.config_validation as cv +import homeassistant.util as util + +REQUIREMENTS = ['pydukeenergy==0.0.4'] + +_LOGGER = logging.getLogger(__name__) + +PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ + vol.Required(CONF_USERNAME): cv.string, + vol.Required(CONF_PASSWORD): cv.string, +}) + + +def setup_platform(hass, config, add_devices, discovery_info=None): + """Display the current season.""" + from pydukeenergy.api import DukeEnergy, DukeEnergyException + + try: + duke = DukeEnergy(config.get(CONF_USERNAME), config.get(CONF_PASSWORD)) + except DukeEnergyException: + _LOGGER.error("Failed to setup Duke Energy") + return False + + meters = duke.get_meters() + sensors = [] + for meter in meters: + sensors.append(DukeEnergyMeter(meter)) + add_devices(sensors) + + return True + + +class DukeEnergyMeter(Entity): + """Representation of a Duke Energy meter.""" + + def __init__(self, meter): + """Initialize the meter.""" + self.duke_meter = meter + + @property + def name(self): + """Return the name.""" + return "duke_energy_" + self.duke_meter.id + + @property + def state(self): + """Return yesterdays usage.""" + return self.duke_meter.get_usage() + + @property + def unit_of_measurement(self): + """Return the unit of measurement this sensor expresses itself in.""" + return self.duke_meter.get_unit() + + @property + def device_state_attributes(self): + """Return the state attributes.""" + attributes = { + "lastBillsUsage": self.duke_meter.get_total(), + "lastBillsAverageUsage": self.duke_meter.get_average(), + "lastBillsDaysBilled": self.duke_meter.get_days_billed() + } + return attributes + + def update(self): + """Update meter.""" + self.duke_meter.update() diff --git a/config/packages/powerwall.yaml b/config/packages/powerwall.yaml index e3673acc..4a9ae997 100755 --- a/config/packages/powerwall.yaml +++ b/config/packages/powerwall.yaml @@ -1,18 +1,15 @@ -#------------------------------------------- -# PiHole ad Blocking Related Packages -#------------------------------------------- -# homeassistant: -# customize: -# -# sensor.pihole_ads_percentage_today: -# friendly_name: Percentage of Ad Traffic Blocked -# unit_of_measurement: '%' -# icon: mdi:ticket-percent -# -# group.pihole: -# homebridge_hidden: true -#------------------------------------------- +###################################################################################################### +### @Tesla Powerwall - https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html +# # @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +###################################################################################################### + sensor: + + - platform: duke_energy + username: !secret duke_energy_username + password: !secret duke_energy_password + - platform: rest name: House now resource: http://192.168.10.90/api/meters/aggregates @@ -62,4 +59,4 @@ group: # # automation: -# Located in the Grafana package. Tweets out Solar Production Daily! +# Located in the Grafana package. Tweets out Solar Production Daily! diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index cdcecc8f..d15bcdd8 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -275,6 +275,7 @@ automation: "Build your own DIY Outdoor Smart Home LED strips - (https://www.vcloudinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html)", "Breakdown of the entire smart home - (https://www.vcloudinfo.com/2017/07/my-smart-home-look-at-parts-that-make.html)", "Build your own Home Alarm System - (https://www.vcloudinfo.com/2017/06/building-my-home-alarm-system-hardware.html)", + "Adding a Mixer and AMP to this Text to Speech solution changed the Smart Home COMPLETELY! (https://www.vcloudinfo.com/2017/07/giving-voice-to-smart-home.html)", "Some of my favorite #Docker Containers that I am using - (https://www.vcloudinfo.com/2018/06/rolling-out-some-new-docker-containers.html)", "Be Sure to follow all of my Twitter Accounts! @CCostan and my HOUSE bot @BearStoneHA!", "Be sure to like me on Facebook and join our HA group! (https://www.facebook.com/groups/HomeAssistant/) (https://www.facebook.com/VMwareInfo/) (https://www.facebook.com/BearStoneHA/)", diff --git a/config/script/tweet.yaml b/config/script/tweet.yaml index 9c3e7db0..6c192a36 100755 --- a/config/script/tweet.yaml +++ b/config/script/tweet.yaml @@ -36,6 +36,7 @@ tweet_engine_setup: "Build your own DIY Outdoor Smart Home LED strips - (https://www.vcloudinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html)", "Breakdown of the entire smart home - (https://www.vcloudinfo.com/2017/07/my-smart-home-look-at-parts-that-make.html)", "Build your own Home Alarm System - (https://www.vcloudinfo.com/2017/06/building-my-home-alarm-system-hardware.html)", + "Adding a Mixer and the AMP to this Text to Speech solution changed the Smart Home! (https://www.vcloudinfo.com/2017/07/giving-voice-to-smart-home.html)", "Some of my favorite #Docker Containers that I am using - (https://www.vcloudinfo.com/2018/06/rolling-out-some-new-docker-containers.html)", "10 year safety check. If you haven't done it yet, you need to! (https://www.vcloudinfo.com/2017/06/psa-check-out-your-smoke-detectors-once.html)" ], diff --git a/config/travis_secrets.yaml b/config/travis_secrets.yaml index f72c4f97..f99c6416 100755 --- a/config/travis_secrets.yaml +++ b/config/travis_secrets.yaml @@ -16,6 +16,8 @@ camera3_url: http://192.168.10.23:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=a forecast_key: ForcastKeyphrase fitbit_user: User@email.com fitbit_password: abcdefghijklmnopqrstuvwxyz0123456789 +duke_energy_username: user@email.com +duke_energy_password: SuperSecretCode juicenet_access_token: abcdefghijklmnopqrstuvwxyz0123456789 bedroom_restart_on: "/usr/bin/curl -k 'http://192.168.10.127:2323/?cmd=restartApp&password=SecretPassWord'" nest_client_id: secret_nest_client_id diff --git a/config/www/custom_ui/floorplan/images/branding/solar_readings.png b/config/www/custom_ui/floorplan/images/branding/solar_readings.png index 706ce41b..1f1e78c1 100644 Binary files a/config/www/custom_ui/floorplan/images/branding/solar_readings.png and b/config/www/custom_ui/floorplan/images/branding/solar_readings.png differ