GithubHelp home page GithubHelp logo

opsdroid / opsdroid-homeassistant Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 104 KB

๐Ÿ  A Home Assistant plugin for opsdroid

Home Page: https://home-assistant.opsdroid.dev

License: Apache License 2.0

Python 100.00%

opsdroid-homeassistant's Introduction

Opsdroid Logo

An open source chat-ops bot framework

Current version of pypi Github CI Status codecov BCH compliance Docker Build Docker Image Size (latest by date)Docker Layers Documentation Status Matrix Chat Backers on Open Collective Sponsors on Open Collective Open Source Helpers


Quick Start โ€ข Documentation โ€ข Playground โ€ข Blog โ€ข Community


An open source chatbot framework written in Python. It is designed to be extendable, scalable and simple.

This framework is designed to take events from chat services and other sources and execute Python functions (skills) based on their contents. Those functions can be anything you like, from simple conversational responses to running complex tasks. The true power of this project is to act as a glue library to bring the multitude of natural language APIs, chat services and third-party APIs together.

See our full documentation to get started.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! ๐Ÿ™ [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

opsdroid-homeassistant's People

Contributors

davdr avatar jacobtomlinson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

opsdroid-homeassistant's Issues

Reconnect on disconnected

If Home Assistant is restarted the opsdroid connector will exit as the websocket will close.

We should automatically attempt to reconnect if this happens.

Compatibility with Opsdroid > v0.19.0

opsdroid-homeassistant doesn't work on Opsdroid v0.20.0. ๐Ÿ˜ข

Steps to reproduce

  • Use Opsdroid v0.20.0 (I used Docker container)
  • Install opsdroid-homeassistant: pip install opsdroid-homeassistant==0.1.8
  • Create a sample skill:
from asyncio import sleep
from opsdroid_homeassistant import HassSkill, match_hass_state_changed

class MotionLights(HassSkill):

    @match_hass_state_changed("binary_sensor.drive", state="on")
    async def motion_lights(self, event):
        """Turn the outside light on with motion if after sunset."""
        if await self.sun_down():
            await self.turn_on("light.drive")
            await sleep(60)
            await self.turn_off("light.drive")
  • Start Opsdroid: opsdroid start

Expected result

  • Skill is loaded and Opsdroid starts

Current result

INFO opsdroid.logging: ========================================
INFO opsdroid.logging: Started opsdroid v0.20.0.
WARNING opsdroid.loader: No databases in configuration. This will cause skills which store things in memory to lose data when opsdroid is restarted.
Traceback (most recent call last):
  File "/usr/local/bin/opsdroid", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/opsdroid/cli/start.py", line 43, in start
    opsdroid.run()
  File "/usr/local/lib/python3.8/site-packages/opsdroid/core.py", line 166, in run
    self.sync_load()
  File "/usr/local/lib/python3.8/site-packages/opsdroid/core.py", line 215, in sync_load
    self.eventloop.run_until_complete(self.load())
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/opsdroid/core.py", line 224, in load
    self.setup_skills(self.modules["skills"])
  File "/usr/local/lib/python3.8/site-packages/opsdroid/core.py", line 286, in setup_skills
    skill_obj = func(self, skill["config"])
  File "/usr/local/lib/python3.8/site-packages/opsdroid_homeassistant/skill/__init__.py", line 44, in __init__
    [self.hass] = [
ValueError: not enough values to unpack (expected 1, got 0)

My aim is to run this skill on Opsdroid v0.20.0: https://gitlab.com/olegfiksel/home-assistant-bot/-/tree/5-upgrade-to-opsdroid-v0-20-0

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.