Code Monkey home page Code Monkey logo

mh-maxsmart-hass's People

Contributors

superkikim avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

gruiny

mh-maxsmart-hass's Issues

Revogi Strip provides Milliwatts

The Revogi Strip provides the consumption in Milliwatts. Here /config/custom_components/maxsmart/sensor.py has to be adapted. My quickfix:

self._power_data = float(power_data['watt']/1000.0)

It seems sensor.py needs a switch case for the product variant.

Not able to Add Integration

Hi,
I am using latest HAOS and not able to add Integration after installing those 4 files into filesystem generation error

Config flow could not be loaded: {"message":"Invalid handler specified"}

Logger: homeassistant.config_entries
Source: config_entries.py:864
First occurred: 9:21:09 PM (1 occurrences)
Last logged: 9:21:09 PM
Error occurred loading flow for integration maxsmart: No module named 'custom_components.maxsmart.const'

I did tried to upload a file const.py as well. It did started to look promissing showin
Please wait, starting configuration wizard for Max Hauri Maxsmart

but ended up Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/maxsmart/config_flow.py:14
Integration: Max Hauri Maxsmart (documentation, issues)
First occurred: 9:30:31 PM (1 occurrences)
Last logged: 9:30:31 PM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 147, in post
return await super().post(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 846, in async_init
flow, result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 874, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/maxsmart/config_flow.py", line 45, in async_step_user
await self.hass.config_entries.flow.async_init(
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 846, in async_init
flow, result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 874, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/maxsmart/config_flow.py", line 64, in async_step_import
num_of_ports = await async_get_number_of_ports(self.hass, ip_address)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/maxsmart/config_flow.py", line 14, in async_get_number_of_ports
state = await hass.async_add_executor_job(device.check_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/maxsmart/maxsmart.py", line 128, in check_state
response = self._send_command(511)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/maxsmart/maxsmart.py", line 86, in _send_command
raise Exception("Failed to send command to power strip after multiple retries")
Exception: Failed to send command to power strip after multiple retries

Thanks for help.

6-Port Revogi Strip is not identified correctly

I have a 6-port Revogi Power Strip:

Details:
2023-08-11 19:03:07.083 INFO (MainThread) [custom_components.maxsmart.config_flow] Discovered devices without IP: [{'sn': 'SWW6010003003060', 'name': 'Revogi-Strip6326', 'pname': None, 'ip': '192.168.178.50', 'ver': '3.36'}]

As my revogi strip does not provide a "pname", the IF/ELSE for the #socket identification in function async def async_step_import() fails. I patched the function locally like this:

` pname = device.get("pname")
name = device.get("name")
# sw_version = device.get("ver")
port_data = {}

        if "Revogi-Strip" in name:
            port_data = {
                "master": {"port_id": 0, "port_name": "0. Master"},
                "individual_ports": [
                    {"port_id": 1, "port_name": "1. Port"},
                    {"port_id": 2, "port_name": "2. Port"},
                    {"port_id": 3, "port_name": "3. Port"},
                    {"port_id": 4, "port_name": "4. Port"},
                    {"port_id": 5, "port_name": "5. Port"},
                    {"port_id": 6, "port_name": "6. Port"}
                ],
            }
        elif pname is None:
            port_data = {
                "master": {"port_id": 0, "port_name": "0. Master"},
                "individual_ports": [
                    {"port_id": 1, "port_name": "1. Port"}
                ],
            }
        else:
            port_data = {
                "master": {"port_id": 0, "port_name": "0. Master"},
                "individual_ports": [
                    {"port_id": i + 1, "port_name": f"{i + 1}. {port_name}"}
                    for i, port_name in enumerate(pname)
                ],
            }`

May you have a cleaner fix for this...

pooling rate

how i can set the polling rate? default polling rate from 30 Seconds is for me to high

maxSmart

Hi
Thanks for doing this i have MaxSmart Sockets. But unfortunately I have already made a FW update to 2.xx, according to my test the instructions work exactly the same as with FW 1.xx.
So I can send via terminal the cmd commands analog to the instructions of altery. Unfortunately, I always get the following error message when trying to integrate my power strip with your plugin in HomeAssistant:

"Error
The configuration flow could not be loaded: 500 Internal Server Error Server got itself in trouble"

can you help me to fix this? 😅

Bad error handling

The integration has currently a pretty bad error handling.

It generates a lot of error messages in the log, i.e. if a device is not reachable.

I have little time currently to work on improvement, but I'll do my best to do something by end of year.

-beta in version tag violates HA versioning scheme

Component is broken due to the“-beta” in the version tag inside the manifest. May introduce patch level version numbers for betas.

Quickfix "removing -beta" resolves the issue. Testet in latest HA:
Home Assistant 2023.8.1
Supervisor 2023.08.1
Operating System 10.4

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.