[APP][Pro] Home Assistant - Community App

The compound can’t be used to control lights. Lights are more complex with several attribibutes/capabilities and services.
So you could add switch entity but no light dim/color.
The dim capability is used to add a slider to change input_number entities (and its state). It can’t be used for light dim as this would need special entity dependent logic.

If you are able to rename your power to the light name with suffix _power, then this sensor will be added automatically. See this post:

Another way is not possible yet.
If that’s not possible, you can only add your power sensors into one compound and keep lights separated. So you would have a power meter device for all lights. It’s not the same but perhaps a workaround.

1 Like

This should be possible with capabilitiesConverters. I can provide an example later.

1 Like

While thinking about a solution I got the idea of adding a device setting field for lights to set a power sensor entity name manually and this will be used instead of the default _power sensor.
I will check this and add it in the next version if possible. I’give you a a feedback…

2 Likes

Thanks - I will try the _power and see if that works as well.
UPDATE: yes worked with changing to _power. thx!

1 Like

Hi,
the current app version only uses capabilityConverters for a apabilities, not for subcapabilities. I will add support for subcapabilities in the next version.

For now you can add:

  capabilitiesConverters:
    measure_numeric: 
      from: (state) => { return Math.round(state*100) / 100; }

This rounds on 2 decimal places (1st x100, then round on full integer, then /100 for 2 decimals).
The capabilityConverter uses a JavaScript function to convert the capability value “state”.
The conversion will be processed for all measure_numeric capabilities (so for all your entities).
The next app version will provide the possibility to add a converter for only a specific entry (e.g. measure_numeric.consumption_cost).

1 Like

Hi Ronny - Thanks for your help - I tried to change the configuration as suggested (with 3 decimals/1000) but it does not seem to work:

Oh, I forgot… The compound definition is stored in the Homey device. You need to remove and re-add the device to Homey to take effect.

Great! Now it works - THANK YOU!

1 Like

New test version 0.5.2:

  • For lights it’s now possible to use the duration setting in flow cards:
    Add the duration in AdvancedFlow via context menu:
    grafik grafik
    Some light doesn’t seem to support a duration on turning off. If that doesn’t work with your light, use “dim to 0%” with duration. This should dim and the 0% dim value should turn off the light at the end.

  • Customizeable power entity for lights.
    You can set now your own power entity providing the energy usage for the light in device settings.
    grafik

  • Compound device:
    capabilityConverters have been possible only for capability yet. Now you can use them for subcapabilities, too.

CapabilityConverter example:

Example for capability level. This will use the converter for all measure_numeric capabilities of this compound. This example rounds the value from HA to 2 decimals.

yamaha:
  name: Yamaha Receiver
  capabilities:
    measure_numeric.vol: media_player.yamaha_receiver.volume_level
  capabilitiesTitles:
    measure_numeric.vol: Volume
  capabilitiesConverters:
    measure_numeric: 
      from: (state) => { return Math.round(state*100) / 100; }

Example for subcapability level. This will use the converter only for the set capability.

yamaha:
  name: Yamaha Receiver
  capabilities:
    measure_numeric.vol: media_player.yamaha_receiver.volume_level
  capabilitiesTitles:
    measure_numeric.vol: Volume
  capabilitiesConverters:
    measure_numeric.vol: 
      from: (state) => { return Math.round(state*100) / 100; }
5 Likes

Just had another go with this app. Had some issues in the beginning but know it works like charm! THANKS!

An example for compoundConversion to convert a UTC/ISO date to your locale version:

I use the current date/time entity from HA as example:

grafik

And I try to get this localized version:

grafik

Add your datetime entity and the conversion function.
Exchange the locale (de-DE) and the timezone (Europe/Berlin) with your values.
Keep the quotation marks - outside " " and inside ' '

datetime:
  name: DateTime
  capabilities:
    measure_generic: sensor.date_time_iso
  capabilitiesConverters:
    measure_generic: 
      from: "(state) => { return new Date(state).toLocaleString('de-DE', {hour12s: false, timeZone: 'Europe/Berlin', hour: '2-digit', minute: '2-digit', day: '2-digit', month: '2-digit', year: 'numeric' }); }"

If your time entity has already the local time without timezone, you can use this converter without the zone:

  capabilitiesConverters:
    measure_generic: 
      from: "(state) => { return new Date(state).toLocaleString('de-DE', {hour12s: false, hour: '2-digit', minute: '2-digit', day: '2-digit', month: '2-digit', year: 'numeric' }); }"

You can also adjust the parameter of the toLocaleString() function.
Reference: JavaScript Date toLocaleString() Method

I recognized that some light flow cards are not working after changing the duration logic.
An update is in progress :slight_smile:

Update: Test version 0.5.3 is online. Light flows should work now again. If now, please give me a feedback. Thanks.

Nice work. For me work nicely

New test version 0.5.4:

  • Added app log to device repair view.
    You will need this only in rare cases. But it could be helpful to see the log if you added a faulty compound conversion that won’t work as expected. In this case the log can show you the faulty part.
    grafik
    grafik
5 Likes

Is there anyone here who would like to test the vacuum cleaner device?
Either via Github/CLI or as a test version via the store.
I tried to add the cleaner to the app but can’t test it myself.

And don’t expect too much from the vaccum device. The HA entity only has a state and some services.

2 Likes

YEAH! Count me in! :smiley::smiley: I have 2 Xiaomi Roborock S50 devices to test with.

Ecovacs Deebot Slim2:
Works with start / stop (and it returns to base)!
It’s the only function of the HA integration :hugs: so this is it :wink:

1 Like

What lasts long will be good: Test version 0.5.15
Vacuum device should be ready now.
grafik

It has only a state (readonly) and some buttons / flow actions for commands. Please try and report if there are still issues.

2 Likes

New test version 0.5.17:
The vacuum state is changed from picker to sensor. It was not possible to hide the error message on attemps to change the state using the picker. So it’s a sensor now showing the (translated) state defined by HA.
For devices using an own state list I added a raw state sensor showing the original state delivered by HA.
In addition there is a error message sensor showing a message in case of state=error.

The device tile will switch like a light tile between on and off depending on the device state (if the HA entitiy supports ON/OFF feature).

2 Likes

Thanks again Ronny! Working like a charm now.

Marcel, how’s things going with the RoboBobs?

1 Like