Skip to content

Instantly share code, notes, and snippets.

@fodi666
Created May 26, 2018 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fodi666/7317329a713711a38e4f911f5de6ab9f to your computer and use it in GitHub Desktop.
Save fodi666/7317329a713711a38e4f911f5de6ab9f to your computer and use it in GitHub Desktop.
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: <LAT>
longitude: <LON>
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/Zurich
# Customization file
customize: !include customize.yaml
# Show links to resources in log and frontend
#introduction:
# Enables the frontend
frontend:
# Enables configuration UI
config:
http:
# Secrets are defined in the file secrets.yaml
api_password: <APIPASS>
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# base_url: example.duckdns.org:8123
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time
history:
# View all events in a logbook
logbook:
# Change logging to warning only
logger:
default: warning
# Enables a map showing the location of tracked devices
map:
# Track the sun
sun:
# Weather prediction
weather:
- platform: yweather
name: myplace
# Text to speech
tts:
- platform: google
# Cloud
cloud:
#group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
# Example configuration.yaml entry
api:
#iSpindel
sensor:
- platform: mqtt
name: ispindel_base
state_topic: "home-assistant/ispindel_base"
value_template: '{{value_json.angle}}'
json_attributes:
- name
- ID
- angle
- temperature
- battery
- gravity
- interval
- RSSI
- platform: template
sensors:
ispindel_name:
value_template: '{{states.sensor.ispindel_base.attributes["name"]}}'
entity_picture_template: /local/tag-text-outline.png
friendly_name: Name
ispindel_id:
value_template: '{{states.sensor.ispindel_base.attributes.ID}}'
entity_picture_template: /local/pound.png
friendly_name: ID
ispindel_angle:
value_template: '{{float(states.sensor.ispindel_base.attributes.angle) | round(2)}}'
unit_of_measurement: '°'
entity_picture_template: /local/math-compass.png
friendly_name: Tilt
ispindel_temp:
value_template: '{{float(states.sensor.ispindel_base.attributes.temperature) | round(1)}}'
unit_of_measurement: '°C'
entity_picture_template: /local/thermometer-lines.png
friendly_name: Temperature
ispindel_battery:
value_template: '{{float(states.sensor.ispindel_base.attributes.battery) | round(2)}}'
unit_of_measurement: 'V'
entity_picture_template: >-
{% if float(states.sensor.ispindel_base.attributes.battery)<3.7 %}
/local/battery-10.png
{% elif float(states.sensor.ispindel_base.attributes.battery)<4.0 %}
/local/battery-50.png
{% else %}
/local/battery-full.png
{% endif %}
friendly_name: Battery voltage
ispindel_gravity:
value_template: '{{float(states.sensor.ispindel_base.attributes.gravity) | round(3)}}'
unit_of_measurement: 'g/cm3'
entity_picture_template: /local/altimeter.png
friendly_name: Specific gravity
ispindel_interval:
value_template: '{{states.sensor.ispindel_base.attributes.interval}}'
unit_of_measurement: 's'
entity_picture_template: /local/timelapse.png
friendly_name: Refresh interval
ispindel_rssi:
value_template: '{{states.sensor.ispindel_base.attributes.RSSI}}'
unit_of_measurement: 'dBm'
entity_picture_template: /local/wifi-strength-2.png
friendly_name: Signal strength
- platform: template
sensors:
ispindel_sg_calculated:
value_template: '{{0.001143*float(states.sensor.ispindel_base.attributes.angle)**3-0.132955*float(states.sensor.ispindel_base.attributes.angle)**2+6.288460*float(states.sensor.ispindel_base.attributes.angle)+916.244416 | round(3)}}'
unit_of_measurement: 'g/cm3'
friendly_name: Calculated specific gravity
entity_picture_template: /local/altimeter.png
# - platform: filter
# name: "filtered battery"
# entity_id: sensor.ispindel_battery
# filters:
# - filter: time_simple_moving_average
# window_size: 00:01
# precision: 2
# - platform: filter
# name: "filtered temp"
# entity_id: sensor.ispindel_temp
# filters:
# - filter: time_simple_moving_average
# window_size: 00:01
# precision: 2
# - platform: filter
# name: "filtered rssi"
# entity_id: sensor.ispindel_rssi
# filters:
# - filter: time_simple_moving_average
# window_size: 00:01
# precision: 2
# - platform: filter
# name: "filtered angle"
# entity_id: sensor.ispindel_angle
# filters:
# - filter: time_simple_moving_average
# window_size: 00:01
# precision: 2
# - platform: filter
# name: "filtered sg"
# entity_id: sensor.ispindel_sg_calculated
# filters:
# - filter: time_simple_moving_average
# window_size: 00:01
# precision: 2
history_graph:
ispindel_graphs:
name: iSpindel graphs
entities:
- sensor.ispindel_angle
- sensor.ispindel_temp
- sensor.ispindel_sg_calculated
hours_to_show: 72
refresh: 120
group:
ispindel_group:
name: iSpindel data
entities:
- history_graph.ispindel_graphs
- sensor.ispindel_battery
- sensor.ispindel_rssi
- sensor.ispindel_interval
- sensor.ispindel_name
- sensor.ispindel_id
- sensor.ispindel_base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment