All Projects → home-assistant → Micropython Home Assistant

home-assistant / Micropython Home Assistant

Licence: other
🐍 Home Assistant client for MicroPython

Programming Languages

python
139335 projects - #7 most used programming language
micropython
64 projects

Projects that are alternatives of or similar to Micropython Home Assistant

Home Assistant Js
🐝 JavaScript implementation of the Home Assistant API using NuclearJS
Stars: ✭ 50 (+21.95%)
Mutual labels:  home-assistant, framework
Duct
Server-side application framework for Clojure
Stars: ✭ 998 (+2334.15%)
Mutual labels:  framework
Web Grid
A CSS Grid based Framework
Stars: ✭ 36 (-12.2%)
Mutual labels:  framework
Nodercms
轻量级内容管理系统,基于 Node.js + MongoDB 开发,拥有灵活的内容模型以及完善的权限角色机制。
Stars: ✭ 990 (+2314.63%)
Mutual labels:  framework
Opensourcetest
OpenSourceTest由自动化测试-夜行者社区维护,提供的是更多地灵活性和可配置性
Stars: ✭ 37 (-9.76%)
Mutual labels:  framework
Aurelia
Aurelia 2, a standards-based, front-end framework designed for high-performing, ambitious applications.
Stars: ✭ 995 (+2326.83%)
Mutual labels:  framework
Lwc
⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
Stars: ✭ 974 (+2275.61%)
Mutual labels:  framework
Open Home
Projeto de automação residencial usando softwares e hardwares open source.
Stars: ✭ 41 (+0%)
Mutual labels:  home-assistant
Phaser Node Kit
Rapid Game Development with PhaserJS and Node for Modern Browsers
Stars: ✭ 39 (-4.88%)
Mutual labels:  framework
Jbuilder
Generate JSON objects with a Builder-style DSL, inspired by jbuilder
Stars: ✭ 37 (-9.76%)
Mutual labels:  framework
Morphnumbers
Компонент Home Assistant для работы с числительными в Jinja2
Stars: ✭ 38 (-7.32%)
Mutual labels:  home-assistant
Cli
GraphQL back-end framework with first-class Typescript support
Stars: ✭ 37 (-9.76%)
Mutual labels:  framework
Coaty Js
Collaborative IoT framework in JavaScript/TypeScript for Node.js and browsers.
Stars: ✭ 39 (-4.88%)
Mutual labels:  framework
Ever
Ever® - Open-Source Commerce Platform for On-Demand Economy and Digital Marketplaces
Stars: ✭ 980 (+2290.24%)
Mutual labels:  framework
Fancy
Fancy is a drop-in system that lets you take your static HTML code and add dynamically editable code.
Stars: ✭ 40 (-2.44%)
Mutual labels:  framework
Fragile
Framework for building algorithms based on FractalAI
Stars: ✭ 36 (-12.2%)
Mutual labels:  framework
Push Fcm Plugin
Official Firebase Cloud Messaging plugin for Push.js v1.0 🔥
Stars: ✭ 37 (-9.76%)
Mutual labels:  framework
Codenameone
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
Stars: ✭ 992 (+2319.51%)
Mutual labels:  framework
Home Assistant Config
My Home Assistant configuration
Stars: ✭ 41 (+0%)
Mutual labels:  home-assistant
Plugface
Next generation Java general purpose plugin framework
Stars: ✭ 41 (+0%)
Mutual labels:  framework

MicroPython Home Assistant

Communicate with your Home Assistant instance from MicroPython. Developed for and tested with MicroPython on the ESP8266.

Embeds a slightly patched version of micropython http-client <https://github.com/balloob/micropython-http-client>_.

Usage instructions

This has been tested to work with the alpha version of MicroPython for ESP8266 distributed among the backers of their KickStarter. Follow the instructions in their e-mail to get your ESP8266 up and running with their alpha version.

The alpha version does not have a filesystem so you'll have to copy/paste the code into the REPL. Press ctrl+E to put the REPL into paste-mode. Press ctrl+d to end paste-mode and process pasted code.

Copy the contents of __init__.py <https://github.com/balloob/micropython-home-assistant/blob/master/homeassistant/__init__.py>_ to the REPL. You can copy all constants at once but copy the classes and methods at root level one by one.

You're now all set and can follow the example below.

API

Constructor:

  • HomeAssistant(host_url, api_password=None, timeout=None)

Methods:

  • states()
  • is_state(entity_id, state)
  • get_state(entity_id)
  • set_state(entity_id, state, attributes=None)
  • fire_event(event_name, event_data=None)
  • call_service(domain, service, service_data=None)

.. code-block:: python

from homeassistant import HomeAssistant
hass = HomeAssistant('http://127.0.0.1:8123', 'my_password')
states = hass.states()
state = states[0]
print("State %s is %s" % (state['entity_id'], state['state']))
print("Test if state is still the same: %s" %
      hass.is_state(state['entity_id'], state['state']))

new_state = hass.set_state('sensor.temperature', '10',
                           {'unit_of_measurement': '%'})
verify_state = hass.get_state('sensor.temperature')
print(new_state)
print(verify_state)
print(new_state == verify_state)

hass.fire_event('some_event', {'hello': 'world'})

hass.call_service('switch', 'turn_on', {'entity_id': 'switch.ac'})

Discovery

This currently only works on the Unix MicroPython version.

It is able to automatically detect a running instance of Home Assistant on the network if the server is running the experimental discoverable <https://github.com/balloob/home-assistant/blob/discoverable/homeassistant/components/discoverable.py>_ component.

By default the Home Assistant server will not expose it's password. In this case to get a working instance you have to pass a password to get_instance('my password').

.. code-block:: python

from homeassistant.discovery import get_instance

hass = get_instance()

Notes

  • SSL certificates are not being verified.
  • Not all micropython implementations support timeout. It defaults to 5 seconds if supported. It can be overwritten by passing in a second argument to the HomeAssistant constructor.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].