question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable content xiaomi_miot.call_action formating

See original GitHub issue

Hi Guys,

I know that this is not an issue fully related to this git but may someone can help me. I try to create a service to send my vacuum to a room If I hardcode the room everything works fine.

service: xiaomi_miot.call_action
data:
  entity_id: vacuum.dreame_p2187_51af_robot_cleaner
  siid: 4
  aiid: 1
  params:
    - piid: 1
      value: 18
    - piid: 10
      value: '{"selects":[[6,1,0,2,1]]}'
  force_params: true

but if I try adding a variable with the parameters inside it does not work. As it looks in the debugger it is formating that JSON parameter as a yaml.

service: xiaomi_miot.call_action
data:
  entity_id: vacuum.dreame_p2187_51af_robot_cleaner
  siid: 4
  aiid: 1
  params:
    - piid: 1
      value: 18
    - piid: 10
      value: '{"selects":{{someVariable}}}'
  force_params: true

What am I doing wrong?

Debugger shows:

Executed: February 9, 2022, 13:06:44 Result:

params:
  domain: xiaomi_miot
  service: call_action
  service_data:
    entity_id: vacuum.dreame_p2187_51af_robot_cleaner
    siid: 4
    aiid: 1
    params:
      - piid: 1
        value: 18
      - piid: 10
        value:
          selects:
            - - 1
              - 2
              - 2
              - 2
              - 1
            - - 2
              - 2
              - 2
              - 2
              - 2
            - - 3
              - 2
              - 2
              - 2
              - 3
            - - 4
              - 2
              - 2
              - 2
              - 4
    force_params: true
  target: {}
running_script: false
limit: 10

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Bloodpilotcommented, Feb 11, 2022

Got it working, the solution is:

  service: xiaomi_miot.call_action
  data:
    entity_id: vacuum.dreame_p2187_51af_robot_cleaner
    siid: 4
    aiid: 1
    params: >-
      [
        {
          "piid": 1,
          "value": 18
        },
        {
          "piid": 10,
          "value": "{\"selects\":{{someVariable}}}"
        }
      ]
    force_params: true
0reactions
Bloodpilotcommented, Feb 10, 2022

I think it is just shown like that as it is not valid JSON string as soon as it get’s one it is interpreted as yaml.

Read more comments on GitHub >

github_iconTop Results From Across the Web

hass-xiaomi-miot/miot_spec.py at master - GitHub
Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. - hass-xiaomi-miot/miot_spec.py at master ...
Read more >
Xiaomi Miio - Home Assistant
Instructions on how to integrate Xiaomi devices using the Xiaomi Miio integration within Home Assistant.
Read more >
Building Topic-Driven Virtual IoTs in a Multiple IoTs Scenario
The unsupervised approach tries to partition a MIoT into a set of virtual IoTs characterized by the maximum internal cohesion (in terms of...
Read more >
A machine learning based sentient multimedia framework to ...
As with SIoT and MIoT, end users are involved in the whole process, ... site by collecting their raw spatio-temporal trajectory data and ......
Read more >
Qualcomm Corporate Responsibility Report
2021 Qualcomm Corporate Responsibility Report | Table of Contents ... to enable massive Internet of Things (mIoT) that ... The new format allowed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found