Some of my custom components for home-assistant (HA). (http://www.home-assistant.io)
- Developer - Get notifications of HA Pull-Requests
- HomeGW Climate - Use an RF433Mhz weather logger as a climate sensor
- HomeGW Weather - Use an RF433Mhz weather station
- Bluetooth Speaker - Play TTS through your bluetooth speaker connected to HA.
- Home Cover - Control your covers with just two relay's
As a Home Assistant developer, I like to keep a close eye into whats new (Pull Requests - PR). This component uses github API to find PR related to the components currently in use in the running HA.
developer:
github_personal_token: "1231231e23442342312312312312"
You can get your own personal token here
I'm currently using a cheap 433MHz Wireless sensor to monitor several rooms in the house.
Attached to my RPi3 running HA I've got an Arduino working as a gateway. The code running in the Arduino is provided here.
The serial sensor receives a payload similar to:
{"dev":"digoo","id":8,"ch":3,"batt":1,"temp":20,"hum":56,"raw":"0x8a0c8f38"}
Using the serial sensor platform and a MQTT binary sensor I've created the homegw_climate custom component that looks like a thermostat, but cannot act upon the HVAC.
The platform supports filtering by channel (ch) which is the only parameter the device provides configuration for.
The weather station is by all means a copy of the climate platform (or the other way round). The same serial sensor is monitored, only the Wireless sensor is different.
sensor:
- platform: serial
serial_port: /dev/tty.USB0
baudrate: 115200
binary_sensor:
- platform: mqtt
state_topic: "devices/heating/status"
name: heating
device_class: heat
climate:
- platform: homegw_climate
name: quarto2
serial_sensor: sensor.serial_sensor
heating_sensor: binary_sensor.heating
channel: 2
weather:
- platform: homegw_weather
name: backyard
serial_sensor: sensor.serial_sensor
This file provides a decorator class used in the homegw_climate and homegw_weather platforms. It has a dependency in the filter sensor which actually implements the filters.
binary_sensor:
- platform: motion_mqtt
name: test_cozinha
state_topic: devices/sonoff_rfbridge/relay/0
command_topic: devices/sonoff_rfbridge/relay/0/set
availability_topic: devices/sonoff_rfbridge/status
payload_available: 1
payload_not_available: 0
period: 5:00
This is a media_player platform that enables playback of mp3 and wav files through a Bluetooth Speaker paired with a Linux Host using the bluealsa stack. This is the same to say: It works with my RPi3 running hassbian.
In order to use this media_player you must first setup bluealsa.
$ apt-get install bluez bluealsa
Afterwards, pair your bluetooth speaker using bluetoothctl, please refer to https://ukbaz.github.io/howto/Bluetooth_speakers.html
Last you configure alsa settings for the user running home-assistant, please adapt according to your devices.
$ cat ~/.asoundrc
defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "XX:XX:XX:XX:XX:XX"
defaults.bluealsa.profile "a2dp"
media_player:
- platform: bluetooth_speaker
name: My Bluetooth Speaker #OPTIONAL
device: 'OEM Speaker' #REQUIRED: this string is what shows up when you discover a new device
step: 0.05 #OPTIONAL: steps increase/decrease volume
cache_dir: /tmp/tts #OPTIONAL: only matters if you're not using the default
This is a cover platform on top of 2 relays exposed through MQTT. Each relays is closed for the duration in milliseconds publish to the control topic. delay_time indicates the time needed to go from 0% to 100% cover. For more information on this backend see home_mqtt
- platform: home_mqtt
covers:
living_room:
relay_up: 1
relay_down: 2
delay_time: 17000
suite:
relay_up: 3
relay_down: 4
delay_time: 17000