Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WalkingPad A1 #261

Open
dmatora opened this issue Nov 27, 2021 · 70 comments
Open

WalkingPad A1 #261

dmatora opened this issue Nov 27, 2021 · 70 comments
Labels
miio2miot miot-cloud Need enabled miot_cloud

Comments

@dmatora
Copy link

dmatora commented Nov 27, 2021

Changelog says WalkingPad is supported, but when I add it with ip and token (whenever I enable cloud or not) I just get one sensor and it's not available. At the same time WalkingPad does respond to network requests

image

@al-one
Copy link
Owner

al-one commented Nov 27, 2021

Check for the device related logs.

@dmatora
Copy link
Author

dmatora commented Nov 27, 2021

This error originated from a custom integration.

Logger: custom_components.xiaomi_miot.sensor
Source: custom_components/xiaomi_miot/init.py:1086
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 16:22:55 (99 occurrences)
Last logged: 17:12:00

Xiaomi Miot Walking Pad Status: Got MiioException while fetching the state: {'code': -9999, 'message': 'user ack timeout'}, mapping: {'walking_pad.on': {'siid': 2, 'piid': 1}, 'walking_pad.mode': {'siid': 2, 'piid': 2}, 'walking_pad.status': {'siid': 2, 'piid': 3}, 'walking_pad.speed_level': {'siid': 2, 'piid': 4}, 'walking_pad.current_distance': {'siid': 2, 'piid': 5}, 'walking_pad.working_time': {'siid': 2, 'piid': 6}, 'walking_pad.current_step_count': {'siid': 2, 'piid': 7}, 'current_calorie_consumption-2-8': {'siid': 2, 'piid': 8}}, max_properties: 9/8

@al-one
Copy link
Owner

al-one commented Nov 29, 2021

It seems that your device may not support local mode. It is recommended that you integrate it through Xiaomi account (Automatic mode).

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

I have no issue controlling device using miiocli, if that's what you're talking about

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

Well, I tried Automatic mode and it helped.
Except that it won't poll or update speed

@al-one
Copy link
Owner

al-one commented Nov 29, 2021

I have no issue controlling device using miiocli, if that's what you're talking about

You can control through miiocli because it uses the miio protocol, not the miot protocol used by this component. If you want to integrate it through this component, Xiaomi cloud is required.


Except that it won't poll or update speed

Show me the state attributes of this entity.

@al-one al-one added the miot-cloud Need enabled miot_cloud label Nov 29, 2021
@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

options:
  - '0.5'
  - '1.0'
  - '1.5'
  - '2.0'
  - '2.5'
  - '3.0'
  - '3.5'
  - '4.0'
  - '4.5'
  - '5.0'
  - '5.5'
  - '6.0'
entity_class: MiotSelectSubEntity
parent_entity_id: sensor.ksmb_v1_d595_walking_pad_2
service_description: Walking Pad
property_description: Speed Level
walking_pad.speed_level: 1
unit_of_measurement: km/h
friendly_name: WalkingPad Walking Pad Speed Level
supported_features: 0

@al-one
Copy link
Owner

al-one commented Nov 29, 2021

Show me the state attributes of sensor.ksmb_v1_d595_walking_pad_2.

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

This is when speed is set to 1

model: ksmb.walkingpad.v1
lan_ip: 192.168.1.50
mac_address: 04:CF:8C:81:D5:95
firmware_version: 2.0.5
hardware_version: ''
entity_class: MiotSensorEntity
miot_type: urn:miot-spec-v2:device:walking-pad:0000A018:ksmb-v1:1
state_property: walking_pad.status
walking_pad.on: true
walking_pad.mode: 0
walking_pad.status: 1
walking_pad.speed_level: 1
walking_pad.current_distance: 170
walking_pad.working_time: 638
walking_pad.current_step_count: 546
current_calorie_consumption-2-8: 10570
state_updater: cloud
walking_pad.status_desc: Run
sub_entities:
  - walking_pad-2.current_distance-5
  - walking_pad-2.working_time-6
  - walking_pad-2.current_step_count-7
  - walking_pad-2.current_calorie_consumption-8
  - walking_pad-2.mode-2
  - walking_pad-2.speed_level-4
  - walking_pad-2.on-1
friendly_name: WalkingPad Walking Pad Status
supported_features: 0

