GithubHelp home page GithubHelp logo

home-assistant-ecosystem / python-mystrom Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 12.0 152 KB

Asynchronous Python API client for interacting with myStrom devices (plug, bulb, and button).

License: MIT License

Python 100.00%
iot home-assistant mystrom python3 asyncio aiohttp internet-of-things smart-home

python-mystrom's People

Contributors

apsysikal avatar doxsch avatar fabaff avatar hrnciar avatar joostlek avatar onecyrus avatar pail23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-mystrom's Issues

Docker support

Would be useful to include:

  • Dockerfile for system-independent deployment, and
  • docker-compose.yml to build and run the Dockerfile

Implement a set_mode method to Bulb to support β€œmono” mode

In the myStrom api documentation only two modes are documented: rgb and hsv. However, there is a third mode: mono. In this mode, the colour temperature can be set instead of the colour itself.
In your readme this is mentioned: https://github.com/home-assistant-ecosystem/python-mystrom/blob/master/README.rst#set-mono-white

Some precision: the color temperature for mono is a value between 1 and 18 where 1 = warmest, 18 = coldest.
The color should be: ColorTemparature;Brightness. For example 6;80

Problems with MyStrom Switches V1 since 1.1.x version (in Homeassistant)

Since the last update I get the error below in my Homeassistant log file on start-up. The switches are then also shown as Entity not available: switch.music, curiously enough though, if triggered through a script they work!

2020-05-17 17:15:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 445, in _async_add_entity
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 608, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/usr/src/homeassistant/homeassistant/components/mystrom/switch.py", line 58, in is_on
    return bool(self.data["relay"])
KeyError: 'relay'

Thank you for the nice work on this integration, I use it in HA for quite some time know without any troubles.

The new WiFi Switch Zero does gives errors

Power-related properties that exist in the standard switch do not exist in the zero. Also the info URL has changed.

This causes home assistant to not be able to use the new switches

myStrom Wifi Switch photovoltaic

the switch has the ability be used for photovoltaic unit. In this case, i want to read the earned Watt. I just find power consumption.
How can i read the power delivery value?

Initial Update

Hi πŸ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! πŸ€–

Handle CORS protection

As I mentioned here, aiohttp unconditionally adds Accept-Encoding: gzip, deflate header, without adding Referer or Origin, so it triggers myStrom's CORS protection

A workaround is to disable CORS protection on the device, but a better solution would be to add Referer or Origin header to avoid compromising security even more.

This protection was introduced in the following firmware versions:

  • WS2/WSE/WRS/WLL 3.82.56
  • WRB 2.59.32
  • WBP/WBS 2.74.36

Python-mystrom AttributeError:

This is the error I get running the sample code.

plug = pymystrom.MyStromPlug('192.168.0.34')
AttributeError: module 'pymystrom' has no attribute 'MyStromPlug'

What could be the problem`?
regards
tb

(question) what does the touch action do?

So there are single, double and long press actions. these are very simple and self explanatory - but what does the touch action do or how can I trigger it?
thanks in advance!

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.