Closed Barma-lej closed 2 years ago
I'm not familiar with the Javascript calls in HA yet (haven't ventured into Lovelace developing yet) - but. If you view the YAML definition of calling a service, from the developer console, it would look like this, calling the service with an entity_id rather than device_id.
service: landroid_cloud.setzone
data:
zone: '1'
target:
entity_id: vacuum.back_left
How this would translate to javascript calls I don't know.
Well, if i call a service with device_id
it works:
this.hass.callService('landroid_cloud', 'setzone', { device_id: 'b2433e6xxxxxxxxxxx978e42cd0749', zone: 1, });
Doesn't work with entity_id
However, if i call a service for vacuum everithing works
this.hass.callService('vacuum', 'set_fan_speed', { entity_id: 'vacuum.robi', fan_speed: 'Silent' });
this is what it looks like in the developer console
service: vacuum.set_fan_speed
data:
fan_speed: sw
target:
entity_id: vacuum.robi
Which model is your vacuum?
Landroid Worx M500 WR141E Attrs:
battery_level: 64
battery_icon: mdi:battery-60
accessories: null
battery:
cycles:
total: 829
current: 0
reset_at: null
reset_time: null
temperature: 30.2
voltage: 18.24
percent: 64
charging: false
blades:
total_on: 74308
reset_at: 61657
reset_time: '2022-04-19T07:04:53+02:00'
current_on: 12651
error:
id: 0
description: no error
firmware:
auto_upgrade: false
version: 3.26
locked: false
mac_address: privat
model: Landroid M500
online: true
orientation:
pitch: 1
roll: 2.9
yaw: 341.4
rain_sensor:
delay: 60
triggered: false
remaining: 0
schedule:
time_extension: 0
active: true
auto_schedule:
settings: {}
enabled: null
primary:
monday:
start: '11:00'
end: '12:30'
duration: 90
boundary: false
tuesday:
start: '11:00'
end: '12:30'
duration: 90
boundary: false
wednesday:
start: '11:00'
end: '12:30'
duration: 90
boundary: true
thursday:
start: '11:00'
end: '12:30'
duration: 90
boundary: false
friday:
start: '11:00'
end: '12:30'
duration: 90
boundary: false
saturday:
start: '11:00'
end: '12:30'
duration: 90
boundary: false
sunday:
start: '11:00'
end: '12:30'
duration: 90
boundary: true
secondary:
monday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
tuesday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
wednesday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
thursday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
friday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
saturday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
sunday:
start: '18:00'
end: '19:30'
duration: 90
boundary: false
serial_number: 20_12
status_info:
id: 7
description: mowing
time_zone: Europe/Berlin
zone:
current: 0
next: 0
index: 7
indicies:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
starting_point:
- 0
- 0
- 0
- 0
capabilities: Edge Cut, One-Time-Schedule, Party Mode, Motor Torque
mqtt_connected: true
supported_landroid_features: 15359
party_mode_enabled: false
rssi: -81
statistics:
worktime_blades_on: 74308
distance: 1194852
worktime_total: 77999
torque: -25
state_updated_at: 2022-07-20T11:39:19+02:00
device_class: landroid_cloud__state
friendly_name: Mower
supported_features: 12500
Not your mower, your vacuum ;) Need to see what the difference could be, as the code is as it should be and it reacts when you set at target entity_id in the developer tools
π i'm sorry
Roborock S50 Attributes:
fan_speed_list: Silent, Standard, Medium, Turbo, Gentle, Auto
battery_level: 100
battery_icon: mdi:battery-charging-100
fan_speed: Turbo
status: Charging
timers:
- enabled: false
cron: 37 15 * * 0,6
next_schedule: '2022-07-24T13:37:00+00:00'
friendly_name: Robi
supported_features: 14204
Which integration are you using for that one?
Okay - that integration are not using the new target attributes in services.yaml, so that's the difference. The Miio integration have a field called entity_id, that's not the new standard way ;)
So you need to figure out how to set a target in the javascript
But, call other services e.g. partymode, start, lock, without additionals options (zone: 1), are working well
Hmmm - will need to do some testing then. Is it your own landroid card you have this issue in?
Yes, the card is forked from vacuum card. I have seen a several cards and all of these cards call the services as described here
Doesn't seem like zone calls do anything in v0.1.9 - nothing happens, not even an error.
Yes, this is just a draft without calling any services.
Okay - that makes debugging pretty difficult :D
Returned in v0.2.0, executed with an error. Now you can debug π
Fixed in landroid-card version 0.2.2
https://github.com/MTrab/landroid_cloud/blob/a65160f7b385e7c3386a06582ada8d7b49a4b6fd/custom_components/landroid_cloud/services.py#L116
If called service without additional parmeters, e.g. lock
, partymode
your python code get service_data[CONF_ENTITY_ID]
as an array, otherwise as a string
Environment:
Describe the bug
Hi, Malene. The other day I have tried to call service
setzone
from javascript (Description). And get an error: _'NoneType' object has no attribute 'deviceid'Than i tried to change
raindelay
And again i got the same error
After that i decided to call
set_fan_speed
for my vacuum cleaner. And that works without any problemCan you please check this line
I'm not sure that's error in your integration, but i can't find errors in javascript too π
Debug log