this is when speed is set to 0.5

model: ksmb.walkingpad.v1
lan_ip: 192.168.1.50
mac_address: 04:CF:8C:81:D5:95
firmware_version: 2.0.5
hardware_version: ''
entity_class: MiotSensorEntity
miot_type: urn:miot-spec-v2:device:walking-pad:0000A018:ksmb-v1:1
state_property: walking_pad.status
walking_pad.on: true
walking_pad.mode: 0
walking_pad.status: 1
walking_pad.speed_level: 0.5
walking_pad.current_distance: 200
walking_pad.working_time: 758
walking_pad.current_step_count: 648
current_calorie_consumption-2-8: 12440
state_updater: cloud
walking_pad.status_desc: Run
sub_entities:
  - walking_pad-2.current_distance-5
  - walking_pad-2.working_time-6
  - walking_pad-2.current_step_count-7
  - walking_pad-2.current_calorie_consumption-8
  - walking_pad-2.mode-2
  - walking_pad-2.speed_level-4
  - walking_pad-2.on-1
friendly_name: WalkingPad Walking Pad Status
supported_features: 0

@al-one
Copy link
Owner

al-one commented Nov 29, 2021

There seems no issue.

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

There is obvious mismatch between 1 and 1.0

  1. When speed is 0.5 it's shown on UI, when speed is 1 - it's not

image

image

  1. Besides that only 1 of 3 controls are working, changing speed or mode has no effect

al-one added a commit that referenced this issue Nov 29, 2021
al-one added a commit that referenced this issue Nov 29, 2021
@al-one
Copy link
Owner

al-one commented Nov 29, 2021

  1. When speed is 0.5 it's shown on UI, when speed is 1 - it's not

Fixed in 47a39fc


  1. Besides that only 1 of 3 controls are working, changing speed or mode has no effect

Are there any logs after change mode.

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

Well, actually mode works, but it's label is misleading (changing manual to standby, not auto)
Speed does't work, log after changing speed is
Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

al-one added a commit that referenced this issue Nov 29, 2021
@al-one
Copy link
Owner

al-one commented Nov 29, 2021

The label of working mode is from miot-spec. if you want to change it, you can configure translations.

# configuration.yaml
xiaomi_miot:
  translations:
    walking_pad.mode:
      none: manual
      auto: standby

Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

This log is not related to the set speed. Maybe you can try to upgrade to the master branch (commit: 26c2cfd), which will generate a number entity for the speed level, and the old select entity will become unavailable and can be deleted.

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

Ok, I was wrong, "auto" is labeled currently (was checking at custom app which displays it wrong)
Latest master fixes both read and write for the speed, although I'm not a big fan of number entity UI, since it requires extra effort to see the value. Personally I'd prefer a dropdown

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

Is there no way you could add autostart on/off toggle and selecting autostart speed? Both features are available over miio protocol

@dmatora
Copy link
Author

dmatora commented Nov 29, 2021

Also is there a way to specify poll frequency? right now it's not very frequent

@al-one
Copy link
Owner

al-one commented Nov 30, 2021

Is there no way you could add autostart on/off toggle and selecting autostart speed? Both features are available over miio protocol

Sorry for my English, I don't quite understand this sentence.

@al-one
Copy link
Owner

al-one commented Nov 30, 2021

Also is there a way to specify poll frequency? right now it's not very frequent

# customize.yaml
sensor.ksmb_v1_d595_walking_pad_2:
  interval_seconds: 20 # seconds

Customization Using The UI

@dmatora
Copy link
Author

dmatora commented Nov 30, 2021

Sorry for my English, I don't quite understand this sentence.

Two most critical features are still missing

  1. set autostart speed
  2. enable/disable autostart

@al-one
Copy link
Owner

al-one commented Nov 30, 2021

They don't seem to be defined in the miot-spec of the device, but maybe you can call them through service: xiaomi_miot.send_command:

service: xiaomi_miot.send_command
data:
  entity_id: sensor.ksmb_v1_d595_walking_pad_2
  method: miio_method
  params: []

@dmatora
Copy link
Author

dmatora commented Nov 30, 2021

That works!

 method: set_auto
 params: [0]

does disable autostart
and

 method: set_auto
 params: [1]

does enable it
do you think this can be added to ui within the component?

