Code Monkey home page Code Monkey logo

pan-tilt-hat-hass's Introduction

This custom component adds the pimoroni pan-tilt-phat to Home-assistant.

Place the custom_components folder in your configuration directory (pi@raspberrypi:~/.homeassistant $ mv ~/Github/pan-tilt-hat-HASS/custom_components .) or add its contents to an existing custom_components folder. Add to your configuration.yaml:

pan_tilt_phat:

The adds the services:

  • pan_tilt_phat.home called with no data to return to home (0, 0)
  • pan_tilt_phat.pan which can be called with e.g. {"Pan":20} to pan to 20 degrees
  • pan_tilt_phat.tilt which can be called with e.g. {"Tilt":30} to tilt to 30 degrees

Python scripts & automation

This repo also includes python scripts and automations to add slider control as shown in the image below. Moving the sliders triggers an automation which calls the python script to move the pan-tilt-hat. Copy the required content of the example config files to your own config files.

pan-tilt-hat-hass's People

Contributors

robmarkcole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pan-tilt-hat-hass's Issues

raspistill not found and errors setting up platform

Hi,

I tried this addon, but I get following errors in http://hassio.local:8123/dev-info:

2017-09-03 21:35:26 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=4 from 2017-09-03 19:27:53.304554) 2017-09-03 21:35:28 ERROR (SyncWorker_13) [homeassistant.components.camera.rpi_camera] 'raspistill' was not found 2017-09-03 21:35:36 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds. 2017-09-03 21:35:39 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform pan_tilt_phat Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=self.hass.loop) File "/usr/lib/python3.6/asyncio/tasks.py", line 352, in wait_for return fut.result() File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/sensor/pan_tilt_phat.py", line 46, in setup_platform add_devices([PanTiltPhat(pantilthat)], True) File "/config/custom_components/sensor/pan_tilt_phat.py", line 60, in __init__ self._pan = self._pantilthat.get_pan() File "/config/deps/lib/python3.6/site-packages/pantilthat/pantilt.py", line 415, in get_servo_one return self._servo_us_to_degrees(us, us_min, us_max) File "/config/deps/lib/python3.6/site-packages/pantilthat/pantilt.py", line 131, in _servo_us_to_degrees self._check_range(us, us_min, us_max) File "/config/deps/lib/python3.6/site-packages/pantilthat/pantilt.py", line 120, in _check_range max=value_max)) ValueError: Value 51200 should be between 575 and 2325

Rename services

Bit wierd to pass 'Pan' to a 'pan__' service, rename to 'Move'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.