Skip to content

Commit 9873652

Browse files
committed
Merge math compare and gradient map flow cards
2 parents 9c97acf + f892274 commit 9873652

20 files changed

Lines changed: 1304 additions & 74 deletions

HOMEY_COMMUNITY_LISTING.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
URL: https://community.homey.app/t/app-smart-components-toolkit-was-boolean-toolbox-create-advanced-logic-with-simple-formulas/143906
22

3-
Title: [APP] Smart (Components) Toolkit (was: Boolean Toolbox) - Create advanced logic with simple formulas [v1.10.16 test - Device ID resolver for Flow Doctor]
3+
Title: [APP] Smart (Components) Toolkit (was: Boolean Toolbox) - Create advanced logic with simple formulas [v1.10.16 store / v1.10.17 test - Math Compare and Gradient Map]
44

55
Content:
66
![xlarge|690x483](upload://iSxhJPUltgcgPQ7gy4z5iisCv5F.jpeg)
77

8-
# Smart (Components) Toolkit — stable v1.10.9 / test v1.10.16
8+
# Smart (Components) Toolkit — store v1.10.16 / test v1.10.17
99

1010
> **📚 Full Documentation:** https://tiwas.github.io/SmartComponentsToolkit/
1111
@@ -15,22 +15,22 @@ Replace complex flow networks with powerful logic devices controlled by dynamic
1515

1616
---
1717

18-
## Changelog
18+
## What's new
1919

20-
### v1.10.16 (test channel)
20+
### v1.10.17 (test channel)
2121

22-
- Captures Homey device IDs and names so <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/flow-doctor.html" target="_blank">Flow Doctor</a> can resolve references to previously deleted devices.
23-
- <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/flow-doctor.html" target="_blank">Flow Doctor</a> now shows resolved device names, or `N/A (ID: ...)` when a deleted device was never captured by the app.
22+
- **Math Compare (And card).** Calculate one value with `+`, `-`, `*` or `/`, then compare the result with another value. Useful for rules like `temperature + 3 is greater than high_threshold`.
23+
- **Gradient Map (Then card).** Map an input value from one range to another and expose the result as a `Mapped value` tag for the next card. Supports range offsets and configurable rounding, for example mapping `18-23` degrees into fan speed `100-500`.
2424

2525
---
2626

2727
## ✨ Circadian Light Group — now on stable
2828

29-
A virtual **light device** that adjusts brightness and color temperature for a group of real lights — automatically following a circadian rhythm. Stable is currently v1.10.9; v1.10.16 is available on the test channel.
29+
A virtual **light device** that adjusts brightness and color temperature for a group of real lights — automatically following a circadian rhythm. Store is currently v1.10.16; v1.10.17 is available on the test channel.
3030

31-
### 🆕 What's new in 1.10.x
31+
### Circadian Light Group highlights
3232

33-
- **Device ID resolver (v1.10.16 test).** The app now captures Homey device IDs and names so <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/flow-doctor.html" target="_blank">Flow Doctor</a> can resolve references to previously deleted devices.
33+
- **Device ID resolver (v1.10.16).** The app now captures Homey device IDs and names so <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/flow-doctor.html" target="_blank">Flow Doctor</a> can resolve references to previously deleted devices.
3434
- **Parallel device writes (v1.10.7).** Multi-device flow actions and the scheduler push to up to 5 lights at the same time instead of one-after-another. A 16-light "turn on all" goes from minute-scale to seconds.
3535
- **Last-write-wins on conflicting commands (v1.10.7).** Trigger "all off" right after "all on" and the off command supersedes the in-flight on, instead of fighting it on every lamp. Each pass also verifies the on/off state afterwards and serially retries transient Z-Wave / Zigbee timeouts.
3636
- **Group-level "Turn on / off all members" actions (v1.10.7).** Convenience cards that switch every enabled light in the group, respecting the current circadian dim/temperature when turning on.
@@ -76,9 +76,9 @@ Choose how the device knows how bright it is outside:
7676

7777
<a href="https://tiwas.github.io/SmartComponentsToolkit/docs/circadian-light-group.html" target="_blank">→ Read full Circadian Light Group guide</a>
7878

79-
<a href="https://homey.app/en-no/app/no.tiwas.booleantoolbox/" target="_blank">→ Install stable v1.10.9</a>
79+
<a href="https://homey.app/en-no/app/no.tiwas.booleantoolbox/" target="_blank">→ Install store v1.10.16</a>
8080
<br>
81-
<a href="https://homey.app/a/no.tiwas.booleantoolbox/test/" target="_blank">→ Install test v1.10.16</a>
81+
<a href="https://homey.app/a/no.tiwas.booleantoolbox/test/" target="_blank">→ Install test v1.10.17</a>
8282

8383
---
8484

@@ -146,8 +146,8 @@ THEN: Wait until coffee machine temperature ≥ 90°C (timeout 5 min)
146146

147147
## Installation and Links
148148

149-
* **Homey App Store (v1.10.9, stable):** <a href="https://homey.app/en-no/app/no.tiwas.booleantoolbox/" target="_blank">Install Smart (Components) Toolkit</a>
150-
* **Test channel (v1.10.16):** <a href="https://homey.app/a/no.tiwas.booleantoolbox/test/" target="_blank">Install test version</a>
149+
* **Homey App Store (v1.10.16):** <a href="https://homey.app/en-no/app/no.tiwas.booleantoolbox/" target="_blank">Install Smart (Components) Toolkit</a>
150+
* **Test channel (v1.10.17):** <a href="https://homey.app/a/no.tiwas.booleantoolbox/test/" target="_blank">Install test version</a>
151151
* **GitHub Repo:** <a href="https://github.com/tiwas/SmartComponentsToolkit" target="_blank">github.com/tiwas/SmartComponentsToolkit</a>
152152
* **Online Emulator:** <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/emulator.html" target="_blank">Boolean Logic Emulator</a>
153153
* **Formula Builder:** <a href="https://tiwas.github.io/SmartComponentsToolkit/tools/formula-builder.html" target="_blank">Formula Builder</a>

no.tiwas.booleantoolbox/.homeychangelog.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,8 @@
9797
},
9898
"1.10.16": {
9999
"en": "Captures Homey device IDs and names so Flow Doctor (https://tiwas.github.io/SmartComponentsToolkit/tools/flow-doctor.html) can resolve references to previously deleted devices."
100+
},
101+
"1.10.17": {
102+
"en": "Added Math Compare and Gradient Map flow cards. Gradient Map outputs a Mapped value tag and supports range offsets plus configurable rounding."
100103
}
101104
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"id": "calculate_gradient",
3+
"title": {
4+
"en": "Calculate gradient output",
5+
"no": "Beregn gradientverdi"
6+
},
7+
"hint": {
8+
"en": "Maps the current value, for example a temperature tag, from one numeric range to another and returns the result as a Flow tag. Range from/to can use optional offsets. Values outside the range are clamped, and the output is rounded to the selected step.",
9+
"no": "Mapper den målte verdien, for eksempel en temperaturtagg, fra ett tallområde til et annet og returnerer resultatet som en Flow-tagg. Område fra/til kan ha valgfrie offsetverdier. Verdier utenfor området begrenses til min/maks, og output rundes av til valgt steg."
10+
},
11+
"args": [
12+
{
13+
"type": "number",
14+
"name": "input_value",
15+
"title": {
16+
"en": "Current value",
17+
"no": "Målt verdi"
18+
},
19+
"placeholder": {
20+
"en": "Temperature tag or number",
21+
"no": "Temperaturtagg eller tall"
22+
}
23+
},
24+
{
25+
"type": "number",
26+
"name": "from_num",
27+
"title": {
28+
"en": "Range from",
29+
"no": "Område fra"
30+
},
31+
"placeholder": {
32+
"en": "18",
33+
"no": "18"
34+
}
35+
},
36+
{
37+
"type": "number",
38+
"name": "from_num_offset",
39+
"title": {
40+
"en": "Range from offset",
41+
"no": "Offset fra"
42+
},
43+
"placeholder": {
44+
"en": "0",
45+
"no": "0"
46+
},
47+
"defaultValue": 0,
48+
"required": false
49+
},
50+
{
51+
"type": "number",
52+
"name": "to_num",
53+
"title": {
54+
"en": "Range to",
55+
"no": "Område til"
56+
},
57+
"placeholder": {
58+
"en": "23",
59+
"no": "23"
60+
}
61+
},
62+
{
63+
"type": "number",
64+
"name": "to_num_offset",
65+
"title": {
66+
"en": "Range to offset",
67+
"no": "Offset til"
68+
},
69+
"placeholder": {
70+
"en": "0",
71+
"no": "0"
72+
},
73+
"defaultValue": 0,
74+
"required": false
75+
},
76+
{
77+
"type": "number",
78+
"name": "from_out",
79+
"title": {
80+
"en": "Output from",
81+
"no": "Output fra"
82+
},
83+
"placeholder": {
84+
"en": "100",
85+
"no": "100"
86+
}
87+
},
88+
{
89+
"type": "number",
90+
"name": "to_out",
91+
"title": {
92+
"en": "Output to",
93+
"no": "Output til"
94+
},
95+
"placeholder": {
96+
"en": "500",
97+
"no": "500"
98+
}
99+
},
100+
{
101+
"type": "number",
102+
"name": "round_to",
103+
"title": {
104+
"en": "Round to",
105+
"no": "Rund av til"
106+
},
107+
"placeholder": {
108+
"en": "1",
109+
"no": "1"
110+
},
111+
"defaultValue": 1,
112+
"required": false
113+
}
114+
],
115+
"tokens": [
116+
{
117+
"name": "mapped_value",
118+
"type": "number",
119+
"title": {
120+
"en": "Mapped value",
121+
"no": "Mappet verdi"
122+
},
123+
"example": 300
124+
}
125+
],
126+
"titleFormatted": {
127+
"en": "Map [[input_value]] in range [[from_num]] + [[from_num_offset]] to [[to_num]] + [[to_num_offset]] into [[from_out]]-[[to_out]], round to [[round_to]]",
128+
"no": "Map [[input_value]] i området [[from_num]] + [[from_num_offset]] til [[to_num]] + [[to_num_offset]] som [[from_out]]-[[to_out]], rund til [[round_to]]"
129+
}
130+
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"id": "math_compare",
3+
"title": {
4+
"en": "Calculated value is...",
5+
"no": "Beregnet verdi er..."
6+
},
7+
"hint": {
8+
"en": "Calculates a simple numeric expression and compares the result with another value. Number fields can use Homey number tags and Logic variables.",
9+
"no": "Beregner et enkelt numerisk uttrykk og sammenligner resultatet med en annen verdi. Tallfelt kan bruke Homey-tagger og Logic-variabler."
10+
},
11+
"args": [
12+
{
13+
"type": "number",
14+
"name": "left_value",
15+
"title": {
16+
"en": "Value",
17+
"no": "Verdi"
18+
},
19+
"placeholder": {
20+
"en": "Enter number or tag",
21+
"no": "Skriv inn tall eller tagg"
22+
}
23+
},
24+
{
25+
"type": "dropdown",
26+
"name": "math_operator",
27+
"title": {
28+
"en": "Math operator",
29+
"no": "Regneoperator"
30+
},
31+
"values": [
32+
{
33+
"id": "add",
34+
"title": {
35+
"en": "+",
36+
"no": "+"
37+
}
38+
},
39+
{
40+
"id": "subtract",
41+
"title": {
42+
"en": "-",
43+
"no": "-"
44+
}
45+
},
46+
{
47+
"id": "multiply",
48+
"title": {
49+
"en": "*",
50+
"no": "*"
51+
}
52+
},
53+
{
54+
"id": "divide",
55+
"title": {
56+
"en": "/",
57+
"no": "/"
58+
}
59+
}
60+
]
61+
},
62+
{
63+
"type": "number",
64+
"name": "operand_value",
65+
"title": {
66+
"en": "Operand value",
67+
"no": "Operandverdi"
68+
},
69+
"placeholder": {
70+
"en": "Enter number or tag",
71+
"no": "Skriv inn tall eller tagg"
72+
}
73+
},
74+
{
75+
"type": "dropdown",
76+
"name": "comparison_operator",
77+
"title": {
78+
"en": "Comparison",
79+
"no": "Sammenligning"
80+
},
81+
"values": [
82+
{
83+
"id": "lt",
84+
"title": {
85+
"en": "<",
86+
"no": "<"
87+
}
88+
},
89+
{
90+
"id": "lte",
91+
"title": {
92+
"en": "<=",
93+
"no": "<="
94+
}
95+
},
96+
{
97+
"id": "eq",
98+
"title": {
99+
"en": "=",
100+
"no": "="
101+
}
102+
},
103+
{
104+
"id": "neq",
105+
"title": {
106+
"en": "!=",
107+
"no": "!="
108+
}
109+
},
110+
{
111+
"id": "gte",
112+
"title": {
113+
"en": ">=",
114+
"no": ">="
115+
}
116+
},
117+
{
118+
"id": "gt",
119+
"title": {
120+
"en": ">",
121+
"no": ">"
122+
}
123+
}
124+
]
125+
},
126+
{
127+
"type": "number",
128+
"name": "right_value",
129+
"title": {
130+
"en": "Compare with",
131+
"no": "Sammenlign med"
132+
},
133+
"placeholder": {
134+
"en": "Enter number or tag",
135+
"no": "Skriv inn tall eller tagg"
136+
}
137+
}
138+
],
139+
"titleFormatted": {
140+
"en": "[[left_value]] [[math_operator]] [[operand_value]] [[comparison_operator]] [[right_value]]",
141+
"no": "[[left_value]] [[math_operator]] [[operand_value]] [[comparison_operator]] [[right_value]]"
142+
}
143+
}

0 commit comments

Comments
 (0)