NEWS
Einheit z.B. Lux auf 100% mit Verteilung über Leistungskurfe
-

Viele Grüße
M. -

Viele Grüße
M.@michl75 sagte:
die drei Regler auch so im Script umzusetzen
Vorschlag für 3 Werte Lichtstärke bei 25 %, 50 % und 75 % (4 Geraden):
const idLux = '...'; const idLicht = '...'; // 0 - 100 % const idGw25 = '0_userdata.0.Garten.Lux.Gw25'; const idGw50 = '0_userdata.0.Garten.Lux.Gw50'; const idGw75 = '0_userdata.0.Garten.Lux.Gw75'; var lux = getState(idLux).val; var Gw25 = getState(idGw25).val; var Gw50 = getState(idGw50).val; var Gw75 = getState(idGw75).val; function calcLight() { let light = 25 * lux / Gw25; if(lux > Gw25) light = 25 * (1 + lux / (Gw50 - Gw25)); if(lux > Gw50) light = 25 * (2 + lux / (Gw75 - Gw50)); if(lux > Gw75) light = 25 * (3 + lux / (100000 - Gw75)); setState(idLicht, light, true); } calcLight(); // Script start on(idGw25, function(dp) { Gw25 = dp.state.val; calcLight(); }); on(idGw50, function(dp) { Gw50 = dp.state.val; calcLight(); }); on(idGw75, function(dp) { Gw75 = dp.state.val; calcLight(); }); on(idLux, function(dp) { lux = dp.state.val; calcLight(); });
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login