@al-one
Copy link
Owner

al-one commented Nov 30, 2021

Get miio state to entity attributes:

# customize.yaml
sensor.ksmb_v1_d595_walking_pad_2:
  miio_properties: auto

Create a switch entity via template:

# configuration.yaml
switch:
  - platform: template
    switches:
      skylight:
        value_template: |
          {{ state_attr('sensor.ksmb_v1_d595_walking_pad_2', 'miio.auto') | int == 1 }}
        turn_on:
          service: xiaomi_miot.send_command
          data:
            entity_id: sensor.ksmb_v1_d595_walking_pad_2
            method: set_auto
            params: [1]
        turn_off:
          service: xiaomi_miot.send_command
          data:
            entity_id: sensor.ksmb_v1_d595_walking_pad_2
            method: set_auto
            params: [0]

@dmatora
Copy link
Author

dmatora commented Dec 1, 2021

is there a way to set units for steps?
Time has units and it's history is show as graph
image
steps don't have units and it's history is useless
image

@al-one
Copy link
Owner

al-one commented Dec 1, 2021

Set unit_of_measurement via customization.

@dmatora
Copy link
Author

dmatora commented Dec 1, 2021

When I add

sensor.ksmb_v1_d595_walking_pad_2:
  sensor_properties: auto

to customize.yaml integration stops working
image
this is what I get in log

Logger: custom_components.xiaomi_miot.core.xiaomi_cloud
Source: custom_components/xiaomi_miot/core/xiaomi_cloud.py:163 
Integration: Xiaomi Miot Auto (documentation, issues) 
First occurred: 8:34:00 PM (48 occurrences) 
Last logged: 9:13:03 PM

Request miot api: miotspec/prop/get {'params': [{'did': '130967143', 'siid': 2, 'piid': 1}, {'did': '130967143', 'siid': 2, 'piid': 2}, {'did': '130967143', 'siid': 2, 'piid': 3}, {'did': '130967143', 'siid': 2, 'piid': 4}, {'did': '130967143', 'siid': 2, 'piid': 5}, {'did': '130967143', 'siid': 2, 'piid': 6}, {'did': '130967143', 'siid': 2, 'piid': 7}, {'did': '130967143', 'siid': 2, 'piid': 8}]} failed, result: None
Request miot api: miotspec/prop/get {'params': [{'did': '120524991', 'siid': 2, 'piid': 3}]} failed, result: None

@dmatora
Copy link
Author

dmatora commented Dec 17, 2021

Well since I updated master I can't get walkingpad working at all.
Except writing autostart value - that works.
I was hoping it's just a temporary server problem, but it's been dead for a few days.
This is what I get in logs

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_miot/core/xiaomi_cloud.py:409 
Integration: Xiaomi Miot Auto (documentation, issues) 
First occurred: 1:35:02 PM (1 occurrences) 
Last logged: 1:35:02 PM

