landroid_cloud
landroid_cloud copied to clipboard
[FR]: Party Mode Setter to Enable/Disable (not just toggling)
Is your feature request related to a problem? Please describe. Currently, the party mode can only get toggled.
Toggling only makes certain automations quite complicated. For instance, I'd like to enable the party mode whenever someone gets home and disable it when the house is empty. Currently, I either need to fetch the current party mode state manually before each action (which may be quite unconvenient e.g. in Home Assistant) or the automation result depends "randomly" on the last state.
Describe the solution you'd like In addition to toggling, it would be really cool, if one can explicitly request to enable or disable the party mode. If the requested state already equals the current one, nothing happens. Otherwise, it gets updated.
Describe alternatives you've considered As described above, one could workaround this by checking the current state manually each time on the client side.
Additional context I just had a quick look at your implementation and it looks like your toggling feature is actually using a regular setter method already. Thus, I hope there isn't any limiting API issue and an implementation should be quite straight forward?
Define 'unconvinient' - it's no problem fetching the current state in a selector ;)
If my goal is to "set the party mode to on", I feel like it is indeed inconvenient having to replace that action with "is the party mode on already? then don't do anything, otherwise toggle". Of course that shouldn't be a too big deal to live with this limitation. However, in my opinion the basic setter is a low-level-feature which rather makes sense to include it in the API instead of letting the user deal with it.
I tried setting it up in Home Assistant with Node Red. As a Home Assistant beginner, I found it very easy to just trigger an existing service. However, I completely failed when trying to get the attribute of an entity in the first place. It's at least more tricky than just dealing with the state of an entity or calling a service. Probably I'm missing something obvious there and it's easy for a non-noob user.
Moreover, the atomic setter could prevent race conditions, which may occur in the workaround (assuming that the worx API has an atomic setter).
Just thinking out loud. If you agree with me and like to add it to your project, great! If you just don't have time to add it, I may propose a PR at some time? If you don't like that feature in the first place, feel free to close this issue.
Point taken - will make the change, althou this will be a low priority :)
Awesome. I appreciate that!
Hello i´d also like to have the party mode as a entities, so i can toggle with the condition . I like to set party modus when the weather sensor reports rain. so the landroid don´t hs to start from the garage and if party mode is set - this will work.
Hello i´d also like to have the party mode as a entities, so i can toggle with the condition . I like to set party modus when the weather sensor reports rain. so the landroid don´t hs to start from the garage and if party mode is set - this will work.
It will be as a service, not an entity
Hello for the Partymode i now have the Solution if it is raining. And so the toggle is no problem if the condition looks how the party mode is:
Here is my YAML: alias: Regen-Partymodus Landroid an description: "" trigger:
- type: moist platform: device device_id: 9b041cdb8f10a636e4dd211441ac19ab entity_id: binary_sensor.hip_wettersensor_raining domain: binary_sensor condition:
- condition: numeric_state entity_id: vacuum.mower attribute: party_mode_enabled below: 1 action:
- service: landroid_cloud.partymode data: {} target: entity_id: vacuum.mower mode: single.
in visuell it looks likes like that:
i hope this will help other users to find how to look for the service
@Johnson145 it is in the latest beta version. Can you test so this issue can be closed?
Hey,
I just started to use the implementation today and habe 3.0.0b5. If I got it right, now the service is always a toggle, right? I played arround in the DEVL section, and nevertheless what I choose, if enabled true or false, there is a toggle.
I was wondering how to react realy on the state. Or is this a bug?
Set to on:
service: landroid_cloud.partymode
data:
party_mode_enabled: true
target:
entity_id: vacuum.james
Set to off:
service: landroid_cloud.partymode
data:
party_mode_enabled: false
target:
entity_id: vacuum.james
Without having a look to the current state, it will always toggle.
It is meant to do both, toggle if no party_mode_enabled is provided and set otherwise. I looked into this and found that I introduced a bug. I just put out a PR to fix this. Have to wait for @MTrab to merge this into a new beta.
Ah, good to know, that means I was not that stupid :) In the meanwhile I tried to check it in forhand.
Thanks for your work on this.
Thanks for the update and the information! I'll wait for the associated bugfix and will be glad to test the feature afterwards, too.
Fixed in #353
Thanks for the fix, it is working.