[App][Pro] Color Tools

Thanks a bunch @Caseda I’ll have a look into it.

Hi @Torch1969,
Update is out and waiting for review by Athom. You can grad it for testing from the test channel already if you like.

Thanks again to @Caseda for pointing me to this fancy feature :smiley:

2 Likes

I can confirm it’s working :slight_smile:

Thx a lot @Shakesbeard for this very fast “service” for implementing my feature request.

:beers: or :coffee:

1 Like

Cheers! Thanks for your support :slight_smile:

Hi Guys,

Hopefully, someone can help me.

I’m trying to convert color from Hue degree to decimal format, but unfortunately, it doesn’t work or I do not know how to do this.

Can the Color Tools App convert Hue 0-360° (color in degrees) to decimal notation?

In Homey I have a virtual device with Hue color capabilities that are stored in decimal notation.

Homey uses the following standard for this light capability.

I have a remote touch panel that sends color in Hue 0-360° degrees to my Homey, but I don’t know how to convert this to decimal notation.
image

Example of an MQTT message I receive on my Homey from the touch panel.
image

I have tried a lot of conversion methods in my flow. Maybe it can be done with simple (or complex) math (Trigonometry), but I do not know how.

Thanks!

No need for complex calculations, just devide by 360 to go to percentage (0.00 - 1.00) that Homey uses, you might need to round it to 2 decimals:
{{ round(VARIABLE / 360, 2) }}

3 Likes

Many thanks Caseda, this work great.

My “Virtual devices” is now changing to the correct colors when I touch the Hue slider on my wall touch panel.

The “temporary variable” app can’t be used for the calculation, it does some strange things with the values, maybe because it has rounding built in, so I used the “Better Logic” app for that. I leave this here in case someone else needs it.

Again many thanks I’m very happy with this.

1 Like

Please see my answer above it works. No idea why your name is not attached to my post. I used the right reply button as far as I know.

I did receive the notification :wink:, but as it is the direct reply (no messages in between) it doesn’t have to show what the reply is on.

@spkesDE, can you say something about it?

There is no rounding in the decimal card. The “full numbers” card is simple Math.Round() same as BLL using.

I don’t know if it has something to do with rounding, but the outcome of both methods was different.

Please see below the flow and calculation I used and their results.

image

You used the wrong flow card, you need the Calculate as Decimal Number also it doesn’t need {{}} you just could enter #Number 1/360

Please can you tell me witch (then) flow card is the right one? I used ADV.

My problem is already fixed, but maybe interesting for the future or someone else.

image

1 Like

Yeah, for bll you are actually not using bll-expression (which is just javascript basicly), but you are using an homey/athom coding, which is directly returned bij the bll expression. :slight_smile:
Works fine ofc, nothing wrong with it, but hardly bll-coding :wink:

@spkesDE just fyi: but there is not a default rounding or anything in bll expressions, you would have to write Math.round yourself if you wish to round in bll.

1 Like

Haha, jep, same code for BLL :wink:

I see examples how to convert hex to separate colors. But is it also possible to do it the other way around?

Trying to convert hue and saturation from a virtual device to hex and then sent the hex number thru Homesh to my other homey to control mi light color card.

You can try formatting an input string like ‘hsl 0, 1.0, 0.5’. See examples section at the top.

Thanks for your reply, I now see I can’t sent a hex value to a color card, so I need to sent it separate to color and saturation card. The strange thing is you can select a color with saturation levels in de color section card and see the hex value, but it only had a trigger and color input I guess.