Update for humidifier.zhimi_cb1_7ee7_humidifier fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.9/http/client.py", line 1371, in getresponse
    response.begin()
  File "/usr/local/lib/python3.9/http/client.py", line 319, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.9/http/client.py", line 280, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.9/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.9/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 447, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.io.mi.com', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in async_device_update
    await task
  File "/config/custom_components/xiaomi_miot/humidifier.py", line 78, in async_update
    await super().async_update()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1054, in async_update
    results = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 47, in get_properties_for_mapping
    rls = self.get_props(pms)
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 62, in get_props
    return self.request_miot_spec('prop/get', params)
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 71, in request_miot_spec
    rdt = self.request_miot_api('miotspec/' + api, {
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 151, in request_miot_api
    rsp = self.request(self.get_api_url(api), params)
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 409, in request
    response = self.session.post(url, data=post_data, timeout=self.http_timeout)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.io.mi.com', port=443): Read timed out

@dmatora
Copy link
Author

dmatora commented Dec 17, 2021

But it would be really awesome to be able to specify props I want to bу red and written using miio protocol (is that what you just implemented?), since devices like walkingpad can not be added to local server (tried both Russia and UK and it's not supported) and connection with China server from Russia is very poor (not to mentioned local performance is always much better than cloud).

I have other devices that can only be added to China server and they also keep failing off.

@al-one
Copy link
Owner

al-one commented Dec 23, 2021

Do you know what the miio properties corresponding to each property here is ?

on: true # ?
mode: 0 # mode or auto ?
status: 0 # ?
speed_level: 0.5 # start_speed
current_distance: 0 # dist
working_time: 3 # time
current_step_count: 0 # step
current_calorie_consumption: 0 # cal

@dmatora
Copy link
Author

dmatora commented Dec 26, 2021

There is a discussion about miio protocol for WalkingPad here rytilahti/python-miio#797
But it doesn't mention get_prop ["all"] which I currently use to get response like this

['mode:2', 'time:0', 'sp:0.0', 'dist:0', 'cal:0', 'step:0']

it's critical to use get_prop ["all"] because each get_prop takes about second to complete, and commands can not be processed in parallel

on -> mode (true->1, false->2)
mode -> mode (true->0, false->1)
status -> state (0 -> stop, 1 -> run)
speed_level -> sp
current_distance -> dist
working_time -> time
current_step_count -> step
current_calorie_consumption -> cal

@al-one
Copy link
Owner

al-one commented Dec 27, 2021

It seems that the state is not in the list. Does it need to be obtained separately?

@dmatora
Copy link
Author

dmatora commented Dec 27, 2021

unfortunately yes

@dmatora
Copy link
Author

dmatora commented Dec 27, 2021

same as start_speed to check autostart speed and auto to check if autostart is enabled or not

@al-one
Copy link
Owner

al-one commented Jan 6, 2022

get_prop '["state"]' will return to running status ?
How long will it take to execute again ?

@dmatora
Copy link
Author

dmatora commented Jan 9, 2022

Happy New Year! :)
Yes.
About a second for each get_prop

@al-one
Copy link
Owner

al-one commented Jan 10, 2022

🎉 Now the device supports local mode. You can update to the master branch and try again.

'ksmb.walkingpad.v1': {
# https://github.com/al-one/hass-xiaomi-miot/issues/261#issuecomment-1001213758
# ['mode:2', 'time:0', 'sp:0.0', 'dist:0', 'cal:0', 'step:0']
'without_props': True,
'miio_commands': [
{
'method': 'get_prop',
'params': ['all'],
'values': ['mode', 'time', 'speed', 'dist', 'calorie', 'step'],
},
{
'method': 'get_prop',
'params': ['state'],
'values': ['state'],
'delay': 1,
},
],
'miio_specs': {
'prop.2.1': {
'prop': 'mode',
'setter': True,
'template': '{{ (value|string).split(":")[1]|default(2)|int != 2 }}',
'set_template': '{{ [1 if value else 2] }}',
},
'prop.2.2': {
'prop': 'mode',
'setter': True,
'template': '{{ 1 if (value|string).split(":")[1]|default(2)|int else 0 }}',
'set_template': '{{ [0 if value else 1] }}',
},
'prop.2.3': {'prop': 'state', 'template': '{{ value | int(0) }}'},
'prop.2.4': {
'prop': 'speed',
'setter': True,
'template': '{{ (value|string).split(":")[1]|default(0)|round(1) }}',
'set_template': '{{ [value|round(1)|string] }}',
},
'prop.2.5': {'prop': 'dist', 'template': '{{ (value|string).split(":")[1]|default(0)|int }}'},
'prop.2.6': {'prop': 'time', 'template': '{{ (value|string).split(":")[1]|default(0)|int }}'},
'prop.2.7': {'prop': 'step', 'template': '{{ (value|string).split(":")[1]|default(0)|int }}'},
'prop.2.8': {'prop': 'calorie', 'template': '{{ (value|string).split(":")[1]|default(0)|int }}'},
},
},

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

How do I enable it?
check_lan or miot_local?
miot_local seems to be not working gonna test check_lan and see how it goes

@al-one
Copy link
Owner

al-one commented Jan 10, 2022

You only need to upgrade to the master branch and access it through automatic mode (account). I think it should also be possible through token.
Without any customize.

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

Tried adding using ip/token
image

@al-one
Copy link
Owner

al-one commented Jan 10, 2022

Any error/warning logs ?

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

Do I need to remove and add back automatic mode?
This is what it shows after master update for the walkingpad
image

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

Here is what I get in log for ip/token (disabled everything else)

Walkingpad Walking Pad Status: Got MiioException while fetching the state: {'code': -9999, 'message': 'user ack timeout'}, mapping: {'walking_pad.on': {'siid': 2, 'piid': 1}, 'walking_pad.mode': {'siid': 2, 'piid': 2}, 'walking_pad.status': {'siid': 2, 'piid': 3}, 'walking_pad.speed_level': {'siid': 2, 'piid': 4}, 'walking_pad.current_distance': {'siid': 2, 'piid': 5}, 'walking_pad.working_time': {'siid': 2, 'piid': 6}, 'walking_pad.current_step_count': {'siid': 2, 'piid': 7}, 'current_calorie_consumption-2-8': {'siid': 2, 'piid': 8}}, max_properties: 9/8

@al-one
Copy link
Owner

al-one commented Jan 10, 2022

Try edit delay to 1.5 or 2 in your local file.

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

Something must be broken with HACS, I tried to update to latest master using HACS and file content didn't change.
I updated it manual and device became available
I know from experience that 1 second doesn't provide reliable readings, so I changed delay to 2 (that's what I use in my iOS app)
calorie, distance, step count, and time are working
status always shows stop

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

'prop.2.3': {'prop': 'state', 'template': '{{ 1 if value == "run" else 0 }}'},
Fixed status

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

Speed and switch status are working for both read and write
Mode is only working for write (always showing Auto and when it's not) <- not something I can about personally, just saying

@dmatora
Copy link
Author

dmatora commented Jan 10, 2022

I'm not getting reading for autostart, event after adding

  miio_commands:
    - method: get_prop
      params: ['auto']

Update: but I can see it in state, hmm...
Update: Changing {{ state_attr('sensor.ksmb_v1_d595_walking_pad', 'miio.auto') | int == 1 }} to {{ state_attr('sensor.ksmb_v1_d595_walking_pad', 'auto') | int == 1 }} fixed autostart

@al-one
Copy link
Owner

al-one commented Jan 11, 2022

Can't the mode attribute reflect the state of auto ?
If it is included in the mode state, can it not be obtained (get_prop "['auto']") again ?

[
    {
        'method': 'get_prop',
        'params': ['all'],
        'values': ['mode', 'time', 'speed', 'dist', 'calorie', 'step'],
    },
    {
        'method': 'get_prop',
        'params': ['auto'],
        'values': ['auto'],
        'delay': 2,
    },
    {
        'method': 'get_prop',
        'params': ['state'],
        'values': ['state'],
        'delay': 2,
    },
]

In this way, each time the status of the device is obtained, it will be blocked for 4 seconds.

@al-one
Copy link
Owner

al-one commented Jan 11, 2022

Upgrade to master branch and try again. Without miio_commands.

@dmatora
Copy link
Author

dmatora commented Jan 11, 2022

it will be blocked for 4 seconds

You right, that's an issue. If we add autostart speed check, it will be blocked for 6 seconds, and what's more important controls will be unreliable. In my IOS app I solve that by prioritising controls over sensors, so that each sensor check is suspended until there are no control commands pending

Simpler solution would be to use 3-4 second delay instead of 1-2, so that after each sensor check there is enough room for another control command

@al-one
Copy link
Owner

al-one commented Jan 11, 2022

Unfortunately, the component cannot execute multiple commands asynchronously to obtain the device status.
Can the latest commit work?

@dmatora
Copy link
Author

dmatora commented Jan 11, 2022

Can't the mode attribute reflect the state of auto ?

There are two different things.

Mode enables both start/stop and speed control by moving your position over walkingpad (speed increases when you step front, and decreases when you step back) - something I never use since I want walkingpad to always run at 1km/h

Auto only enables walkingpad start/stop by stepping front/back, something original app calls intelligent start type for manual mode - that's what I use and enhance by enabling auto when walkingpad is stopped, and disabling when it's running, so that it autostarts each time I step on it, but doesn't stop if I get distracted and step on back accidentally (which happens a lot and is really irritating)

@dmatora
Copy link
Author

dmatora commented Jan 11, 2022

Just checked last master, reading "walking pad mode" now works but writing doesn't
Maybe UI should present it as 3 values radio ("Off", "Manual", "Auto"), like what mode is internally
Then you can build proper set_template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
miio2miot miot-cloud Need enabled miot_cloud
Projects
None yet
Development

No branches or pull requests

2 participants